ark::time::GlobalTimeSubscriber

Defined in header “ark/time/global_time_subscriber.hh”.


Subscribes to global time, and then provides helper functions to handle translation of pipeline time to global time.

Intended as a set of convenience routines to make it easier for a stage to access global time.

Methods

  • GlobalTimeSubscriber(pipeline::StageInterface & interface, const std::string & channel_name)
    Constructor. Initializes the subscriber against the given channel name.

  • bool global_time_valid()
    Returns true if a time model is usable, false otherwise.

  • std::chrono::system_clock::time_point global_now()
    Returns global time, from our time model. Returns local global time if a time model is not received (or not valid).

  • std::optional< std::chrono::system_clock::time_point > from_pipeline_time(const std::chrono::steady_clock::time_point & pipeline_time)
    Converts the given pipeline time to global time. Returns an empty optional if no time model has been received (or the time model is not valid).