ActiveTick Feed C++ API SDK  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ActiveTickStreamListener.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include <list>
5 #include <map>
6 #include <string>
7 
8 namespace boost { class recursive_mutex; }
9 
11 class ServerConnection;
12 class StreamQueue;
13 class StreamSubscriptions;
14 
22 {
24  friend class ServerConnection;
25  friend class StreamQueue;
26  friend class StreamSubscriptions;
27  friend ACTIVETICKSERVERAPI_API bool ATInitAPI();
29 
30 public:
37  ACTIVETICKSERVERAPI_API ActiveTickStreamListener(uint64_t session, bool processAllUpdates = false);
38 
43 
44 protected:
52 
60 
68 
76 
77 private:
78  void AddSymbols(const LPATSYMBOL pSymbols, uint16_t symbolCount, ATStreamRequestType requestType);
79  void RemoveSymbols(const LPATSYMBOL pSymbols, uint16_t symbolCount, ATStreamRequestType requestType);
80  void ProcessStreamUpdate(LPATSTREAM_UPDATE pUpdate);
81 
82 private:
83  static void Init();
84  static void Destroy();
85  static void ProcessStreamUpdateForAllListeners(LPATSTREAM_UPDATE pUpdate);
86 
87 private:
88  uint64_t m_session;
89  bool m_bProcessAllUpdates;
90 
91  std::map<std::string, int32_t> m_mapSymbols[3];
92  boost::recursive_mutex* m_mutexSymbols;
93 
94 private:
95  static std::list<ActiveTickStreamListener*>* s_lstListeners;
96  static boost::recursive_mutex* s_mutexListeners;
97 };