-
Notifications
You must be signed in to change notification settings - Fork 0
/
ClientManager.h
95 lines (76 loc) · 2.03 KB
/
ClientManager.h
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#pragma once
#ifndef __clientmanager_h
#define __clientmanager_h
#include <assert.h>
#ifdef WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <process.h>
#include <windows.h>
#include <sys/timeb.h>
#include <time.h>
#else
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <signal.h>
#include <strings.h>
#include <sys/time.h>
#include <pthread.h>
#include <sys/types.h>
#include <sys/stat.h>
#endif
#include "Ema.h"
#include "EMAClient.h"
using namespace thomsonreuters::ema::access;
using namespace thomsonreuters::ema::rdm;
using namespace std;
class ConsumerManager
{
public:
ConsumerManager(const EmaString& username, const EmaString& position, const EmaString& appID, const bool& dumpOutput = false);
virtual ~ConsumerManager();
thomsonreuters::ema::access::OmmConsumer& getOmmConsumer();
ConsumerClient& getConsumerClient();
void start();
void stop();
void run();
protected:
bool running;
thomsonreuters::ema::access::OmmConsumer* ommConsumer;
ConsumerClient* consumerClient1;
#ifdef WIN32
static unsigned __stdcall ThreadFunc(void* pArguments);
HANDLE _handle;
unsigned int _threadId;
#else
static void *ThreadFunc(void* pArguments);
pthread_t _threadId;
#endif
};
class NIProviderManager
{
public:
NIProviderManager(const EmaString& username, const EmaString& position, const EmaString& appID,const EmaString& instanceID, const bool& dumpOutput = false);
virtual ~NIProviderManager();
thomsonreuters::ema::access::OmmProvider& getOmmNIProvider();
NIProviderClient& getNIProviderCLient();
void start();
void stop();
void run();
protected:
bool running;
thomsonreuters::ema::access::OmmProvider* ommProvider;
NIProviderClient* providerClient1;
#ifdef WIN32
static unsigned __stdcall ThreadFunc(void* pArguments);
HANDLE _handle;
unsigned int _threadId;
#else
static void *ThreadFunc(void* pArguments);
pthread_t _threadId;
#endif
};
#endif