forked from aryeharmon/activetick
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNodeActivetick.h
More file actions
72 lines (58 loc) · 2.24 KB
/
NodeActivetick.h
File metadata and controls
72 lines (58 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#pragma once
#include <queue>
#include <node.h>
#include <node_object_wrap.h>
#include "Requestor.h"
#include "Session.h"
#include "Streamer.h"
#include "AtJsonParser.h"
#include "AtEnumConverter.h"
#include <ActiveTickServerAPI/ActiveTickServerAPI.h>
#include "import/atfeed-cppsdk/example/Helper.h"
#include "import/libjson/_internal/Source/JSONNode.h"
using namespace v8;
class NodeActivetick : public node::ObjectWrap {
public:
static void Init( Handle<Object> exports );
private:
explicit NodeActivetick();
~NodeActivetick();
static void New( const FunctionCallbackInfo<Value> &args );
static Persistent<Function> constructor;
// -- session --
static void SessionInit( const FunctionCallbackInfo<Value> &args );
static void GetSessionHandle( const FunctionCallbackInfo<Value> &args );
// -- requestor --
static void CloseAllATRequests( const FunctionCallbackInfo<Value> &args );
static void CloseATRequest( const FunctionCallbackInfo<Value> &args );
static void SendATBarHistoryDbRequest(
const FunctionCallbackInfo<Value> &args );
static void SendATLoginRequest( const FunctionCallbackInfo<Value> &args );
static void SendATMarketHolidaysRequest(
const FunctionCallbackInfo<Value> &args );
static void SendATMarketMoversDbRequest(
const FunctionCallbackInfo<Value> &args );
static void SendATMarketMoversStreamRequest(
const FunctionCallbackInfo<Value> &args );
static void SendATQuoteDbRequest(
const FunctionCallbackInfo<Value> &args );
static void SendATQuoteStreamRequest(
const FunctionCallbackInfo<Value> &args );
static void SendATTickHistoryDbRequest(
const FunctionCallbackInfo<Value> &args );
static void SendATSectorListRequest(
const FunctionCallbackInfo<Value> &args );
static void SendATConstituentListRequest(
const FunctionCallbackInfo<Value> &args );
// -- streamer --
static void GetMsg( const FunctionCallbackInfo<Value> &args );
private:
JSONNode getInboundMsg();
private:
APISession m_session;
Requestor m_requestor;
Streamer m_streamer;
AtJsonParser m_parser;
std::queue< JSONNode > m_inboundMsgs;
AtEnumConverter m_enumMap;
};