trader  v0.1a
A framework to build trading applications
kraken.h
1 // <copyright file="kraken.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>Kraken Api connection declaration</summary>
9 
10 #pragma once
11 
12 #include "api.h"
13 #include "db.h"
14 #include "interface.h"
15 #include "krakenapi.h"
16 #include "krakendatabase.h"
17 
18 namespace trader
19 {
20 
21  namespace KrakenApi
22  {
23  class EndPoints;
24  };
25 
26  namespace KrakenDatabase
27  {
28  class Tables;
29  };
30 
31  class Kraken;
32 
34  class KrakenConnection : public Interface::CallConnection, public Poco::Runnable
35  {
36  public:
43  KrakenConnection(const std::string &connectionid, Kraken *_exchange)
44  : exchange(_exchange)
45  {
46  (void)connectionid;
47  }
48 
50  void run() {}
51 
52  private:
53  Kraken *exchange;
54  };
55 
57  class Kraken : public Api
58  {
59  public:
61  Kraken();
62 
64  ~Kraken();
65 
74  Poco::Dynamic::Var invoke(const std::string &httpMethod, Poco::URI &uri);
75 
77  void run();
78 
84  void execute(Poco::Timer &timer);
85 
87 
95  static AutoPtr< Interface::Connection > getConnection(const std::string &connectionId);
96 
97  protected:
103  Kraken(const Kraken &);
104 
112  Kraken &operator=(const Kraken &);
113 
114  std::string _uri;
115 
116  private:
117  Poco::Timer executeTimer;
118  Poco::AutoPtr< KrakenDatabase::Tables > dataBase;
119  // Poco::AutoPtr<trader::Db> app;
120  std::vector< std::function< void(Poco::Timer &) > > serialExecutionList;
121  };
122 
123 } // namespace trader
KrakenApi::EndPoints api
The API.
Definition: kraken.h:86
Definition: api.h:15
KrakenConnection(const std::string &connectionid, Kraken *_exchange)
Initializes a new instance of the KrakenConnection class.
Definition: kraken.h:43
A kraken.
Definition: kraken.h:57
A kraken connection.
Definition: kraken.h:34
Definition: app.h:7
void run()
Runs this object.
Definition: kraken.h:50
Definition: interface.h:18267
std::string _uri
_URI of the document
Definition: kraken.h:114
Definition: krakenapi.h:1269