hikyuu2/libs/hikyuu/data_driver/base_info/sqlite/SQLiteBaseInfoDriver.h
2016-04-03 00:08:31 +08:00

50 lines
1.3 KiB
C++

/*
* SQLiteBaseInfoDriver.h
*
* Created on: 2012-8-14
* Author: fasiondog
*/
#ifndef SQLITEBASEINFODRIVER_H_
#define SQLITEBASEINFODRIVER_H_
#include <sqlite3.h>
#include "../../../Log.h"
#include "../../BaseInfoDriver.h"
namespace hku {
class SQLiteBaseInfoDriver: public BaseInfoDriver {
public:
SQLiteBaseInfoDriver(const shared_ptr<IniParser>& config);
virtual ~SQLiteBaseInfoDriver() { }
virtual bool loadMarketInfo(MarketInfoMap& out);
virtual bool loadStockTypeInfo(StockTypeInfoMap& out);
virtual bool loadStock();
private:
bool _getStockWeightList(hku_uint32, StockWeightList&);
private:
static int _getMarketTableCallBack(void *out, int nCol,
char **azVals, char **azCols);
static int _getStockTypeInfoTableCallBack(void *out, int nCol,
char **azVals, char **azCols);
static int _getStockWeightCallBack(void *out, int nCol,
char **azVals, char **azCols);
static int _getStockTableCallBack(void *out, int nCol,
char **azVals, char **azCols);
private:
//股票基本信息数据库实例
shared_ptr<sqlite3> m_db;
};
} /* namespace hku */
#endif /* SQLITEBASEINFODRIVER_H_ */