6#include <nlohmann/json.hpp>
33std::string
RecordEvent(nlohmann::ordered_json& event,
const FILETIME& time);
43 static std::unique_ptr<DetectorSubscription>
Open(
const std::vector<std::string>& eventNames);
48 bool Wait(std::vector<DetectorEventRecord>& out, DWORD timeoutMs);
55 std::shared_ptr<DetectorSubscriberState> m_state;
static std::unique_ptr< DetectorSubscription > Open(const std::vector< std::string > &eventNames)
Registers a subscriber. Returns nullptr when the service is stopping or too many subscribers are conn...
DetectorSubscription & operator=(const DetectorSubscription &)=delete
DetectorSubscription(const DetectorSubscription &)=delete
bool Wait(std::vector< DetectorEventRecord > &out, DWORD timeoutMs)
Waits up to timeoutMs for events and moves the queued ones into out (which it clears first)....
void StopDetectorStreams()
Wakes every subscriber's Wait with false and refuses new subscribers, so the SubscribeEvents calls re...
std::string RecordEvent(nlohmann::ordered_json &event, const FILETIME &time)
Gives event the next sequence number (appended as "Seq"), writes it to pano.log and queues it for eve...
FILETIME CurrentFileTime()
The current time as a FILETIME, for events that carry no timestamp of their own.
One event as sent to the detector (a DetectorEvent message).