hikyuu2/hikyuu_cpp/hikyuu/data_driver/base_info/sqlite/SQLiteBaseInfoDriver.h

57 lines
1.5 KiB
C++
Raw Normal View History

2015-01-07 01:26:14 +08:00
/*
* SQLiteBaseInfoDriver.h
*
* Created on: 2012-8-14
* Author: fasiondog
*/
#pragma once
2015-01-07 01:26:14 +08:00
#ifndef SQLITEBASEINFODRIVER_H_
#define SQLITEBASEINFODRIVER_H_
#include <sqlite3.h>
2016-04-03 00:08:31 +08:00
#include "../../../Log.h"
#include "../../BaseInfoDriver.h"
2015-01-07 01:26:14 +08:00
namespace hku {
class SQLiteBaseInfoDriver: public BaseInfoDriver {
public:
SQLiteBaseInfoDriver(): BaseInfoDriver("sqlite3") {}
2015-01-07 01:26:14 +08:00
virtual ~SQLiteBaseInfoDriver() { }
virtual bool _init();
virtual bool _loadMarketInfo();
virtual bool _loadStockTypeInfo();
virtual bool _loadStock();
2015-01-07 01:26:14 +08:00
virtual Parameter getFinanceInfo(const string& market, const string& code);
2015-01-07 01:26:14 +08:00
private:
bool _getStockWeightList(uint32, StockWeightList&);
2015-01-07 01:26:14 +08:00
private:
static int _getMarketTableCallBack(void *out, int nCol,
char **azVals, char **azCols);
2015-01-07 01:26:14 +08:00
static int _getStockTypeInfoTableCallBack(void *out, int nCol,
char **azVals, char **azCols);
2015-01-07 01:26:14 +08:00
static int _getStockWeightCallBack(void *out, int nCol,
char **azVals, char **azCols);
2015-01-07 01:26:14 +08:00
static int _getStockTableCallBack(void *out, int nCol,
char **azVals, char **azCols);
static int _getFinanceTableCallBack(void *out, int nCol,
char **azVals, char **azCols);
2015-01-07 01:26:14 +08:00
private:
//股票基本信息数据库实例
shared_ptr<sqlite3> m_db;
};
} /* namespace hku */
#endif /* SQLITEBASEINFODRIVER_H_ */