ark::main::LogOpenedCallback

Defined in header “ark/main/log_opened_callback.hh”.


A dynamic callback, invoking (at compile time) an appropriate callback based on the callback signature. This allows you to alternatively retrieve a manifest, config package, or a log reader depending on your lambda.

Note that if you request a config package and none is available, an empty config package is provided instead.

Typedefs

  • using ReaderCallbackType = std::function< void(pipeline::Pipeline &, logging::LogReader &)>
    The ‘reader’ based callback signature.

  • using ManifestCallbackType = std::function< void(pipeline::Pipeline &, const logging::Manifest &)>
    The ‘manifest’ based callback signature (legacy).

  • using ConfigCallbackType = std::function< void(pipeline::Pipeline &, std::optional< config::ConfigPackage >)>
    A config package callback signature, to retrieve the logged config package directly.

Methods

  • LogOpenedCallback()
    Default constructor. Creates an empty callback.

  • LogOpenedCallback(ConstructorCallback function)
    Constructor. Left implicit to make assigning lambdas to callbacks a little more “magic”.

  • void operator()(pipeline::Pipeline & pipeline, logging::LogReader & reader)
    Executes the callback with the given parameters, depending on what callback signature was provided.

  • operator bool()
    Returns true if this function is set, false otherwise.

  • void reset()
    Resets the function, removing any reference to captured elements.

  • const std::type_info & target_type()
    Returns type information about the underlying function.