trader  v0.1a
A framework to build trading applications
fybdatabase.h
1 
2 #pragma once
3 
4 
5 namespace trader {
6 
7  namespace FybDatabase {
8 
9  class Ticker_Detailed : public Poco::RefCountedObject {
10  public:
11 
12  struct Record {
13 
14  // Current Unix Timestamp
15  Poco::Int32 timeStamp;
16 
17  bool isSetTimeStamp() {
18  return (timeStamp != std::numeric_limits<Poco::Int32>::max());
19  }
20 
21  // Snapshot of Ask Price
22  double ask;
23 
24  bool isSetAsk() {
25  return (ask != std::numeric_limits<double>::max());
26  }
27 
28  // Snapshot of Bid Price
29  double bid;
30 
31  bool isSetBid() {
32  return (bid != std::numeric_limits<double>::max());
33  }
34 
35  // Snapshot of Last Price
36  double last;
37 
38  bool isSetLast() {
39  return (last != std::numeric_limits<double>::max());
40  }
41 
42  // Trading Volume
43  double vol;
44 
45  bool isSetVol() {
46  return (vol != std::numeric_limits<double>::max());
47  }
48 
49  Record()
50  : timeStamp(std::numeric_limits<Poco::Int32>::max())
51  , ask(std::numeric_limits<double>::max())
52  , bid(std::numeric_limits<double>::max())
53  , last(std::numeric_limits<double>::max())
54  , vol(std::numeric_limits<double>::max())
55  {
56  }
57 
58  };
59 
60 
61  struct RecordWithId {
62 
63  // Current Unix Timestamp
64  Poco::Int32 timeStamp;
65 
66  bool isSetTimeStamp() {
67  return (timeStamp != std::numeric_limits<Poco::Int32>::max());
68  }
69 
70  // Snapshot of Ask Price
71  double ask;
72 
73  bool isSetAsk() {
74  return (ask != std::numeric_limits<double>::max());
75  }
76 
77  // Snapshot of Bid Price
78  double bid;
79 
80  bool isSetBid() {
81  return (bid != std::numeric_limits<double>::max());
82  }
83 
84  // Snapshot of Last Price
85  double last;
86 
87  bool isSetLast() {
88  return (last != std::numeric_limits<double>::max());
89  }
90 
91  // Trading Volume
92  double vol;
93 
94  bool isSetVol() {
95  return (vol != std::numeric_limits<double>::max());
96  }
97 
98  //Record ID in database
99  Poco::Int32 id;
100 
101  RecordWithId()
102  : timeStamp(std::numeric_limits<Poco::Int32>::max())
103  , ask(std::numeric_limits<double>::max())
104  , bid(std::numeric_limits<double>::max())
105  , last(std::numeric_limits<double>::max())
106  , vol(std::numeric_limits<double>::max())
107  , id(std::numeric_limits<Poco::Int32>::max())
108  {
109  }
110 
111  };
112 
113 
114  Ticker_Detailed(Poco::Data::Session* _db, std::string _suffix = "");
115 
116  ~Ticker_Detailed();
117 
118  void init();
119 
120  void clear();
121 
122  void insert(Ticker_Detailed::Record& record);
123 
124  void insertOnce(Ticker_Detailed::Record& record);
125 
126  void insertMultiple(std::vector<Ticker_Detailed::Record>& records);
127 
128  void insertMultiple(std::vector<Ticker_Detailed::RecordWithId>& records);
129 
130  void insertMultipleUnique(std::vector<Ticker_Detailed::Record>& records);
131 
132  void deleteMultiple(std::vector<Ticker_Detailed::RecordWithId>& records);
133 
134  void insertAndDeleteUnchanged(Ticker_Detailed::Record& record);
135 
136  void insertUnique(Ticker_Detailed::Record& record);
137 
138  void getLatest(Ticker_Detailed::RecordWithId& rec);
139 
140  std::size_t getAll(std::vector<Ticker_Detailed::RecordWithId>& records, std::string condition);
141 
142  Poco::Data::Session* db;
143 
144  std::string tableName;
145 
146  }; //Ticker_Detailed
147 
148  class Account_Balance : public Poco::RefCountedObject {
149  public:
150 
151  struct Record {
152 
153  // Current Unix Timestamp
154  Poco::Int32 timeStamp;
155 
156  bool isSetTimeStamp() {
157  return (timeStamp != std::numeric_limits<Poco::Int32>::max());
158  }
159 
160  // BTC remaining in Account
161  double btcBal;
162 
163  bool isSetBtcBal() {
164  return (btcBal != std::numeric_limits<double>::max());
165  }
166 
167  // SGD available in Account
168  double sgdBal;
169 
170  bool isSetSgdBal() {
171  return (sgdBal != std::numeric_limits<double>::max());
172  }
173 
174  Record()
175  : timeStamp(std::numeric_limits<Poco::Int32>::max())
176  , btcBal(std::numeric_limits<double>::max())
177  , sgdBal(std::numeric_limits<double>::max())
178  {
179  }
180 
181  };
182 
183 
184  struct RecordWithId {
185 
186  // Current Unix Timestamp
187  Poco::Int32 timeStamp;
188 
189  bool isSetTimeStamp() {
190  return (timeStamp != std::numeric_limits<Poco::Int32>::max());
191  }
192 
193  // BTC remaining in Account
194  double btcBal;
195 
196  bool isSetBtcBal() {
197  return (btcBal != std::numeric_limits<double>::max());
198  }
199 
200  // SGD available in Account
201  double sgdBal;
202 
203  bool isSetSgdBal() {
204  return (sgdBal != std::numeric_limits<double>::max());
205  }
206 
207  //Record ID in database
208  Poco::Int32 id;
209 
210  RecordWithId()
211  : timeStamp(std::numeric_limits<Poco::Int32>::max())
212  , btcBal(std::numeric_limits<double>::max())
213  , sgdBal(std::numeric_limits<double>::max())
214  , id(std::numeric_limits<Poco::Int32>::max())
215  {
216  }
217 
218  };
219 
220 
221  Account_Balance(Poco::Data::Session* _db, std::string _suffix = "");
222 
223  ~Account_Balance();
224 
225  void init();
226 
227  void clear();
228 
229  void insert(Account_Balance::Record& record);
230 
231  void insertOnce(Account_Balance::Record& record);
232 
233  void insertMultiple(std::vector<Account_Balance::Record>& records);
234 
235  void insertMultiple(std::vector<Account_Balance::RecordWithId>& records);
236 
237  void insertMultipleUnique(std::vector<Account_Balance::Record>& records);
238 
239  void deleteMultiple(std::vector<Account_Balance::RecordWithId>& records);
240 
241  void insertAndDeleteUnchanged(Account_Balance::Record& record);
242 
243  void insertUnique(Account_Balance::Record& record);
244 
245  void getLatest(Account_Balance::RecordWithId& rec);
246 
247  std::size_t getAll(std::vector<Account_Balance::RecordWithId>& records, std::string condition);
248 
249  Poco::Data::Session* db;
250 
251  std::string tableName;
252 
253  }; //Account_Balance
254 
255  class Account_Info : public Poco::RefCountedObject {
256  public:
257 
258  struct Record {
259 
260  // FYB Account Number for SGD Deposits
261  std::string accNum;
262 
263  bool isSetAccNum() {
264  return (accNum != "Empty");
265  }
266 
267  // BTC Address to Deposit Funds
268  std::string btcAddress;
269 
270  bool isSetBtcAddress() {
271  return (btcAddress != "Empty");
272  }
273 
274  // Registered Email Address
275  std::string email;
276 
277  bool isSetEmail() {
278  return (email != "Empty");
279  }
280 
281  Record()
282  : accNum("Empty")
283  , btcAddress("Empty")
284  , email("Empty")
285  {
286  }
287 
288  };
289 
290 
291  struct RecordWithId {
292 
293  // FYB Account Number for SGD Deposits
294  std::string accNum;
295 
296  bool isSetAccNum() {
297  return (accNum != "Empty");
298  }
299 
300  // BTC Address to Deposit Funds
301  std::string btcAddress;
302 
303  bool isSetBtcAddress() {
304  return (btcAddress != "Empty");
305  }
306 
307  // Registered Email Address
308  std::string email;
309 
310  bool isSetEmail() {
311  return (email != "Empty");
312  }
313 
314  //Record ID in database
315  Poco::Int32 id;
316 
317  RecordWithId()
318  : accNum("Empty")
319  , btcAddress("Empty")
320  , email("Empty")
321  , id(std::numeric_limits<Poco::Int32>::max())
322  {
323  }
324 
325  };
326 
327 
328  Account_Info(Poco::Data::Session* _db, std::string _suffix = "");
329 
330  ~Account_Info();
331 
332  void init();
333 
334  void clear();
335 
336  void insert(Account_Info::Record& record);
337 
338  void insertOnce(Account_Info::Record& record);
339 
340  void insertMultiple(std::vector<Account_Info::Record>& records);
341 
342  void insertMultiple(std::vector<Account_Info::RecordWithId>& records);
343 
344  void insertMultipleUnique(std::vector<Account_Info::Record>& records);
345 
346  void deleteMultiple(std::vector<Account_Info::RecordWithId>& records);
347 
348  void insertAndDeleteUnchanged(Account_Info::Record& record);
349 
350  void insertUnique(Account_Info::Record& record);
351 
352  void getLatest(Account_Info::RecordWithId& rec);
353 
354  std::size_t getAll(std::vector<Account_Info::RecordWithId>& records, std::string condition);
355 
356  Poco::Data::Session* db;
357 
358  std::string tableName;
359 
360  }; //Account_Info
361 
362  class Trade_History : public Poco::RefCountedObject {
363  public:
364 
365  struct Record {
366 
367  // Id for each trade
368  Poco::Int32 tid;
369 
370  bool isSetTid() {
371  return (tid != std::numeric_limits<Poco::Int32>::max());
372  }
373 
374  // Amount traded in this transaction
375  double amt;
376 
377  bool isSetAmt() {
378  return (amt != std::numeric_limits<double>::max());
379  }
380 
381  // Price at which trade was made
382  double price;
383 
384  bool isSetPrice() {
385  return (price != std::numeric_limits<double>::max());
386  }
387 
388  // Date and Time when trade occured
389  Poco::Int32 date;
390 
391  bool isSetDate() {
392  return (date != std::numeric_limits<Poco::Int32>::max());
393  }
394 
395  Record()
396  : tid(std::numeric_limits<Poco::Int32>::max())
397  , amt(std::numeric_limits<double>::max())
398  , price(std::numeric_limits<double>::max())
399  , date(std::numeric_limits<Poco::Int32>::max())
400  {
401  }
402 
403  };
404 
405 
406  struct RecordWithId {
407 
408  // Id for each trade
409  Poco::Int32 tid;
410 
411  bool isSetTid() {
412  return (tid != std::numeric_limits<Poco::Int32>::max());
413  }
414 
415  // Amount traded in this transaction
416  double amt;
417 
418  bool isSetAmt() {
419  return (amt != std::numeric_limits<double>::max());
420  }
421 
422  // Price at which trade was made
423  double price;
424 
425  bool isSetPrice() {
426  return (price != std::numeric_limits<double>::max());
427  }
428 
429  // Date and Time when trade occured
430  Poco::Int32 date;
431 
432  bool isSetDate() {
433  return (date != std::numeric_limits<Poco::Int32>::max());
434  }
435 
436  //Record ID in database
437  Poco::Int32 id;
438 
439  RecordWithId()
440  : tid(std::numeric_limits<Poco::Int32>::max())
441  , amt(std::numeric_limits<double>::max())
442  , price(std::numeric_limits<double>::max())
443  , date(std::numeric_limits<Poco::Int32>::max())
444  , id(std::numeric_limits<Poco::Int32>::max())
445  {
446  }
447 
448  };
449 
450 
451  Trade_History(Poco::Data::Session* _db, std::string _suffix = "");
452 
453  ~Trade_History();
454 
455  void init();
456 
457  void clear();
458 
459  void insert(Trade_History::Record& record);
460 
461  void insertOnce(Trade_History::Record& record);
462 
463  void insertMultiple(std::vector<Trade_History::Record>& records);
464 
465  void insertMultiple(std::vector<Trade_History::RecordWithId>& records);
466 
467  void insertMultipleUnique(std::vector<Trade_History::Record>& records);
468 
469  void deleteMultiple(std::vector<Trade_History::RecordWithId>& records);
470 
471  void insertAndDeleteUnchanged(Trade_History::Record& record);
472 
473  void insertUnique(Trade_History::Record& record);
474 
475  void getLatest(Trade_History::RecordWithId& rec);
476 
477  std::size_t getAll(std::vector<Trade_History::RecordWithId>& records, std::string condition);
478 
479  Poco::Data::Session* db;
480 
481  std::string tableName;
482 
483  }; //Trade_History
484 
485  class Order_Book_Asks : public Poco::RefCountedObject {
486  public:
487 
488  struct Record {
489 
490  // Current Unix Timestamp
491  Poco::Int32 dateCreated;
492 
493  bool isSetDateCreated() {
494  return (dateCreated != std::numeric_limits<Poco::Int32>::max());
495  }
496 
497  // Current Unix Timestamp
498  Poco::Int32 dateRemoved;
499 
500  bool isSetDateRemoved() {
501  return (dateRemoved != std::numeric_limits<Poco::Int32>::max());
502  }
503 
504  // Price offered
505  double price;
506 
507  bool isSetPrice() {
508  return (price != std::numeric_limits<double>::max());
509  }
510 
511  // Volume at that price
512  double volume;
513 
514  bool isSetVolume() {
515  return (volume != std::numeric_limits<double>::max());
516  }
517 
518  Record()
519  : dateCreated(std::numeric_limits<Poco::Int32>::max())
520  , dateRemoved(std::numeric_limits<Poco::Int32>::max())
521  , price(std::numeric_limits<double>::max())
522  , volume(std::numeric_limits<double>::max())
523  {
524  }
525 
526  };
527 
528 
529  struct RecordWithId {
530 
531  // Current Unix Timestamp
532  Poco::Int32 dateCreated;
533 
534  bool isSetDateCreated() {
535  return (dateCreated != std::numeric_limits<Poco::Int32>::max());
536  }
537 
538  // Current Unix Timestamp
539  Poco::Int32 dateRemoved;
540 
541  bool isSetDateRemoved() {
542  return (dateRemoved != std::numeric_limits<Poco::Int32>::max());
543  }
544 
545  // Price offered
546  double price;
547 
548  bool isSetPrice() {
549  return (price != std::numeric_limits<double>::max());
550  }
551 
552  // Volume at that price
553  double volume;
554 
555  bool isSetVolume() {
556  return (volume != std::numeric_limits<double>::max());
557  }
558 
559  //Record ID in database
560  Poco::Int32 id;
561 
562  RecordWithId()
563  : dateCreated(std::numeric_limits<Poco::Int32>::max())
564  , dateRemoved(std::numeric_limits<Poco::Int32>::max())
565  , price(std::numeric_limits<double>::max())
566  , volume(std::numeric_limits<double>::max())
567  , id(std::numeric_limits<Poco::Int32>::max())
568  {
569  }
570 
571  };
572 
573 
574  Order_Book_Asks(Poco::Data::Session* _db, std::string _suffix = "");
575 
576  ~Order_Book_Asks();
577 
578  void init();
579 
580  void clear();
581 
582  void insert(Order_Book_Asks::Record& record);
583 
584  void insertOnce(Order_Book_Asks::Record& record);
585 
586  void insertMultiple(std::vector<Order_Book_Asks::Record>& records);
587 
588  void insertMultiple(std::vector<Order_Book_Asks::RecordWithId>& records);
589 
590  void insertMultipleUnique(std::vector<Order_Book_Asks::Record>& records);
591 
592  void deleteMultiple(std::vector<Order_Book_Asks::RecordWithId>& records);
593 
594  void insertAndDeleteUnchanged(Order_Book_Asks::Record& record);
595 
596  void insertUnique(Order_Book_Asks::Record& record);
597 
598  void getLatest(Order_Book_Asks::RecordWithId& rec);
599 
600  std::size_t getAll(std::vector<Order_Book_Asks::RecordWithId>& records, std::string condition);
601 
602  Poco::Data::Session* db;
603 
604  std::string tableName;
605 
606  }; //Order_Book_Asks
607 
608  class Order_Book_Bids : public Poco::RefCountedObject {
609  public:
610 
611  struct Record {
612 
613  // Current Unix Timestamp
614  Poco::Int32 dateCreated;
615 
616  bool isSetDateCreated() {
617  return (dateCreated != std::numeric_limits<Poco::Int32>::max());
618  }
619 
620  // Current Unix Timestamp
621  Poco::Int32 dateRemoved;
622 
623  bool isSetDateRemoved() {
624  return (dateRemoved != std::numeric_limits<Poco::Int32>::max());
625  }
626 
627  // Price offered
628  double price;
629 
630  bool isSetPrice() {
631  return (price != std::numeric_limits<double>::max());
632  }
633 
634  // Volume at that price
635  double volume;
636 
637  bool isSetVolume() {
638  return (volume != std::numeric_limits<double>::max());
639  }
640 
641  Record()
642  : dateCreated(std::numeric_limits<Poco::Int32>::max())
643  , dateRemoved(std::numeric_limits<Poco::Int32>::max())
644  , price(std::numeric_limits<double>::max())
645  , volume(std::numeric_limits<double>::max())
646  {
647  }
648 
649  };
650 
651 
652  struct RecordWithId {
653 
654  // Current Unix Timestamp
655  Poco::Int32 dateCreated;
656 
657  bool isSetDateCreated() {
658  return (dateCreated != std::numeric_limits<Poco::Int32>::max());
659  }
660 
661  // Current Unix Timestamp
662  Poco::Int32 dateRemoved;
663 
664  bool isSetDateRemoved() {
665  return (dateRemoved != std::numeric_limits<Poco::Int32>::max());
666  }
667 
668  // Price offered
669  double price;
670 
671  bool isSetPrice() {
672  return (price != std::numeric_limits<double>::max());
673  }
674 
675  // Volume at that price
676  double volume;
677 
678  bool isSetVolume() {
679  return (volume != std::numeric_limits<double>::max());
680  }
681 
682  //Record ID in database
683  Poco::Int32 id;
684 
685  RecordWithId()
686  : dateCreated(std::numeric_limits<Poco::Int32>::max())
687  , dateRemoved(std::numeric_limits<Poco::Int32>::max())
688  , price(std::numeric_limits<double>::max())
689  , volume(std::numeric_limits<double>::max())
690  , id(std::numeric_limits<Poco::Int32>::max())
691  {
692  }
693 
694  };
695 
696 
697  Order_Book_Bids(Poco::Data::Session* _db, std::string _suffix = "");
698 
699  ~Order_Book_Bids();
700 
701  void init();
702 
703  void clear();
704 
705  void insert(Order_Book_Bids::Record& record);
706 
707  void insertOnce(Order_Book_Bids::Record& record);
708 
709  void insertMultiple(std::vector<Order_Book_Bids::Record>& records);
710 
711  void insertMultiple(std::vector<Order_Book_Bids::RecordWithId>& records);
712 
713  void insertMultipleUnique(std::vector<Order_Book_Bids::Record>& records);
714 
715  void deleteMultiple(std::vector<Order_Book_Bids::RecordWithId>& records);
716 
717  void insertAndDeleteUnchanged(Order_Book_Bids::Record& record);
718 
719  void insertUnique(Order_Book_Bids::Record& record);
720 
721  void getLatest(Order_Book_Bids::RecordWithId& rec);
722 
723  std::size_t getAll(std::vector<Order_Book_Bids::RecordWithId>& records, std::string condition);
724 
725  Poco::Data::Session* db;
726 
727  std::string tableName;
728 
729  }; //Order_Book_Bids
730 
731  class My_Pending_Sell_Orders : public Poco::RefCountedObject {
732  public:
733 
734  struct Record {
735 
736  // Unique ticket id for each pending sell order
737  Poco::Int32 ticket;
738 
739  bool isSetTicket() {
740  return (ticket != std::numeric_limits<Poco::Int32>::max());
741  }
742 
743  // Amount traded in this transaction
744  double amt;
745 
746  bool isSetAmt() {
747  return (amt != std::numeric_limits<double>::max());
748  }
749 
750  // Price at which trade was made
751  double price;
752 
753  bool isSetPrice() {
754  return (price != std::numeric_limits<double>::max());
755  }
756 
757  // Date and Time order was created
758  Poco::Int32 date;
759 
760  bool isSetDate() {
761  return (date != std::numeric_limits<Poco::Int32>::max());
762  }
763 
764  Record()
765  : ticket(std::numeric_limits<Poco::Int32>::max())
766  , amt(std::numeric_limits<double>::max())
767  , price(std::numeric_limits<double>::max())
768  , date(std::numeric_limits<Poco::Int32>::max())
769  {
770  }
771 
772  };
773 
774 
775  struct RecordWithId {
776 
777  // Unique ticket id for each pending sell order
778  Poco::Int32 ticket;
779 
780  bool isSetTicket() {
781  return (ticket != std::numeric_limits<Poco::Int32>::max());
782  }
783 
784  // Amount traded in this transaction
785  double amt;
786 
787  bool isSetAmt() {
788  return (amt != std::numeric_limits<double>::max());
789  }
790 
791  // Price at which trade was made
792  double price;
793 
794  bool isSetPrice() {
795  return (price != std::numeric_limits<double>::max());
796  }
797 
798  // Date and Time order was created
799  Poco::Int32 date;
800 
801  bool isSetDate() {
802  return (date != std::numeric_limits<Poco::Int32>::max());
803  }
804 
805  //Record ID in database
806  Poco::Int32 id;
807 
808  RecordWithId()
809  : ticket(std::numeric_limits<Poco::Int32>::max())
810  , amt(std::numeric_limits<double>::max())
811  , price(std::numeric_limits<double>::max())
812  , date(std::numeric_limits<Poco::Int32>::max())
813  , id(std::numeric_limits<Poco::Int32>::max())
814  {
815  }
816 
817  };
818 
819 
820  My_Pending_Sell_Orders(Poco::Data::Session* _db, std::string _suffix = "");
821 
823 
824  void init();
825 
826  void clear();
827 
828  void insert(My_Pending_Sell_Orders::Record& record);
829 
830  void insertOnce(My_Pending_Sell_Orders::Record& record);
831 
832  void insertMultiple(std::vector<My_Pending_Sell_Orders::Record>& records);
833 
834  void insertMultiple(std::vector<My_Pending_Sell_Orders::RecordWithId>& records);
835 
836  void insertMultipleUnique(std::vector<My_Pending_Sell_Orders::Record>& records);
837 
838  void deleteMultiple(std::vector<My_Pending_Sell_Orders::RecordWithId>& records);
839 
840  void insertAndDeleteUnchanged(My_Pending_Sell_Orders::Record& record);
841 
842  void insertUnique(My_Pending_Sell_Orders::Record& record);
843 
844  void getLatest(My_Pending_Sell_Orders::RecordWithId& rec);
845 
846  std::size_t getAll(std::vector<My_Pending_Sell_Orders::RecordWithId>& records, std::string condition);
847 
848  Poco::Data::Session* db;
849 
850  std::string tableName;
851 
852  }; //My_Pending_Sell_Orders
853 
854  class My_Pending_Buy_Orders : public Poco::RefCountedObject {
855  public:
856 
857  struct Record {
858 
859  // Unique ticket id for each pending buy order
860  Poco::Int32 ticket;
861 
862  bool isSetTicket() {
863  return (ticket != std::numeric_limits<Poco::Int32>::max());
864  }
865 
866  // Amount to trade in this transaction
867  double amt;
868 
869  bool isSetAmt() {
870  return (amt != std::numeric_limits<double>::max());
871  }
872 
873  // Price at which trade should be made
874  double price;
875 
876  bool isSetPrice() {
877  return (price != std::numeric_limits<double>::max());
878  }
879 
880  // Date and Time order was created
881  Poco::Int32 date;
882 
883  bool isSetDate() {
884  return (date != std::numeric_limits<Poco::Int32>::max());
885  }
886 
887  Record()
888  : ticket(std::numeric_limits<Poco::Int32>::max())
889  , amt(std::numeric_limits<double>::max())
890  , price(std::numeric_limits<double>::max())
891  , date(std::numeric_limits<Poco::Int32>::max())
892  {
893  }
894 
895  };
896 
897 
898  struct RecordWithId {
899 
900  // Unique ticket id for each pending buy order
901  Poco::Int32 ticket;
902 
903  bool isSetTicket() {
904  return (ticket != std::numeric_limits<Poco::Int32>::max());
905  }
906 
907  // Amount to trade in this transaction
908  double amt;
909 
910  bool isSetAmt() {
911  return (amt != std::numeric_limits<double>::max());
912  }
913 
914  // Price at which trade should be made
915  double price;
916 
917  bool isSetPrice() {
918  return (price != std::numeric_limits<double>::max());
919  }
920 
921  // Date and Time order was created
922  Poco::Int32 date;
923 
924  bool isSetDate() {
925  return (date != std::numeric_limits<Poco::Int32>::max());
926  }
927 
928  //Record ID in database
929  Poco::Int32 id;
930 
931  RecordWithId()
932  : ticket(std::numeric_limits<Poco::Int32>::max())
933  , amt(std::numeric_limits<double>::max())
934  , price(std::numeric_limits<double>::max())
935  , date(std::numeric_limits<Poco::Int32>::max())
936  , id(std::numeric_limits<Poco::Int32>::max())
937  {
938  }
939 
940  };
941 
942 
943  My_Pending_Buy_Orders(Poco::Data::Session* _db, std::string _suffix = "");
944 
946 
947  void init();
948 
949  void clear();
950 
951  void insert(My_Pending_Buy_Orders::Record& record);
952 
953  void insertOnce(My_Pending_Buy_Orders::Record& record);
954 
955  void insertMultiple(std::vector<My_Pending_Buy_Orders::Record>& records);
956 
957  void insertMultiple(std::vector<My_Pending_Buy_Orders::RecordWithId>& records);
958 
959  void insertMultipleUnique(std::vector<My_Pending_Buy_Orders::Record>& records);
960 
961  void deleteMultiple(std::vector<My_Pending_Buy_Orders::RecordWithId>& records);
962 
963  void insertAndDeleteUnchanged(My_Pending_Buy_Orders::Record& record);
964 
965  void insertUnique(My_Pending_Buy_Orders::Record& record);
966 
967  void getLatest(My_Pending_Buy_Orders::RecordWithId& rec);
968 
969  std::size_t getAll(std::vector<My_Pending_Buy_Orders::RecordWithId>& records, std::string condition);
970 
971  Poco::Data::Session* db;
972 
973  std::string tableName;
974 
975  }; //My_Pending_Buy_Orders
976 
977  class My_Trade_History : public Poco::RefCountedObject {
978  public:
979 
980  struct Record {
981 
982  // Unique ticket id for each trade
983  Poco::Int32 ticket;
984 
985  bool isSetTicket() {
986  return (ticket != std::numeric_limits<Poco::Int32>::max());
987  }
988 
989  // Date and Time order was created
990  Poco::Int32 dateCreated;
991 
992  bool isSetDateCreated() {
993  return (dateCreated != std::numeric_limits<Poco::Int32>::max());
994  }
995 
996  // Date and Time order was executed
997  Poco::Int32 dateExecuted;
998 
999  bool isSetDateExecuted() {
1000  return (dateExecuted != std::numeric_limits<Poco::Int32>::max());
1001  }
1002 
1003  // Amount to trade in this transaction
1004  double qty;
1005 
1006  bool isSetQty() {
1007  return (qty != std::numeric_limits<double>::max());
1008  }
1009 
1010  // Price at which trade should be made
1011  double price;
1012 
1013  bool isSetPrice() {
1014  return (price != std::numeric_limits<double>::max());
1015  }
1016 
1017  // Price at which trade should be made
1018  std::string status;
1019 
1020  bool isSetStatus() {
1021  return (status != "Empty");
1022  }
1023 
1024  // Price at which trade should be made
1025  std::string type;
1026 
1027  bool isSetType() {
1028  return (type != "Empty");
1029  }
1030 
1031  Record()
1032  : ticket(std::numeric_limits<Poco::Int32>::max())
1033  , dateCreated(std::numeric_limits<Poco::Int32>::max())
1034  , dateExecuted(std::numeric_limits<Poco::Int32>::max())
1035  , qty(std::numeric_limits<double>::max())
1036  , price(std::numeric_limits<double>::max())
1037  , status("Empty")
1038  , type("Empty")
1039  {
1040  }
1041 
1042  };
1043 
1044 
1045  struct RecordWithId {
1046 
1047  // Unique ticket id for each trade
1048  Poco::Int32 ticket;
1049 
1050  bool isSetTicket() {
1051  return (ticket != std::numeric_limits<Poco::Int32>::max());
1052  }
1053 
1054  // Date and Time order was created
1055  Poco::Int32 dateCreated;
1056 
1057  bool isSetDateCreated() {
1058  return (dateCreated != std::numeric_limits<Poco::Int32>::max());
1059  }
1060 
1061  // Date and Time order was executed
1062  Poco::Int32 dateExecuted;
1063 
1064  bool isSetDateExecuted() {
1065  return (dateExecuted != std::numeric_limits<Poco::Int32>::max());
1066  }
1067 
1068  // Amount to trade in this transaction
1069  double qty;
1070 
1071  bool isSetQty() {
1072  return (qty != std::numeric_limits<double>::max());
1073  }
1074 
1075  // Price at which trade should be made
1076  double price;
1077 
1078  bool isSetPrice() {
1079  return (price != std::numeric_limits<double>::max());
1080  }
1081 
1082  // Price at which trade should be made
1083  std::string status;
1084 
1085  bool isSetStatus() {
1086  return (status != "Empty");
1087  }
1088 
1089  // Price at which trade should be made
1090  std::string type;
1091 
1092  bool isSetType() {
1093  return (type != "Empty");
1094  }
1095 
1096  //Record ID in database
1097  Poco::Int32 id;
1098 
1099  RecordWithId()
1100  : ticket(std::numeric_limits<Poco::Int32>::max())
1101  , dateCreated(std::numeric_limits<Poco::Int32>::max())
1102  , dateExecuted(std::numeric_limits<Poco::Int32>::max())
1103  , qty(std::numeric_limits<double>::max())
1104  , price(std::numeric_limits<double>::max())
1105  , status("Empty")
1106  , type("Empty")
1107  , id(std::numeric_limits<Poco::Int32>::max())
1108  {
1109  }
1110 
1111  };
1112 
1113 
1114  My_Trade_History(Poco::Data::Session* _db, std::string _suffix = "");
1115 
1116  ~My_Trade_History();
1117 
1118  void init();
1119 
1120  void clear();
1121 
1122  void insert(My_Trade_History::Record& record);
1123 
1124  void insertOnce(My_Trade_History::Record& record);
1125 
1126  void insertMultiple(std::vector<My_Trade_History::Record>& records);
1127 
1128  void insertMultiple(std::vector<My_Trade_History::RecordWithId>& records);
1129 
1130  void insertMultipleUnique(std::vector<My_Trade_History::Record>& records);
1131 
1132  void deleteMultiple(std::vector<My_Trade_History::RecordWithId>& records);
1133 
1134  void insertAndDeleteUnchanged(My_Trade_History::Record& record);
1135 
1136  void insertUnique(My_Trade_History::Record& record);
1137 
1138  void getLatest(My_Trade_History::RecordWithId& rec);
1139 
1140  std::size_t getAll(std::vector<My_Trade_History::RecordWithId>& records, std::string condition);
1141 
1142  Poco::Data::Session* db;
1143 
1144  std::string tableName;
1145 
1146  }; //My_Trade_History
1147 
1148  class Tables : public Poco::RefCountedObject {
1149  public:
1150 
1151  Tables(Poco::Data::Session* _db);
1152 
1153  ~Tables();
1154 
1155  void init();
1156 
1157  void clear();
1158 
1159  Poco::Data::Session* db;
1160 
1161  Poco::AutoPtr<Ticker_Detailed> ticker_DetailedTable;
1162 
1163  Poco::AutoPtr<Account_Balance> account_BalanceTable;
1164 
1165  Poco::AutoPtr<Account_Info> account_InfoTable;
1166 
1167  Poco::AutoPtr<Trade_History> trade_HistoryTable;
1168 
1169  Poco::AutoPtr<Order_Book_Asks> order_Book_AsksTable;
1170 
1171  Poco::AutoPtr<Order_Book_Bids> order_Book_BidsTable;
1172 
1173  Poco::AutoPtr<My_Pending_Sell_Orders> my_Pending_Sell_OrdersTable;
1174 
1175  Poco::AutoPtr<My_Pending_Buy_Orders> my_Pending_Buy_OrdersTable;
1176 
1177  Poco::AutoPtr<My_Trade_History> my_Trade_HistoryTable;
1178 
1179  }; //Tables
1180 
1181  } //FybDatabase
1182 } //trader
1183 
1184 template <>
1185 class Poco::Data::TypeHandler<trader::FybDatabase::Ticker_Detailed::Record>
1186 {
1187  public:
1188  static std::size_t size()
1189  {
1190  return 5;
1191  }
1192 
1193  static void bind(std::size_t pos, const trader::FybDatabase::Ticker_Detailed::Record& record, Poco::Data::AbstractBinder::Ptr pBinder, Poco::Data::AbstractBinder::Direction dir)
1194  {
1195  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.timeStamp , pBinder, dir);
1196  Poco::Data::TypeHandler<double>::bind(pos++, record.ask , pBinder, dir);
1197  Poco::Data::TypeHandler<double>::bind(pos++, record.bid , pBinder, dir);
1198  Poco::Data::TypeHandler<double>::bind(pos++, record.last , pBinder, dir);
1199  Poco::Data::TypeHandler<double>::bind(pos++, record.vol , pBinder, dir);
1200  }
1201 
1202  static void extract(std::size_t pos, trader::FybDatabase::Ticker_Detailed::Record& record, trader::FybDatabase::Ticker_Detailed::Record& deflt, Poco::Data::AbstractExtractor::Ptr pExtr)
1203  {
1204  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.timeStamp, deflt.timeStamp, pExtr);
1205  Poco::Data::TypeHandler<double>::extract(pos++, record.ask, deflt.ask, pExtr);
1206  Poco::Data::TypeHandler<double>::extract(pos++, record.bid, deflt.bid, pExtr);
1207  Poco::Data::TypeHandler<double>::extract(pos++, record.last, deflt.last, pExtr);
1208  Poco::Data::TypeHandler<double>::extract(pos++, record.vol, deflt.vol, pExtr);
1209  }
1210 
1211  static void prepare(std::size_t pos, trader::FybDatabase::Ticker_Detailed::Record& record, Poco::Data::AbstractPreparator::Ptr pPrep)
1212  {
1213  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.timeStamp, pPrep);
1214  Poco::Data::TypeHandler<double>::prepare(pos++, record.ask, pPrep);
1215  Poco::Data::TypeHandler<double>::prepare(pos++, record.bid, pPrep);
1216  Poco::Data::TypeHandler<double>::prepare(pos++, record.last, pPrep);
1217  Poco::Data::TypeHandler<double>::prepare(pos++, record.vol, pPrep);
1218  }
1219 }
1220 ;
1221 
1222 template <>
1223 class Poco::Data::TypeHandler<trader::FybDatabase::Ticker_Detailed::RecordWithId>
1224 {
1225  public:
1226  static std::size_t size()
1227  {
1228  return 6;
1229  }
1230 
1231  static void bind(std::size_t pos, const trader::FybDatabase::Ticker_Detailed::RecordWithId& record, Poco::Data::AbstractBinder::Ptr pBinder, Poco::Data::AbstractBinder::Direction dir)
1232  {
1233  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.timeStamp , pBinder, dir);
1234  Poco::Data::TypeHandler<double>::bind(pos++, record.ask , pBinder, dir);
1235  Poco::Data::TypeHandler<double>::bind(pos++, record.bid , pBinder, dir);
1236  Poco::Data::TypeHandler<double>::bind(pos++, record.last , pBinder, dir);
1237  Poco::Data::TypeHandler<double>::bind(pos++, record.vol , pBinder, dir);
1238  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.id, pBinder, dir);
1239  }
1240 
1241  static void extract(std::size_t pos, trader::FybDatabase::Ticker_Detailed::RecordWithId& record, trader::FybDatabase::Ticker_Detailed::RecordWithId& deflt, Poco::Data::AbstractExtractor::Ptr pExtr)
1242  {
1243  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.timeStamp, deflt.timeStamp, pExtr);
1244  Poco::Data::TypeHandler<double>::extract(pos++, record.ask, deflt.ask, pExtr);
1245  Poco::Data::TypeHandler<double>::extract(pos++, record.bid, deflt.bid, pExtr);
1246  Poco::Data::TypeHandler<double>::extract(pos++, record.last, deflt.last, pExtr);
1247  Poco::Data::TypeHandler<double>::extract(pos++, record.vol, deflt.vol, pExtr);
1248  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.id, deflt.id, pExtr);
1249  }
1250 
1251  static void prepare(std::size_t pos, trader::FybDatabase::Ticker_Detailed::RecordWithId& record, Poco::Data::AbstractPreparator::Ptr pPrep)
1252  {
1253  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.timeStamp, pPrep);
1254  Poco::Data::TypeHandler<double>::prepare(pos++, record.ask, pPrep);
1255  Poco::Data::TypeHandler<double>::prepare(pos++, record.bid, pPrep);
1256  Poco::Data::TypeHandler<double>::prepare(pos++, record.last, pPrep);
1257  Poco::Data::TypeHandler<double>::prepare(pos++, record.vol, pPrep);
1258  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.id, pPrep);
1259  }
1260 }
1261 ;
1262 
1263 template <>
1264 class Poco::Data::TypeHandler<trader::FybDatabase::Account_Balance::Record>
1265 {
1266  public:
1267  static std::size_t size()
1268  {
1269  return 3;
1270  }
1271 
1272  static void bind(std::size_t pos, const trader::FybDatabase::Account_Balance::Record& record, Poco::Data::AbstractBinder::Ptr pBinder, Poco::Data::AbstractBinder::Direction dir)
1273  {
1274  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.timeStamp , pBinder, dir);
1275  Poco::Data::TypeHandler<double>::bind(pos++, record.btcBal , pBinder, dir);
1276  Poco::Data::TypeHandler<double>::bind(pos++, record.sgdBal , pBinder, dir);
1277  }
1278 
1279  static void extract(std::size_t pos, trader::FybDatabase::Account_Balance::Record& record, trader::FybDatabase::Account_Balance::Record& deflt, Poco::Data::AbstractExtractor::Ptr pExtr)
1280  {
1281  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.timeStamp, deflt.timeStamp, pExtr);
1282  Poco::Data::TypeHandler<double>::extract(pos++, record.btcBal, deflt.btcBal, pExtr);
1283  Poco::Data::TypeHandler<double>::extract(pos++, record.sgdBal, deflt.sgdBal, pExtr);
1284  }
1285 
1286  static void prepare(std::size_t pos, trader::FybDatabase::Account_Balance::Record& record, Poco::Data::AbstractPreparator::Ptr pPrep)
1287  {
1288  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.timeStamp, pPrep);
1289  Poco::Data::TypeHandler<double>::prepare(pos++, record.btcBal, pPrep);
1290  Poco::Data::TypeHandler<double>::prepare(pos++, record.sgdBal, pPrep);
1291  }
1292 }
1293 ;
1294 
1295 template <>
1296 class Poco::Data::TypeHandler<trader::FybDatabase::Account_Balance::RecordWithId>
1297 {
1298  public:
1299  static std::size_t size()
1300  {
1301  return 4;
1302  }
1303 
1304  static void bind(std::size_t pos, const trader::FybDatabase::Account_Balance::RecordWithId& record, Poco::Data::AbstractBinder::Ptr pBinder, Poco::Data::AbstractBinder::Direction dir)
1305  {
1306  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.timeStamp , pBinder, dir);
1307  Poco::Data::TypeHandler<double>::bind(pos++, record.btcBal , pBinder, dir);
1308  Poco::Data::TypeHandler<double>::bind(pos++, record.sgdBal , pBinder, dir);
1309  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.id, pBinder, dir);
1310  }
1311 
1312  static void extract(std::size_t pos, trader::FybDatabase::Account_Balance::RecordWithId& record, trader::FybDatabase::Account_Balance::RecordWithId& deflt, Poco::Data::AbstractExtractor::Ptr pExtr)
1313  {
1314  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.timeStamp, deflt.timeStamp, pExtr);
1315  Poco::Data::TypeHandler<double>::extract(pos++, record.btcBal, deflt.btcBal, pExtr);
1316  Poco::Data::TypeHandler<double>::extract(pos++, record.sgdBal, deflt.sgdBal, pExtr);
1317  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.id, deflt.id, pExtr);
1318  }
1319 
1320  static void prepare(std::size_t pos, trader::FybDatabase::Account_Balance::RecordWithId& record, Poco::Data::AbstractPreparator::Ptr pPrep)
1321  {
1322  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.timeStamp, pPrep);
1323  Poco::Data::TypeHandler<double>::prepare(pos++, record.btcBal, pPrep);
1324  Poco::Data::TypeHandler<double>::prepare(pos++, record.sgdBal, pPrep);
1325  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.id, pPrep);
1326  }
1327 }
1328 ;
1329 
1330 template <>
1331 class Poco::Data::TypeHandler<trader::FybDatabase::Account_Info::Record>
1332 {
1333  public:
1334  static std::size_t size()
1335  {
1336  return 3;
1337  }
1338 
1339  static void bind(std::size_t pos, const trader::FybDatabase::Account_Info::Record& record, Poco::Data::AbstractBinder::Ptr pBinder, Poco::Data::AbstractBinder::Direction dir)
1340  {
1341  Poco::Data::TypeHandler<std::string>::bind(pos++, record.accNum , pBinder, dir);
1342  Poco::Data::TypeHandler<std::string>::bind(pos++, record.btcAddress , pBinder, dir);
1343  Poco::Data::TypeHandler<std::string>::bind(pos++, record.email , pBinder, dir);
1344  }
1345 
1346  static void extract(std::size_t pos, trader::FybDatabase::Account_Info::Record& record, trader::FybDatabase::Account_Info::Record& deflt, Poco::Data::AbstractExtractor::Ptr pExtr)
1347  {
1348  Poco::Data::TypeHandler<std::string>::extract(pos++, record.accNum, deflt.accNum, pExtr);
1349  Poco::Data::TypeHandler<std::string>::extract(pos++, record.btcAddress, deflt.btcAddress, pExtr);
1350  Poco::Data::TypeHandler<std::string>::extract(pos++, record.email, deflt.email, pExtr);
1351  }
1352 
1353  static void prepare(std::size_t pos, trader::FybDatabase::Account_Info::Record& record, Poco::Data::AbstractPreparator::Ptr pPrep)
1354  {
1355  Poco::Data::TypeHandler<std::string>::prepare(pos++, record.accNum, pPrep);
1356  Poco::Data::TypeHandler<std::string>::prepare(pos++, record.btcAddress, pPrep);
1357  Poco::Data::TypeHandler<std::string>::prepare(pos++, record.email, pPrep);
1358  }
1359 }
1360 ;
1361 
1362 template <>
1363 class Poco::Data::TypeHandler<trader::FybDatabase::Account_Info::RecordWithId>
1364 {
1365  public:
1366  static std::size_t size()
1367  {
1368  return 4;
1369  }
1370 
1371  static void bind(std::size_t pos, const trader::FybDatabase::Account_Info::RecordWithId& record, Poco::Data::AbstractBinder::Ptr pBinder, Poco::Data::AbstractBinder::Direction dir)
1372  {
1373  Poco::Data::TypeHandler<std::string>::bind(pos++, record.accNum , pBinder, dir);
1374  Poco::Data::TypeHandler<std::string>::bind(pos++, record.btcAddress , pBinder, dir);
1375  Poco::Data::TypeHandler<std::string>::bind(pos++, record.email , pBinder, dir);
1376  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.id, pBinder, dir);
1377  }
1378 
1379  static void extract(std::size_t pos, trader::FybDatabase::Account_Info::RecordWithId& record, trader::FybDatabase::Account_Info::RecordWithId& deflt, Poco::Data::AbstractExtractor::Ptr pExtr)
1380  {
1381  Poco::Data::TypeHandler<std::string>::extract(pos++, record.accNum, deflt.accNum, pExtr);
1382  Poco::Data::TypeHandler<std::string>::extract(pos++, record.btcAddress, deflt.btcAddress, pExtr);
1383  Poco::Data::TypeHandler<std::string>::extract(pos++, record.email, deflt.email, pExtr);
1384  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.id, deflt.id, pExtr);
1385  }
1386 
1387  static void prepare(std::size_t pos, trader::FybDatabase::Account_Info::RecordWithId& record, Poco::Data::AbstractPreparator::Ptr pPrep)
1388  {
1389  Poco::Data::TypeHandler<std::string>::prepare(pos++, record.accNum, pPrep);
1390  Poco::Data::TypeHandler<std::string>::prepare(pos++, record.btcAddress, pPrep);
1391  Poco::Data::TypeHandler<std::string>::prepare(pos++, record.email, pPrep);
1392  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.id, pPrep);
1393  }
1394 }
1395 ;
1396 
1397 template <>
1398 class Poco::Data::TypeHandler<trader::FybDatabase::Trade_History::Record>
1399 {
1400  public:
1401  static std::size_t size()
1402  {
1403  return 4;
1404  }
1405 
1406  static void bind(std::size_t pos, const trader::FybDatabase::Trade_History::Record& record, Poco::Data::AbstractBinder::Ptr pBinder, Poco::Data::AbstractBinder::Direction dir)
1407  {
1408  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.tid , pBinder, dir);
1409  Poco::Data::TypeHandler<double>::bind(pos++, record.amt , pBinder, dir);
1410  Poco::Data::TypeHandler<double>::bind(pos++, record.price , pBinder, dir);
1411  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.date , pBinder, dir);
1412  }
1413 
1414  static void extract(std::size_t pos, trader::FybDatabase::Trade_History::Record& record, trader::FybDatabase::Trade_History::Record& deflt, Poco::Data::AbstractExtractor::Ptr pExtr)
1415  {
1416  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.tid, deflt.tid, pExtr);
1417  Poco::Data::TypeHandler<double>::extract(pos++, record.amt, deflt.amt, pExtr);
1418  Poco::Data::TypeHandler<double>::extract(pos++, record.price, deflt.price, pExtr);
1419  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.date, deflt.date, pExtr);
1420  }
1421 
1422  static void prepare(std::size_t pos, trader::FybDatabase::Trade_History::Record& record, Poco::Data::AbstractPreparator::Ptr pPrep)
1423  {
1424  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.tid, pPrep);
1425  Poco::Data::TypeHandler<double>::prepare(pos++, record.amt, pPrep);
1426  Poco::Data::TypeHandler<double>::prepare(pos++, record.price, pPrep);
1427  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.date, pPrep);
1428  }
1429 }
1430 ;
1431 
1432 template <>
1433 class Poco::Data::TypeHandler<trader::FybDatabase::Trade_History::RecordWithId>
1434 {
1435  public:
1436  static std::size_t size()
1437  {
1438  return 5;
1439  }
1440 
1441  static void bind(std::size_t pos, const trader::FybDatabase::Trade_History::RecordWithId& record, Poco::Data::AbstractBinder::Ptr pBinder, Poco::Data::AbstractBinder::Direction dir)
1442  {
1443  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.tid , pBinder, dir);
1444  Poco::Data::TypeHandler<double>::bind(pos++, record.amt , pBinder, dir);
1445  Poco::Data::TypeHandler<double>::bind(pos++, record.price , pBinder, dir);
1446  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.date , pBinder, dir);
1447  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.id, pBinder, dir);
1448  }
1449 
1450  static void extract(std::size_t pos, trader::FybDatabase::Trade_History::RecordWithId& record, trader::FybDatabase::Trade_History::RecordWithId& deflt, Poco::Data::AbstractExtractor::Ptr pExtr)
1451  {
1452  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.tid, deflt.tid, pExtr);
1453  Poco::Data::TypeHandler<double>::extract(pos++, record.amt, deflt.amt, pExtr);
1454  Poco::Data::TypeHandler<double>::extract(pos++, record.price, deflt.price, pExtr);
1455  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.date, deflt.date, pExtr);
1456  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.id, deflt.id, pExtr);
1457  }
1458 
1459  static void prepare(std::size_t pos, trader::FybDatabase::Trade_History::RecordWithId& record, Poco::Data::AbstractPreparator::Ptr pPrep)
1460  {
1461  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.tid, pPrep);
1462  Poco::Data::TypeHandler<double>::prepare(pos++, record.amt, pPrep);
1463  Poco::Data::TypeHandler<double>::prepare(pos++, record.price, pPrep);
1464  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.date, pPrep);
1465  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.id, pPrep);
1466  }
1467 }
1468 ;
1469 
1470 template <>
1471 class Poco::Data::TypeHandler<trader::FybDatabase::Order_Book_Asks::Record>
1472 {
1473  public:
1474  static std::size_t size()
1475  {
1476  return 4;
1477  }
1478 
1479  static void bind(std::size_t pos, const trader::FybDatabase::Order_Book_Asks::Record& record, Poco::Data::AbstractBinder::Ptr pBinder, Poco::Data::AbstractBinder::Direction dir)
1480  {
1481  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.dateCreated , pBinder, dir);
1482  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.dateRemoved , pBinder, dir);
1483  Poco::Data::TypeHandler<double>::bind(pos++, record.price , pBinder, dir);
1484  Poco::Data::TypeHandler<double>::bind(pos++, record.volume , pBinder, dir);
1485  }
1486 
1487  static void extract(std::size_t pos, trader::FybDatabase::Order_Book_Asks::Record& record, trader::FybDatabase::Order_Book_Asks::Record& deflt, Poco::Data::AbstractExtractor::Ptr pExtr)
1488  {
1489  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.dateCreated, deflt.dateCreated, pExtr);
1490  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.dateRemoved, deflt.dateRemoved, pExtr);
1491  Poco::Data::TypeHandler<double>::extract(pos++, record.price, deflt.price, pExtr);
1492  Poco::Data::TypeHandler<double>::extract(pos++, record.volume, deflt.volume, pExtr);
1493  }
1494 
1495  static void prepare(std::size_t pos, trader::FybDatabase::Order_Book_Asks::Record& record, Poco::Data::AbstractPreparator::Ptr pPrep)
1496  {
1497  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.dateCreated, pPrep);
1498  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.dateRemoved, pPrep);
1499  Poco::Data::TypeHandler<double>::prepare(pos++, record.price, pPrep);
1500  Poco::Data::TypeHandler<double>::prepare(pos++, record.volume, pPrep);
1501  }
1502 }
1503 ;
1504 
1505 template <>
1506 class Poco::Data::TypeHandler<trader::FybDatabase::Order_Book_Asks::RecordWithId>
1507 {
1508  public:
1509  static std::size_t size()
1510  {
1511  return 5;
1512  }
1513 
1514  static void bind(std::size_t pos, const trader::FybDatabase::Order_Book_Asks::RecordWithId& record, Poco::Data::AbstractBinder::Ptr pBinder, Poco::Data::AbstractBinder::Direction dir)
1515  {
1516  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.dateCreated , pBinder, dir);
1517  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.dateRemoved , pBinder, dir);
1518  Poco::Data::TypeHandler<double>::bind(pos++, record.price , pBinder, dir);
1519  Poco::Data::TypeHandler<double>::bind(pos++, record.volume , pBinder, dir);
1520  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.id, pBinder, dir);
1521  }
1522 
1523  static void extract(std::size_t pos, trader::FybDatabase::Order_Book_Asks::RecordWithId& record, trader::FybDatabase::Order_Book_Asks::RecordWithId& deflt, Poco::Data::AbstractExtractor::Ptr pExtr)
1524  {
1525  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.dateCreated, deflt.dateCreated, pExtr);
1526  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.dateRemoved, deflt.dateRemoved, pExtr);
1527  Poco::Data::TypeHandler<double>::extract(pos++, record.price, deflt.price, pExtr);
1528  Poco::Data::TypeHandler<double>::extract(pos++, record.volume, deflt.volume, pExtr);
1529  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.id, deflt.id, pExtr);
1530  }
1531 
1532  static void prepare(std::size_t pos, trader::FybDatabase::Order_Book_Asks::RecordWithId& record, Poco::Data::AbstractPreparator::Ptr pPrep)
1533  {
1534  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.dateCreated, pPrep);
1535  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.dateRemoved, pPrep);
1536  Poco::Data::TypeHandler<double>::prepare(pos++, record.price, pPrep);
1537  Poco::Data::TypeHandler<double>::prepare(pos++, record.volume, pPrep);
1538  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.id, pPrep);
1539  }
1540 }
1541 ;
1542 
1543 template <>
1544 class Poco::Data::TypeHandler<trader::FybDatabase::Order_Book_Bids::Record>
1545 {
1546  public:
1547  static std::size_t size()
1548  {
1549  return 4;
1550  }
1551 
1552  static void bind(std::size_t pos, const trader::FybDatabase::Order_Book_Bids::Record& record, Poco::Data::AbstractBinder::Ptr pBinder, Poco::Data::AbstractBinder::Direction dir)
1553  {
1554  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.dateCreated , pBinder, dir);
1555  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.dateRemoved , pBinder, dir);
1556  Poco::Data::TypeHandler<double>::bind(pos++, record.price , pBinder, dir);
1557  Poco::Data::TypeHandler<double>::bind(pos++, record.volume , pBinder, dir);
1558  }
1559 
1560  static void extract(std::size_t pos, trader::FybDatabase::Order_Book_Bids::Record& record, trader::FybDatabase::Order_Book_Bids::Record& deflt, Poco::Data::AbstractExtractor::Ptr pExtr)
1561  {
1562  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.dateCreated, deflt.dateCreated, pExtr);
1563  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.dateRemoved, deflt.dateRemoved, pExtr);
1564  Poco::Data::TypeHandler<double>::extract(pos++, record.price, deflt.price, pExtr);
1565  Poco::Data::TypeHandler<double>::extract(pos++, record.volume, deflt.volume, pExtr);
1566  }
1567 
1568  static void prepare(std::size_t pos, trader::FybDatabase::Order_Book_Bids::Record& record, Poco::Data::AbstractPreparator::Ptr pPrep)
1569  {
1570  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.dateCreated, pPrep);
1571  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.dateRemoved, pPrep);
1572  Poco::Data::TypeHandler<double>::prepare(pos++, record.price, pPrep);
1573  Poco::Data::TypeHandler<double>::prepare(pos++, record.volume, pPrep);
1574  }
1575 }
1576 ;
1577 
1578 template <>
1579 class Poco::Data::TypeHandler<trader::FybDatabase::Order_Book_Bids::RecordWithId>
1580 {
1581  public:
1582  static std::size_t size()
1583  {
1584  return 5;
1585  }
1586 
1587  static void bind(std::size_t pos, const trader::FybDatabase::Order_Book_Bids::RecordWithId& record, Poco::Data::AbstractBinder::Ptr pBinder, Poco::Data::AbstractBinder::Direction dir)
1588  {
1589  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.dateCreated , pBinder, dir);
1590  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.dateRemoved , pBinder, dir);
1591  Poco::Data::TypeHandler<double>::bind(pos++, record.price , pBinder, dir);
1592  Poco::Data::TypeHandler<double>::bind(pos++, record.volume , pBinder, dir);
1593  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.id, pBinder, dir);
1594  }
1595 
1596  static void extract(std::size_t pos, trader::FybDatabase::Order_Book_Bids::RecordWithId& record, trader::FybDatabase::Order_Book_Bids::RecordWithId& deflt, Poco::Data::AbstractExtractor::Ptr pExtr)
1597  {
1598  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.dateCreated, deflt.dateCreated, pExtr);
1599  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.dateRemoved, deflt.dateRemoved, pExtr);
1600  Poco::Data::TypeHandler<double>::extract(pos++, record.price, deflt.price, pExtr);
1601  Poco::Data::TypeHandler<double>::extract(pos++, record.volume, deflt.volume, pExtr);
1602  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.id, deflt.id, pExtr);
1603  }
1604 
1605  static void prepare(std::size_t pos, trader::FybDatabase::Order_Book_Bids::RecordWithId& record, Poco::Data::AbstractPreparator::Ptr pPrep)
1606  {
1607  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.dateCreated, pPrep);
1608  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.dateRemoved, pPrep);
1609  Poco::Data::TypeHandler<double>::prepare(pos++, record.price, pPrep);
1610  Poco::Data::TypeHandler<double>::prepare(pos++, record.volume, pPrep);
1611  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.id, pPrep);
1612  }
1613 }
1614 ;
1615 
1616 template <>
1617 class Poco::Data::TypeHandler<trader::FybDatabase::My_Pending_Sell_Orders::Record>
1618 {
1619  public:
1620  static std::size_t size()
1621  {
1622  return 4;
1623  }
1624 
1625  static void bind(std::size_t pos, const trader::FybDatabase::My_Pending_Sell_Orders::Record& record, Poco::Data::AbstractBinder::Ptr pBinder, Poco::Data::AbstractBinder::Direction dir)
1626  {
1627  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.ticket , pBinder, dir);
1628  Poco::Data::TypeHandler<double>::bind(pos++, record.amt , pBinder, dir);
1629  Poco::Data::TypeHandler<double>::bind(pos++, record.price , pBinder, dir);
1630  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.date , pBinder, dir);
1631  }
1632 
1633  static void extract(std::size_t pos, trader::FybDatabase::My_Pending_Sell_Orders::Record& record, trader::FybDatabase::My_Pending_Sell_Orders::Record& deflt, Poco::Data::AbstractExtractor::Ptr pExtr)
1634  {
1635  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.ticket, deflt.ticket, pExtr);
1636  Poco::Data::TypeHandler<double>::extract(pos++, record.amt, deflt.amt, pExtr);
1637  Poco::Data::TypeHandler<double>::extract(pos++, record.price, deflt.price, pExtr);
1638  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.date, deflt.date, pExtr);
1639  }
1640 
1641  static void prepare(std::size_t pos, trader::FybDatabase::My_Pending_Sell_Orders::Record& record, Poco::Data::AbstractPreparator::Ptr pPrep)
1642  {
1643  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.ticket, pPrep);
1644  Poco::Data::TypeHandler<double>::prepare(pos++, record.amt, pPrep);
1645  Poco::Data::TypeHandler<double>::prepare(pos++, record.price, pPrep);
1646  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.date, pPrep);
1647  }
1648 }
1649 ;
1650 
1651 template <>
1652 class Poco::Data::TypeHandler<trader::FybDatabase::My_Pending_Sell_Orders::RecordWithId>
1653 {
1654  public:
1655  static std::size_t size()
1656  {
1657  return 5;
1658  }
1659 
1660  static void bind(std::size_t pos, const trader::FybDatabase::My_Pending_Sell_Orders::RecordWithId& record, Poco::Data::AbstractBinder::Ptr pBinder, Poco::Data::AbstractBinder::Direction dir)
1661  {
1662  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.ticket , pBinder, dir);
1663  Poco::Data::TypeHandler<double>::bind(pos++, record.amt , pBinder, dir);
1664  Poco::Data::TypeHandler<double>::bind(pos++, record.price , pBinder, dir);
1665  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.date , pBinder, dir);
1666  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.id, pBinder, dir);
1667  }
1668 
1669  static void extract(std::size_t pos, trader::FybDatabase::My_Pending_Sell_Orders::RecordWithId& record, trader::FybDatabase::My_Pending_Sell_Orders::RecordWithId& deflt, Poco::Data::AbstractExtractor::Ptr pExtr)
1670  {
1671  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.ticket, deflt.ticket, pExtr);
1672  Poco::Data::TypeHandler<double>::extract(pos++, record.amt, deflt.amt, pExtr);
1673  Poco::Data::TypeHandler<double>::extract(pos++, record.price, deflt.price, pExtr);
1674  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.date, deflt.date, pExtr);
1675  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.id, deflt.id, pExtr);
1676  }
1677 
1678  static void prepare(std::size_t pos, trader::FybDatabase::My_Pending_Sell_Orders::RecordWithId& record, Poco::Data::AbstractPreparator::Ptr pPrep)
1679  {
1680  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.ticket, pPrep);
1681  Poco::Data::TypeHandler<double>::prepare(pos++, record.amt, pPrep);
1682  Poco::Data::TypeHandler<double>::prepare(pos++, record.price, pPrep);
1683  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.date, pPrep);
1684  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.id, pPrep);
1685  }
1686 }
1687 ;
1688 
1689 template <>
1690 class Poco::Data::TypeHandler<trader::FybDatabase::My_Pending_Buy_Orders::Record>
1691 {
1692  public:
1693  static std::size_t size()
1694  {
1695  return 4;
1696  }
1697 
1698  static void bind(std::size_t pos, const trader::FybDatabase::My_Pending_Buy_Orders::Record& record, Poco::Data::AbstractBinder::Ptr pBinder, Poco::Data::AbstractBinder::Direction dir)
1699  {
1700  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.ticket , pBinder, dir);
1701  Poco::Data::TypeHandler<double>::bind(pos++, record.amt , pBinder, dir);
1702  Poco::Data::TypeHandler<double>::bind(pos++, record.price , pBinder, dir);
1703  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.date , pBinder, dir);
1704  }
1705 
1706  static void extract(std::size_t pos, trader::FybDatabase::My_Pending_Buy_Orders::Record& record, trader::FybDatabase::My_Pending_Buy_Orders::Record& deflt, Poco::Data::AbstractExtractor::Ptr pExtr)
1707  {
1708  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.ticket, deflt.ticket, pExtr);
1709  Poco::Data::TypeHandler<double>::extract(pos++, record.amt, deflt.amt, pExtr);
1710  Poco::Data::TypeHandler<double>::extract(pos++, record.price, deflt.price, pExtr);
1711  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.date, deflt.date, pExtr);
1712  }
1713 
1714  static void prepare(std::size_t pos, trader::FybDatabase::My_Pending_Buy_Orders::Record& record, Poco::Data::AbstractPreparator::Ptr pPrep)
1715  {
1716  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.ticket, pPrep);
1717  Poco::Data::TypeHandler<double>::prepare(pos++, record.amt, pPrep);
1718  Poco::Data::TypeHandler<double>::prepare(pos++, record.price, pPrep);
1719  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.date, pPrep);
1720  }
1721 }
1722 ;
1723 
1724 template <>
1725 class Poco::Data::TypeHandler<trader::FybDatabase::My_Pending_Buy_Orders::RecordWithId>
1726 {
1727  public:
1728  static std::size_t size()
1729  {
1730  return 5;
1731  }
1732 
1733  static void bind(std::size_t pos, const trader::FybDatabase::My_Pending_Buy_Orders::RecordWithId& record, Poco::Data::AbstractBinder::Ptr pBinder, Poco::Data::AbstractBinder::Direction dir)
1734  {
1735  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.ticket , pBinder, dir);
1736  Poco::Data::TypeHandler<double>::bind(pos++, record.amt , pBinder, dir);
1737  Poco::Data::TypeHandler<double>::bind(pos++, record.price , pBinder, dir);
1738  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.date , pBinder, dir);
1739  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.id, pBinder, dir);
1740  }
1741 
1742  static void extract(std::size_t pos, trader::FybDatabase::My_Pending_Buy_Orders::RecordWithId& record, trader::FybDatabase::My_Pending_Buy_Orders::RecordWithId& deflt, Poco::Data::AbstractExtractor::Ptr pExtr)
1743  {
1744  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.ticket, deflt.ticket, pExtr);
1745  Poco::Data::TypeHandler<double>::extract(pos++, record.amt, deflt.amt, pExtr);
1746  Poco::Data::TypeHandler<double>::extract(pos++, record.price, deflt.price, pExtr);
1747  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.date, deflt.date, pExtr);
1748  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.id, deflt.id, pExtr);
1749  }
1750 
1751  static void prepare(std::size_t pos, trader::FybDatabase::My_Pending_Buy_Orders::RecordWithId& record, Poco::Data::AbstractPreparator::Ptr pPrep)
1752  {
1753  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.ticket, pPrep);
1754  Poco::Data::TypeHandler<double>::prepare(pos++, record.amt, pPrep);
1755  Poco::Data::TypeHandler<double>::prepare(pos++, record.price, pPrep);
1756  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.date, pPrep);
1757  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.id, pPrep);
1758  }
1759 }
1760 ;
1761 
1762 template <>
1763 class Poco::Data::TypeHandler<trader::FybDatabase::My_Trade_History::Record>
1764 {
1765  public:
1766  static std::size_t size()
1767  {
1768  return 7;
1769  }
1770 
1771  static void bind(std::size_t pos, const trader::FybDatabase::My_Trade_History::Record& record, Poco::Data::AbstractBinder::Ptr pBinder, Poco::Data::AbstractBinder::Direction dir)
1772  {
1773  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.ticket , pBinder, dir);
1774  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.dateCreated , pBinder, dir);
1775  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.dateExecuted , pBinder, dir);
1776  Poco::Data::TypeHandler<double>::bind(pos++, record.qty , pBinder, dir);
1777  Poco::Data::TypeHandler<double>::bind(pos++, record.price , pBinder, dir);
1778  Poco::Data::TypeHandler<std::string>::bind(pos++, record.status , pBinder, dir);
1779  Poco::Data::TypeHandler<std::string>::bind(pos++, record.type , pBinder, dir);
1780  }
1781 
1782  static void extract(std::size_t pos, trader::FybDatabase::My_Trade_History::Record& record, trader::FybDatabase::My_Trade_History::Record& deflt, Poco::Data::AbstractExtractor::Ptr pExtr)
1783  {
1784  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.ticket, deflt.ticket, pExtr);
1785  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.dateCreated, deflt.dateCreated, pExtr);
1786  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.dateExecuted, deflt.dateExecuted, pExtr);
1787  Poco::Data::TypeHandler<double>::extract(pos++, record.qty, deflt.qty, pExtr);
1788  Poco::Data::TypeHandler<double>::extract(pos++, record.price, deflt.price, pExtr);
1789  Poco::Data::TypeHandler<std::string>::extract(pos++, record.status, deflt.status, pExtr);
1790  Poco::Data::TypeHandler<std::string>::extract(pos++, record.type, deflt.type, pExtr);
1791  }
1792 
1793  static void prepare(std::size_t pos, trader::FybDatabase::My_Trade_History::Record& record, Poco::Data::AbstractPreparator::Ptr pPrep)
1794  {
1795  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.ticket, pPrep);
1796  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.dateCreated, pPrep);
1797  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.dateExecuted, pPrep);
1798  Poco::Data::TypeHandler<double>::prepare(pos++, record.qty, pPrep);
1799  Poco::Data::TypeHandler<double>::prepare(pos++, record.price, pPrep);
1800  Poco::Data::TypeHandler<std::string>::prepare(pos++, record.status, pPrep);
1801  Poco::Data::TypeHandler<std::string>::prepare(pos++, record.type, pPrep);
1802  }
1803 }
1804 ;
1805 
1806 template <>
1807 class Poco::Data::TypeHandler<trader::FybDatabase::My_Trade_History::RecordWithId>
1808 {
1809  public:
1810  static std::size_t size()
1811  {
1812  return 8;
1813  }
1814 
1815  static void bind(std::size_t pos, const trader::FybDatabase::My_Trade_History::RecordWithId& record, Poco::Data::AbstractBinder::Ptr pBinder, Poco::Data::AbstractBinder::Direction dir)
1816  {
1817  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.ticket , pBinder, dir);
1818  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.dateCreated , pBinder, dir);
1819  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.dateExecuted , pBinder, dir);
1820  Poco::Data::TypeHandler<double>::bind(pos++, record.qty , pBinder, dir);
1821  Poco::Data::TypeHandler<double>::bind(pos++, record.price , pBinder, dir);
1822  Poco::Data::TypeHandler<std::string>::bind(pos++, record.status , pBinder, dir);
1823  Poco::Data::TypeHandler<std::string>::bind(pos++, record.type , pBinder, dir);
1824  Poco::Data::TypeHandler<Poco::Int32>::bind(pos++, record.id, pBinder, dir);
1825  }
1826 
1827  static void extract(std::size_t pos, trader::FybDatabase::My_Trade_History::RecordWithId& record, trader::FybDatabase::My_Trade_History::RecordWithId& deflt, Poco::Data::AbstractExtractor::Ptr pExtr)
1828  {
1829  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.ticket, deflt.ticket, pExtr);
1830  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.dateCreated, deflt.dateCreated, pExtr);
1831  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.dateExecuted, deflt.dateExecuted, pExtr);
1832  Poco::Data::TypeHandler<double>::extract(pos++, record.qty, deflt.qty, pExtr);
1833  Poco::Data::TypeHandler<double>::extract(pos++, record.price, deflt.price, pExtr);
1834  Poco::Data::TypeHandler<std::string>::extract(pos++, record.status, deflt.status, pExtr);
1835  Poco::Data::TypeHandler<std::string>::extract(pos++, record.type, deflt.type, pExtr);
1836  Poco::Data::TypeHandler<Poco::Int32>::extract(pos++, record.id, deflt.id, pExtr);
1837  }
1838 
1839  static void prepare(std::size_t pos, trader::FybDatabase::My_Trade_History::RecordWithId& record, Poco::Data::AbstractPreparator::Ptr pPrep)
1840  {
1841  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.ticket, pPrep);
1842  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.dateCreated, pPrep);
1843  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.dateExecuted, pPrep);
1844  Poco::Data::TypeHandler<double>::prepare(pos++, record.qty, pPrep);
1845  Poco::Data::TypeHandler<double>::prepare(pos++, record.price, pPrep);
1846  Poco::Data::TypeHandler<std::string>::prepare(pos++, record.status, pPrep);
1847  Poco::Data::TypeHandler<std::string>::prepare(pos++, record.type, pPrep);
1848  Poco::Data::TypeHandler<Poco::Int32>::prepare(pos++, record.id, pPrep);
1849  }
1850 }
1851 ;
Definition: fybdatabase.h:365
Definition: fybdatabase.h:1148
Definition: fybdatabase.h:731
Definition: fybdatabase.h:362
Definition: fybdatabase.h:608
Definition: fybdatabase.h:9
Definition: fybdatabase.h:255
Definition: fybdatabase.h:485
Definition: fybdatabase.h:854
Definition: fybdatabase.h:258
Definition: fybdatabase.h:977
Definition: fybdatabase.h:148
Definition: app.h:7