1 #ifndef __FECONSUMER_H__
2 #define __FECONSUMER_H__
7 #include "FEConsumerOptions.h"
9 #include "LogMessage.h"
10 #include "MD/MD_mInt.h"
14 struct FEConsumerImpl;
24 typedef int SocketType;
26 typedef SOCKET SocketType;
39 typedef void (*MessageCallback)(
const std::string& topic,
51 typedef void (*EventCallback)(
const Event& e,
void* closure);
61 typedef void(*LoggingCallback)(
const LogMessage *messages,
size_t count);
66 const static int NO_TIMEOUT = 0;
72 const static int HWM_UNLIMITED = 0;
112 static Error log_open(
const std::string& filename,
bool append);
116 static void log_close();
120 static void enable_verbose_logging();
124 static void disable_verbose_logging();
130 static void set_logging_callback(LoggingCallback callback);
143 bool connected()
const;
151 bool authenticated()
const;
159 bool logged_in()
const;
168 bool is_subscribed(
const std::string& topic)
const;
175 unsigned int timeout_sec()
const;
182 unsigned int snapshot_timeout_sec()
const;
189 unsigned int heartbeat_timeout_sec()
const;
195 unsigned int heartbeat_interval_sec()
const;
202 unsigned int max_snapshot_queue_size()
const;
211 void event_cb(EventCallback callback);
218 void event_cb(EventCallback callback,
void* closure);
227 void timeout_sec(
unsigned int seconds);
234 void snapshot_timeout_sec(
unsigned int seconds);
241 void heartbeat_timeout_sec(
unsigned int seconds);
247 void heartbeat_interval_sec(
unsigned int seconds);
259 void max_snapshot_queue_size(
unsigned int size);
292 void enable_latency_tracking(
unsigned int bucket_interval_sec);
298 void disable_latency_tracking();
323 Error register_callback(
const std::string& topic_prefix,
328 Error register_callback(
const std::string& topic_prefix,
340 Error unregister_callback(
const std::string& topic_prefix);
341 Error unregister_callback(
const std::string& topic_prefix,
349 Error unregister_callback(SocketType fd);
363 Error get_notify_socket(
const std::string& topic_prefix,
366 Error get_notify_socket(
const std::string& topic_prefix,
382 Error dispatch(
long timeout_ms);
395 Error dispatch_fd(SocketType fd);
407 void set_notify_queue_message_limit(
size_t limit);
415 size_t get_notify_queue_message_limit();
427 void set_notify_queue_time_limit_ms(
int limit);
435 int get_notify_queue_time_limit_ms();
465 FEConsumer(
int sub_count,
int worker_count,
int high_watermark,
bool enable_compression);
476 FEConsumer(
int sub_count,
int worker_count,
int high_watermark);
527 Error authenticate(
const std::string& host,
528 const std::string& user,
529 const std::string& serial,
530 const std::string& key_id,
531 const std::string& key,
532 const std::string& counter,
533 const std::string& path,
550 Error authenticate(
const std::string& host,
551 const std::string& user,
552 const std::string& key_id,
553 const std::string& key,
554 const std::string& counter,
555 const std::string& path,
582 Error log_in(
bool request_files =
true);
611 Error subscribe(
const std::string& topic,
612 SnapshotMode snapshot_mode,
622 Error unsubscribe(
const std::string& topic);
631 Error request_file(
const std::string& filename, std::string& contents_out);
633 Error recover(
const std::string& topic,
638 Error request_snapshot(
const std::string& topic,
661 void authenticate_async(
const std::string& host,
662 const std::string& user,
663 const std::string& serial,
664 const std::string& key_id,
665 const std::string& key,
666 const std::string& counter,
667 const std::string& path,
674 void authenticate_async(
const std::string& host,
675 const std::string& user,
676 const std::string& key_id,
677 const std::string& key,
678 const std::string& counter,
679 const std::string& path,
684 void connect_async();
688 void disconnect_async();
692 void log_in_async(
bool request_files =
true);
696 void subscribe_async(
const std::string& topic,
697 SnapshotMode snapshot_mode,
702 void unsubscribe_async(
const std::string& topic);
706 void request_file_async(
const std::string& filename);
708 void recover_async(
const std::string& topic,
713 void request_snapshot_async(
const std::string& topic,
724 friend struct FEConsumerImpl;
725 FEConsumerImpl* m_impl;
No snapshots will be requested.
Definition: FEConsumer.h:79
DataSource
Set of possible data sources when registering callbacks.
Definition: FEConsumer.h:95
MD::MD_Message MsgType
Operating system file descriptor type.
Definition: FEConsumer.h:30
Snapshot data from request_out_of_band_snapshot.
Definition: FEConsumer.h:100
EventType
Set of possible event types.
Definition: Event.h:21
void(* MessageCallback)(const std::string &topic, MsgType &msg, void *closure)
Callback signature for receiving market data messages.
Definition: FEConsumer.h:39
DataMode
Set of possible data modes when subscribing.
Definition: FEConsumer.h:85
Market data from subscribe.
Definition: FEConsumer.h:98
Delayed market data will be requested.
Definition: FEConsumer.h:89
SnapshotMode
Set of possible snapshot modes when subscribing.
Definition: FEConsumer.h:76
Live realtime market data will be requested.
Definition: FEConsumer.h:88
Definition: FEConsumerOptions.h:12
Definition: LogMessage.h:11
Recovery data from recover.
Definition: FEConsumer.h:99
FEConsumer is a class which serves as the primary interface for interacting with the broadcast server...
Definition: FEConsumer.h:20