ark::pipeline::Callback

Defined in header “ark/pipeline/callback.hh”.


A dynamic callback, invoking (at compile time) an appropriate callback based on the subscriber’s signature.

Typedefs

  • using ObjectTypePtr = std::shared_ptr< const ObjectType >
    Wraps the type in a shared_ptr.

  • using TimestampCallbackType = std::function< void(ObjectTypePtr, const std::chrono::steady_clock::time_point &)>
    Defines the callback signature for a callback with a object type and timestamp.

  • using PlainCallbackType = std::function< void(ObjectTypePtr)>
    The callback signature for a ‘plain’ (without timestamp) callback.

  • using PlainValueCallbackType = std::function< void(ObjectType)>
    The callback signature for a ‘plain’ (without timestamp or pointer) callback.

  • using TimestampPlainValueCallbackType = std::function< void(ObjectType, const std::chrono::steady_clock::time_point &)>

Methods

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

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

  • void operator()(ObjectTypePtr && type, const std::chrono::steady_clock::time_point & publish_time)
    Executes the callback with the given parameters, depending on what callback signature was provided.

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

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