#ifndef __WireFormats_h_ #define __WireFormats_h_ // This has to correspond with DataFormats.pas so we can talk with each other. #include #include typedef char ExchangeCode[8]; struct WireL1 { int64_t currentTime; // time_t. 0 for unknown. double bidPrice; int64_t bidSize; ExchangeCode bidExchange; double askPrice; int64_t askSize; ExchangeCode askExchange; } __attribute__((__packed__)); struct WireTos { int64_t currentTime; // time_t. 0 for unknown. double price; int64_t time; // On 64 bits systems time_t seems to be 64 bit, but why not be explicit here. int64_t size; ExchangeCode exchange; double todaysClose; int64_t volume; double open, high, low; bool formT, updatesLast, newPrint; } __attribute__((__packed__)); struct WireHalt { int64_t time; int64_t type; int64_t reason; double price; } __attribute__((__packed__)); // Note: Current time is typically the wall clock time. This is used mostly // for building candles. We read this from the data feed, rather than from // time(), in case the data feed is a little behind. const extern std::string WireL1Invalid; const extern std::string WireTosInvalid; const extern std::string WireL1Data; const extern std::string WireTosData; const extern std::string WireImbalanceData; const extern std::string WirePutVolumeData; const extern std::string WireCallVolumeData; const extern std::string WireLimitUpData; const extern std::string WireLimitDownData; const extern std::string WireNyseBidData; const extern std::string WireNyseAskData; const extern std::string WireHaltData; const extern std::string WireCommand; const extern std::string WireBody; const extern std::string WireSymbol; #endif