trader  v0.1a
A framework to build trading applications
fyb.h
1 // <copyright file="fyb.h" company="FinSec Systems">
3 // Copyright (c) 2018 finsec.systems. All rights reserved.
4 // </copyright>
5 // <author>Viknash</author>
6 // <date>12/5/2018</date>
7 // <summary>FYB Api Class</summary>
9 
10 
11 #pragma once
12 
13 #include "api.h"
14 #include "db.h"
15 #include "fybapi.h"
16 #include "fybdatabase.h"
17 #include "interface.h"
18 
19 namespace trader
20 {
21 
22  namespace FybApi
23  {
24  class EndPoints;
25  };
26 
27  namespace FybDatabase
28  {
29  class Tables;
30  };
31 
33  class Fyb : public Api
34  {
35  public:
37  Fyb();
38 
40  ~Fyb();
41 
50  Poco::Dynamic::Var invoke(const std::string &httpMethod, Poco::URI &uri);
51 
57  void setParams(const std::string&);
58 
60  void run();
61 
67  void execute(Poco::Timer &timer);
68 
74  void executeTradeHistory(Poco::Timer &timer);
75 
81  void executeOrderBook(Poco::Timer &timer);
82 
88  void executePendingOrders(Poco::Timer &timer);
89 
95  void executeOrderHistory(Poco::Timer &timer);
96 
98 
106  static AutoPtr< Interface::Connection > getConnection(const std::string &connectionId);
107 
108  protected:
114  Fyb(const Fyb &);
115 
123  Fyb &operator=(const Fyb &);
124 
125  std::string _uri;
126 
127  private:
128  Poco::Timer executeTimer;
129  Poco::AutoPtr< FybDatabase::Tables > dataBase;
130  Poco::AutoPtr< trader::Db > app;
131  std::vector< std::function< void(Poco::Timer &) > > serialExecutionList;
132  Poco::UInt32 configurationIdx;
133  };
134 
135 } // namespace trader
FybApi::EndPoints api
The API.
Definition: fyb.h:97
std::string _uri
_URI of the document
Definition: fyb.h:125
A fyb.
Definition: fyb.h:33
Definition: api.h:15
Definition: fybapi.h:1021
Definition: app.h:7