7 namespace CryptowatchDatabase {
9 class Api_Cost :
public Poco::RefCountedObject {
15 Poco::Int32 timeStamp;
17 bool isSetTimeStamp() {
18 return (timeStamp != std::numeric_limits<Poco::Int32>::max());
25 return (method !=
"Empty");
32 return (cost != std::numeric_limits<double>::max());
36 : timeStamp(std::numeric_limits<Poco::Int32>::max())
38 , cost(std::numeric_limits<double>::max())
48 Poco::Int32 timeStamp;
50 bool isSetTimeStamp() {
51 return (timeStamp != std::numeric_limits<Poco::Int32>::max());
58 return (method !=
"Empty");
65 return (cost != std::numeric_limits<double>::max());
72 : timeStamp(std::numeric_limits<Poco::Int32>::max())
74 , cost(std::numeric_limits<double>::max())
75 , id(std::numeric_limits<Poco::Int32>::max())
82 Api_Cost(Poco::Data::Session* _db, std::string _suffix =
"");
94 void insertMultiple(std::vector<Api_Cost::Record>& records);
96 void insertMultiple(std::vector<Api_Cost::RecordWithId>& records);
98 void insertMultipleUnique(std::vector<Api_Cost::Record>& records);
100 void deleteMultiple(std::vector<Api_Cost::RecordWithId>& records);
108 std::size_t getAll(std::vector<Api_Cost::RecordWithId>& records, std::string condition);
110 Poco::Data::Session* db;
112 std::string tableName;
116 class Tables :
public Poco::RefCountedObject {
119 Tables(Poco::Data::Session* _db);
127 Poco::Data::Session* db;
129 Poco::AutoPtr<Api_Cost> api_CostTable;
137 class Poco::Data::TypeHandler<
trader::CryptowatchDatabase::Api_Cost::Record>
140 static std::size_t size()
147 Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.timeStamp , pBinder, dir);
148 Poco::Data::TypeHandler<std::string>::bind(pos++, record.method , pBinder, dir);
149 Poco::Data::TypeHandler<double>::bind(pos++, record.cost , pBinder, dir);
154 Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.timeStamp, deflt.timeStamp, pExtr);
155 Poco::Data::TypeHandler<std::string>::extract(pos++, record.method, deflt.method, pExtr);
156 Poco::Data::TypeHandler<double>::extract(pos++, record.cost, deflt.cost, pExtr);
161 Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.timeStamp, pPrep);
162 Poco::Data::TypeHandler<std::string>::prepare(pos++, record.method, pPrep);
163 Poco::Data::TypeHandler<double>::prepare(pos++, record.cost, pPrep);
169 class Poco::Data::TypeHandler<
trader::CryptowatchDatabase::Api_Cost::RecordWithId>
172 static std::size_t size()
179 Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.timeStamp , pBinder, dir);
180 Poco::Data::TypeHandler<std::string>::bind(pos++, record.method , pBinder, dir);
181 Poco::Data::TypeHandler<double>::bind(pos++, record.cost , pBinder, dir);
182 Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.id, pBinder, dir);
187 Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.timeStamp, deflt.timeStamp, pExtr);
188 Poco::Data::TypeHandler<std::string>::extract(pos++, record.method, deflt.method, pExtr);
189 Poco::Data::TypeHandler<double>::extract(pos++, record.cost, deflt.cost, pExtr);
190 Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.id, deflt.id, pExtr);
195 Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.timeStamp, pPrep);
196 Poco::Data::TypeHandler<std::string>::prepare(pos++, record.method, pPrep);
197 Poco::Data::TypeHandler<double>::prepare(pos++, record.cost, pPrep);
198 Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.id, pPrep);
Definition: cryptowatchdatabase.h:12
Definition: cryptowatchdatabase.h:116
Definition: cryptowatchdatabase.h:9
Definition: cryptowatchdatabase.h:45