Broadcast C++ Toolkit
 All Classes Functions Variables Typedefs Enumerations Enumerator Pages
FactSet::Datafeed::Event Class Reference

Public Types

enum  EventType {
  STOP, AUTHENTICATE, CONNECTION_CHANGED, CONNECTION_RECOVERY,
  CONNECT, DISCONNECT, LOGIN, SUBSCRIBE,
  UNSUBSCRIBE, REQUEST_FILE, SNAPSHOT_COMPLETE, COUNT
}
 Set of possible event types. More...
 

Public Member Functions

 Event (const Event &other)
 
Eventoperator= (const Event &other)
 
const Errorerror () const
 Gets the Error associated with this event. More...
 
EventType type () const
 Gets the EventType of this Event.
 
std::string id () const
 Gets the unique id of this Event.
 
std::string get_value (const std::string &key) const
 Gets the value for the given key. More...
 
std::string all_values () const
 Gets all key-value pairs in the event. More...
 

Static Public Member Functions

static std::string to_string (EventType type)
 Gets the string representation of the given Event::EventType enum.
 

Friends

struct EventImpl
 

Member Enumeration Documentation

Set of possible event types.

Events are most commonly spawned to indicate the completion of the associated asynchronous method. Events and their associated methods are listed below.

Enumerator
STOP 

FEConsumer::stop_async()

AUTHENTICATE 

FEConsumer::authenticate_async()

CONNECTION_CHANGED 

This Event can be spawned independently of any asynchonous function call. Whenever the FEConsumer was connected and becomes disconnected or was disconnected and becomes connected, this Event will be spawned. Note that this is true even if the synchronous interface is used.

CONNECTION_RECOVERY 

Similar to CONNECTION_CHANGED, this event will be spawned after an attempt to recover a lost connection to the server to indicate the success of that attempt

CONNECT 

FEConsumer::connect_async()

DISCONNECT 

FEConsumer::disconnect_async()

LOGIN 

FEConsumer::log_in_async()

SUBSCRIBE 

FEConsumer::subscribe_async()

UNSUBSCRIBE 

FEConsumer::unsubscribe_async()

REQUEST_FILE 

FEConsumer::request_file_async()

SNAPSHOT_COMPLETE 

FEConsumer::subscribe() or FEConsumer::subscribe_async() with snapshots.

COUNT 

Dummy value indicating number of EventTypes.

Member Function Documentation

std::string FactSet::Datafeed::Event::all_values ( ) const

Gets all key-value pairs in the event.

Returns
A string containing a list of all key value pairs.
const Error& FactSet::Datafeed::Event::error ( ) const

Gets the Error associated with this event.

Returns
The Error that occured or Error::NoError if the operation was a success.
std::string FactSet::Datafeed::Event::get_value ( const std::string &  key) const

Gets the value for the given key.

Some events will contain additional information depending on the type of the event. See below for tables containing keys by event type and their meanings.

AUTHENTICATE

Key Type Description
Host std::string Value of host argument from request.
User std::string Value of user argument from request.
Serial std::string Value of serial argument from request.
KeyId std::string Value of key_id argument from request.
Key std::string Value of key argument from request.
Counter std::string Value of counter argument from request.
Path std::string Value of path argument from request.
ForceInput bool Value of force_input argument from request.

SUBSCRIBE

Key Type Description
Topic std::string Value of topic argument from request.
SnapshotMode FEConsumer::SnapshotMode Value of snapshot_mode argument from request.
DataMode FEConsumer::DataMode Value of data_mode argument from request.

UNSUBSCRIBE

Key Type Description
Topic std::string Value of topic argument from request.

CONNECTION_CHANGED

Key Type Description
Connected bool True if the FEConsumer is currently connected, false otherwise.

CONNECTION_RECOVERY

Key Type Description
LastHeartbeat std::chrono::system_clock::rep Timestamp of the last heartbeat received in number of ticks since epoch.
Parameters
keyKey to query.
Returns
Value for key or empty string if there is no value.

The documentation for this class was generated from the following file: