SubscriptionHandler.hh
Go to the documentation of this file.
std::string hUuid
Unique handler's UUID.
Definition: SubscriptionHandler.hh:86
SubscribeOptions opts
Subscribe options.
Definition: SubscriptionHandler.hh:89
void SetCallback(const MsgCallback< T > &_cb)
Set the callback for this handler.
Definition: SubscriptionHandler.hh:180
T endl(T... args)
A class to provide different options for a subscription.
Definition: SubscribeOptions.hh:35
std::string TypeName()
Get the type of the messages from which this subscriber handler is subscribed.
Definition: SubscriptionHandler.hh:265
Definition: SubscriptionHandler.hh:304
bool RunLocalCallback(const ProtoMsg &_msg, const MessageInfo &_info)
Executes the local callback registered for this handler.
Definition: SubscriptionHandler.hh:186
bool RunLocalCallback(const ProtoMsg &_msg, const MessageInfo &_info)
Executes the local callback registered for this handler.
Definition: SubscriptionHandler.hh:278
~RawSubscriptionHandler()
Destructor.
STL class.
const std::string kGenericMessageType
The string type used for generic messages.
Definition: TransportTypes.hh:170
double periodNs
If throttling is enabled, the minimum period for receiving a message in nanoseconds.
Definition: SubscriptionHandler.hh:96
void SetCallback(const MsgCallback< ProtoMsg > &_cb)
Set the callback for this handler.
Definition: SubscriptionHandler.hh:272
SubscriptionHandlerBase contains functions and data which are common to all SubscriptionHandler types...
Definition: SubscriptionHandler.hh:55
A class that provides information about the message received.
Definition: MessageInfo.hh:33
void SetCallback(const RawCallback &_callback)
Set the callback of this handler.
T reset(T... args)
std::string TypeName()
Get the type of the messages from which this subscriber handler is subscribed.
Definition: SubscriptionHandler.hh:173
Timestamp lastCbTimestamp
Timestamp of the last callback executed.
Definition: SubscriptionHandler.hh:92
SubscriptionHandler(const std::string &_nUuid, const SubscribeOptions &_opts=SubscribeOptions())
Definition: SubscriptionHandler.hh:148
const std::shared_ptr< ProtoMsg > CreateMsg(const std::string &_data, const std::string &_type) const
Create a specific protobuf message given its serialized data.
Definition: SubscriptionHandler.hh:228
SubscriptionHandler(const std::string &_nUuid, const SubscribeOptions &_opts=SubscribeOptions())
Definition: SubscriptionHandler.hh:221
RawSubscriptionHandler(const std::string &_nUuid, const std::string &_msgType=kGenericMessageType, const SubscribeOptions &_opts=SubscribeOptions())
Constructor.
bool RunRawCallback(const char *_msgData, const size_t _size, const MessageInfo &_info)
Executes the raw callback registered for this handler.
std::string TypeName() override
Get the type of the messages from which this subscriber handler is subscribed.
std::chrono::steady_clock::time_point Timestamp
Definition: TransportTypes.hh:151
const std::shared_ptr< ProtoMsg > CreateMsg(const std::string &_data, const std::string &) const
Create a specific protobuf message given its serialized data.
Definition: SubscriptionHandler.hh:155
It creates a subscription handler for a specific protobuf message. 'T' is the Protobuf message type t...
Definition: SubscriptionHandler.hh:144
*brief Advertise a new service without any output parameter *In this version the callback is a free function *param [in] _topic Topic name associated to the service *param [in] _cb Callback to handle the service request with the *following void(* _cb)(const RequestT &_req)
Definition: Node.hh:527
Definition: AdvertiseOptions.hh:27
Interface class used to manage generic protobuf messages.
Definition: SubscriptionHandler.hh:110
bool UpdateThrottling()
Check if message subscription is throttled. If so, verify whether the callback should be executed or ...