7 namespace BittrexDatabase {
18 return (tradeId != std::numeric_limits<Poco::Int32>::max());
22 Poco::Int32 timeStamp;
24 bool isSetTimeStamp() {
25 return (timeStamp != std::numeric_limits<Poco::Int32>::max());
32 return (volume != std::numeric_limits<double>::max());
39 return (price != std::numeric_limits<double>::max());
46 return (total != std::numeric_limits<double>::max());
52 bool isSetFillType() {
53 return (fillType !=
"Empty");
57 std::string orderType;
59 bool isSetOrderType() {
60 return (orderType !=
"Empty");
64 : tradeId(std::numeric_limits<Poco::Int32>::max())
65 , timeStamp(std::numeric_limits<Poco::Int32>::max())
66 , volume(std::numeric_limits<double>::max())
67 , price(std::numeric_limits<double>::max())
68 , total(std::numeric_limits<double>::max())
83 return (tradeId != std::numeric_limits<Poco::Int32>::max());
87 Poco::Int32 timeStamp;
89 bool isSetTimeStamp() {
90 return (timeStamp != std::numeric_limits<Poco::Int32>::max());
97 return (volume != std::numeric_limits<double>::max());
104 return (price != std::numeric_limits<double>::max());
111 return (total != std::numeric_limits<double>::max());
115 std::string fillType;
117 bool isSetFillType() {
118 return (fillType !=
"Empty");
122 std::string orderType;
124 bool isSetOrderType() {
125 return (orderType !=
"Empty");
132 : tradeId(std::numeric_limits<Poco::Int32>::max())
133 , timeStamp(std::numeric_limits<Poco::Int32>::max())
134 , volume(std::numeric_limits<double>::max())
135 , price(std::numeric_limits<double>::max())
136 , total(std::numeric_limits<double>::max())
139 , id(std::numeric_limits<Poco::Int32>::max())
146 Trade_History(Poco::Data::Session* _db, std::string _suffix =
"");
158 void insertMultiple(std::vector<Trade_History::Record>& records);
160 void insertMultiple(std::vector<Trade_History::RecordWithId>& records);
162 void insertMultipleUnique(std::vector<Trade_History::Record>& records);
164 void deleteMultiple(std::vector<Trade_History::RecordWithId>& records);
172 std::size_t getAll(std::vector<Trade_History::RecordWithId>& records, std::string condition);
174 Poco::Data::Session* db;
176 std::string tableName;
188 bool isSetCreated() {
189 return (created != std::numeric_limits<Poco::Int32>::max());
193 std::string marketName;
195 bool isSetMarketName() {
196 return (marketName !=
"Empty");
200 std::string marketCurrency;
202 bool isSetMarketCurrency() {
203 return (marketCurrency !=
"Empty");
207 std::string baseCurrency;
209 bool isSetBaseCurrency() {
210 return (baseCurrency !=
"Empty");
214 std::string marketCurrencyLong;
216 bool isSetMarketCurrencyLong() {
217 return (marketCurrencyLong !=
"Empty");
221 double baseCurrencyLong;
223 bool isSetBaseCurrencyLong() {
224 return (baseCurrencyLong != std::numeric_limits<double>::max());
230 bool isSetMinTradeSize() {
231 return (minTradeSize != std::numeric_limits<double>::max());
235 : created(std::numeric_limits<Poco::Int32>::max())
236 , marketName(
"Empty")
237 , marketCurrency(
"Empty")
238 , baseCurrency(
"Empty")
239 , marketCurrencyLong(
"Empty")
240 , baseCurrencyLong(std::numeric_limits<double>::max())
241 , minTradeSize(std::numeric_limits<double>::max())
253 bool isSetCreated() {
254 return (created != std::numeric_limits<Poco::Int32>::max());
258 std::string marketName;
260 bool isSetMarketName() {
261 return (marketName !=
"Empty");
265 std::string marketCurrency;
267 bool isSetMarketCurrency() {
268 return (marketCurrency !=
"Empty");
272 std::string baseCurrency;
274 bool isSetBaseCurrency() {
275 return (baseCurrency !=
"Empty");
279 std::string marketCurrencyLong;
281 bool isSetMarketCurrencyLong() {
282 return (marketCurrencyLong !=
"Empty");
286 double baseCurrencyLong;
288 bool isSetBaseCurrencyLong() {
289 return (baseCurrencyLong != std::numeric_limits<double>::max());
295 bool isSetMinTradeSize() {
296 return (minTradeSize != std::numeric_limits<double>::max());
303 : created(std::numeric_limits<Poco::Int32>::max())
304 , marketName(
"Empty")
305 , marketCurrency(
"Empty")
306 , baseCurrency(
"Empty")
307 , marketCurrencyLong(
"Empty")
308 , baseCurrencyLong(std::numeric_limits<double>::max())
309 , minTradeSize(std::numeric_limits<double>::max())
310 , id(std::numeric_limits<Poco::Int32>::max())
317 Market_List(Poco::Data::Session* _db, std::string _suffix =
"");
329 void insertMultiple(std::vector<Market_List::Record>& records);
331 void insertMultiple(std::vector<Market_List::RecordWithId>& records);
333 void insertMultipleUnique(std::vector<Market_List::Record>& records);
335 void deleteMultiple(std::vector<Market_List::RecordWithId>& records);
343 std::size_t getAll(std::vector<Market_List::RecordWithId>& records, std::string condition);
345 Poco::Data::Session* db;
347 std::string tableName;
351 class Tables :
public Poco::RefCountedObject {
354 Tables(Poco::Data::Session* _db);
362 Poco::Data::Session* db;
364 Poco::AutoPtr<Trade_History> trade_HistoryTable;
366 Poco::AutoPtr<Market_List> market_ListTable;
374 class Poco::Data::TypeHandler<
trader::BittrexDatabase::Trade_History::Record>
377 static std::size_t size()
384 Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.tradeId , pBinder, dir);
385 Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.timeStamp , pBinder, dir);
386 Poco::Data::TypeHandler<double>::bind(pos++, record.volume , pBinder, dir);
387 Poco::Data::TypeHandler<double>::bind(pos++, record.price , pBinder, dir);
388 Poco::Data::TypeHandler<double>::bind(pos++, record.total , pBinder, dir);
389 Poco::Data::TypeHandler<std::string>::bind(pos++, record.fillType , pBinder, dir);
390 Poco::Data::TypeHandler<std::string>::bind(pos++, record.orderType , pBinder, dir);
395 Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.tradeId, deflt.tradeId, pExtr);
396 Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.timeStamp, deflt.timeStamp, pExtr);
397 Poco::Data::TypeHandler<double>::extract(pos++, record.volume, deflt.volume, pExtr);
398 Poco::Data::TypeHandler<double>::extract(pos++, record.price, deflt.price, pExtr);
399 Poco::Data::TypeHandler<double>::extract(pos++, record.total, deflt.total, pExtr);
400 Poco::Data::TypeHandler<std::string>::extract(pos++, record.fillType, deflt.fillType, pExtr);
401 Poco::Data::TypeHandler<std::string>::extract(pos++, record.orderType, deflt.orderType, pExtr);
406 Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.tradeId, pPrep);
407 Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.timeStamp, pPrep);
408 Poco::Data::TypeHandler<double>::prepare(pos++, record.volume, pPrep);
409 Poco::Data::TypeHandler<double>::prepare(pos++, record.price, pPrep);
410 Poco::Data::TypeHandler<double>::prepare(pos++, record.total, pPrep);
411 Poco::Data::TypeHandler<std::string>::prepare(pos++, record.fillType, pPrep);
412 Poco::Data::TypeHandler<std::string>::prepare(pos++, record.orderType, pPrep);
418 class Poco::Data::TypeHandler<
trader::BittrexDatabase::Trade_History::RecordWithId>
421 static std::size_t size()
428 Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.tradeId , pBinder, dir);
429 Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.timeStamp , pBinder, dir);
430 Poco::Data::TypeHandler<double>::bind(pos++, record.volume , pBinder, dir);
431 Poco::Data::TypeHandler<double>::bind(pos++, record.price , pBinder, dir);
432 Poco::Data::TypeHandler<double>::bind(pos++, record.total , pBinder, dir);
433 Poco::Data::TypeHandler<std::string>::bind(pos++, record.fillType , pBinder, dir);
434 Poco::Data::TypeHandler<std::string>::bind(pos++, record.orderType , pBinder, dir);
435 Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.id, pBinder, dir);
440 Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.tradeId, deflt.tradeId, pExtr);
441 Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.timeStamp, deflt.timeStamp, pExtr);
442 Poco::Data::TypeHandler<double>::extract(pos++, record.volume, deflt.volume, pExtr);
443 Poco::Data::TypeHandler<double>::extract(pos++, record.price, deflt.price, pExtr);
444 Poco::Data::TypeHandler<double>::extract(pos++, record.total, deflt.total, pExtr);
445 Poco::Data::TypeHandler<std::string>::extract(pos++, record.fillType, deflt.fillType, pExtr);
446 Poco::Data::TypeHandler<std::string>::extract(pos++, record.orderType, deflt.orderType, pExtr);
447 Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.id, deflt.id, pExtr);
452 Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.tradeId, pPrep);
453 Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.timeStamp, pPrep);
454 Poco::Data::TypeHandler<double>::prepare(pos++, record.volume, pPrep);
455 Poco::Data::TypeHandler<double>::prepare(pos++, record.price, pPrep);
456 Poco::Data::TypeHandler<double>::prepare(pos++, record.total, pPrep);
457 Poco::Data::TypeHandler<std::string>::prepare(pos++, record.fillType, pPrep);
458 Poco::Data::TypeHandler<std::string>::prepare(pos++, record.orderType, pPrep);
459 Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.id, pPrep);
465 class Poco::Data::TypeHandler<
trader::BittrexDatabase::Market_List::Record>
468 static std::size_t size()
475 Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.created , pBinder, dir);
476 Poco::Data::TypeHandler<std::string>::bind(pos++, record.marketName , pBinder, dir);
477 Poco::Data::TypeHandler<std::string>::bind(pos++, record.marketCurrency , pBinder, dir);
478 Poco::Data::TypeHandler<std::string>::bind(pos++, record.baseCurrency , pBinder, dir);
479 Poco::Data::TypeHandler<std::string>::bind(pos++, record.marketCurrencyLong , pBinder, dir);
480 Poco::Data::TypeHandler<double>::bind(pos++, record.baseCurrencyLong , pBinder, dir);
481 Poco::Data::TypeHandler<double>::bind(pos++, record.minTradeSize , pBinder, dir);
486 Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.created, deflt.created, pExtr);
487 Poco::Data::TypeHandler<std::string>::extract(pos++, record.marketName, deflt.marketName, pExtr);
488 Poco::Data::TypeHandler<std::string>::extract(pos++, record.marketCurrency, deflt.marketCurrency, pExtr);
489 Poco::Data::TypeHandler<std::string>::extract(pos++, record.baseCurrency, deflt.baseCurrency, pExtr);
490 Poco::Data::TypeHandler<std::string>::extract(pos++, record.marketCurrencyLong, deflt.marketCurrencyLong, pExtr);
491 Poco::Data::TypeHandler<double>::extract(pos++, record.baseCurrencyLong, deflt.baseCurrencyLong, pExtr);
492 Poco::Data::TypeHandler<double>::extract(pos++, record.minTradeSize, deflt.minTradeSize, pExtr);
497 Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.created, pPrep);
498 Poco::Data::TypeHandler<std::string>::prepare(pos++, record.marketName, pPrep);
499 Poco::Data::TypeHandler<std::string>::prepare(pos++, record.marketCurrency, pPrep);
500 Poco::Data::TypeHandler<std::string>::prepare(pos++, record.baseCurrency, pPrep);
501 Poco::Data::TypeHandler<std::string>::prepare(pos++, record.marketCurrencyLong, pPrep);
502 Poco::Data::TypeHandler<double>::prepare(pos++, record.baseCurrencyLong, pPrep);
503 Poco::Data::TypeHandler<double>::prepare(pos++, record.minTradeSize, pPrep);
509 class Poco::Data::TypeHandler<
trader::BittrexDatabase::Market_List::RecordWithId>
512 static std::size_t size()
519 Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.created , pBinder, dir);
520 Poco::Data::TypeHandler<std::string>::bind(pos++, record.marketName , pBinder, dir);
521 Poco::Data::TypeHandler<std::string>::bind(pos++, record.marketCurrency , pBinder, dir);
522 Poco::Data::TypeHandler<std::string>::bind(pos++, record.baseCurrency , pBinder, dir);
523 Poco::Data::TypeHandler<std::string>::bind(pos++, record.marketCurrencyLong , pBinder, dir);
524 Poco::Data::TypeHandler<double>::bind(pos++, record.baseCurrencyLong , pBinder, dir);
525 Poco::Data::TypeHandler<double>::bind(pos++, record.minTradeSize , pBinder, dir);
526 Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.id, pBinder, dir);
531 Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.created, deflt.created, pExtr);
532 Poco::Data::TypeHandler<std::string>::extract(pos++, record.marketName, deflt.marketName, pExtr);
533 Poco::Data::TypeHandler<std::string>::extract(pos++, record.marketCurrency, deflt.marketCurrency, pExtr);
534 Poco::Data::TypeHandler<std::string>::extract(pos++, record.baseCurrency, deflt.baseCurrency, pExtr);
535 Poco::Data::TypeHandler<std::string>::extract(pos++, record.marketCurrencyLong, deflt.marketCurrencyLong, pExtr);
536 Poco::Data::TypeHandler<double>::extract(pos++, record.baseCurrencyLong, deflt.baseCurrencyLong, pExtr);
537 Poco::Data::TypeHandler<double>::extract(pos++, record.minTradeSize, deflt.minTradeSize, pExtr);
538 Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.id, deflt.id, pExtr);
543 Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.created, pPrep);
544 Poco::Data::TypeHandler<std::string>::prepare(pos++, record.marketName, pPrep);
545 Poco::Data::TypeHandler<std::string>::prepare(pos++, record.marketCurrency, pPrep);
546 Poco::Data::TypeHandler<std::string>::prepare(pos++, record.baseCurrency, pPrep);
547 Poco::Data::TypeHandler<std::string>::prepare(pos++, record.marketCurrencyLong, pPrep);
548 Poco::Data::TypeHandler<double>::prepare(pos++, record.baseCurrencyLong, pPrep);
549 Poco::Data::TypeHandler<double>::prepare(pos++, record.minTradeSize, pPrep);
550 Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.id, pPrep);
Definition: bittrexdatabase.h:351
Definition: bittrexdatabase.h:180
Definition: bittrexdatabase.h:9
Definition: bittrexdatabase.h:248
Definition: bittrexdatabase.h:77
Definition: bittrexdatabase.h:12
Definition: bittrexdatabase.h:183