hikyuu2/hikyuu_cpp/hikyuu/data_driver/BlockInfoDriver.h

78 lines
1.6 KiB
C++
Raw Normal View History

2016-04-03 00:08:31 +08:00
/*
* BlockInfoDriver.h
*
* Created on: 2015210
2016-04-14 01:36:53 +08:00
* Author: fasiondog
2016-04-03 00:08:31 +08:00
*/
#ifndef DATA_DRIVER_BLOCKINFODRIVER_H_
#define DATA_DRIVER_BLOCKINFODRIVER_H_
#include "../utilities/Parameter.h"
2016-04-03 00:08:31 +08:00
#include "../Block.h"
namespace hku {
class HKU_API BlockInfoDriver {
PARAMETER_SUPPORT
2016-04-03 00:08:31 +08:00
public:
BlockInfoDriver(const string& name);
2016-04-03 00:08:31 +08:00
virtual ~BlockInfoDriver() {};
const string& name() const;
/**
*
* @param params
* @return
*/
bool init(const Parameter& params);
/**
*
*/
virtual bool _init() = 0;
2016-04-03 00:08:31 +08:00
/**
*
* @param category
* @param name
* @return
*/
virtual Block getBlock(const string& category, const string& name) = 0;
/**
*
* @param category
* @return
*/
virtual BlockList getBlockList(const string& category) = 0;
/**
*
* @return
*/
virtual BlockList getBlockList() = 0;
private:
bool checkType();
2016-04-03 00:08:31 +08:00
protected:
string m_name;
2016-04-03 00:08:31 +08:00
};
typedef shared_ptr<BlockInfoDriver> BlockInfoDriverPtr;
2017-10-20 02:11:57 +08:00
HKU_API std::ostream & operator<<(std::ostream&, const BlockInfoDriver&);
HKU_API std::ostream & operator<<(std::ostream&, const BlockInfoDriverPtr&);
inline const string& BlockInfoDriver::name() const {
return m_name;
}
2016-04-03 00:08:31 +08:00
} /* namespace hku */
#endif /* DATA_DRIVER_BLOCKINFODRIVER_H_ */