Goby3  3.1.5a
2024.05.23
goby::middleware::PublisherCallback< Data, scheme_id, Metadata > Class Template Reference

Represents a callback for a published data type (e.g. acked_func or expired_func) More...

#include <goby/middleware/transport/serialization_handlers.h>

Inheritance diagram for goby::middleware::PublisherCallback< Data, scheme_id, Metadata >:
goby::middleware::SerializationHandlerBase< Metadata > goby::middleware::SerializationHandlerPostSelector< void >

Public Types

typedef std::function< void(const Data &data, const Metadata &md)> HandlerType
 
- Public Types inherited from goby::middleware::SerializationHandlerBase< Metadata >
enum  SubscriptionAction { SubscriptionAction::SUBSCRIBE, SubscriptionAction::UNSUBSCRIBE, SubscriptionAction::PUBLISHER_CALLBACK }
 

Public Member Functions

 PublisherCallback (HandlerType handler)
 
 PublisherCallback (HandlerType handler, const Data &data)
 
std::string::const_iterator post (std::string::const_iterator b, std::string::const_iterator e, const Metadata &md) const override
 
std::vector< char >::const_iterator post (std::vector< char >::const_iterator b, std::vector< char >::const_iterator e, const Metadata &md) const override
 
const charpost (const char *b, const char *e, const Metadata &md) const override
 
SerializationHandlerBase< Metadata >::SubscriptionAction action () const override
 
const std::string & type_name () const override
 
const Groupsubscribed_group () const override
 
int scheme () const override
 
- Public Member Functions inherited from goby::middleware::SerializationHandlerBase< Metadata >
 SerializationHandlerBase ()=default
 
virtual ~SerializationHandlerBase ()=default
 
std::thread::id thread_id () const
 
virtual std::string subscriber_id () const
 

Detailed Description

template<typename Data, int scheme_id, typename Metadata>
class goby::middleware::PublisherCallback< Data, scheme_id, Metadata >

Represents a callback for a published data type (e.g. acked_func or expired_func)

Definition at line 280 of file serialization_handlers.h.

Member Typedef Documentation

◆ HandlerType

template<typename Data , int scheme_id, typename Metadata >
typedef std::function<void(const Data& data, const Metadata& md)> goby::middleware::PublisherCallback< Data, scheme_id, Metadata >::HandlerType

Definition at line 283 of file serialization_handlers.h.

Constructor & Destructor Documentation

◆ PublisherCallback() [1/2]

template<typename Data , int scheme_id, typename Metadata >
goby::middleware::PublisherCallback< Data, scheme_id, Metadata >::PublisherCallback ( HandlerType  handler)
inline

Definition at line 285 of file serialization_handlers.h.

◆ PublisherCallback() [2/2]

template<typename Data , int scheme_id, typename Metadata >
goby::middleware::PublisherCallback< Data, scheme_id, Metadata >::PublisherCallback ( HandlerType  handler,
const Data &  data 
)
inline

Definition at line 290 of file serialization_handlers.h.

Member Function Documentation

◆ action()

template<typename Data , int scheme_id, typename Metadata >
SerializationHandlerBase<Metadata>::SubscriptionAction goby::middleware::PublisherCallback< Data, scheme_id, Metadata >::action ( ) const
inlineoverridevirtual

◆ post() [1/3]

template<typename Data , int scheme_id, typename Metadata >
const char* goby::middleware::PublisherCallback< Data, scheme_id, Metadata >::post ( const char b,
const char e,
const Metadata &  md 
) const
inlineoverride

Definition at line 311 of file serialization_handlers.h.

◆ post() [2/3]

template<typename Data , int scheme_id, typename Metadata >
std::string::const_iterator goby::middleware::PublisherCallback< Data, scheme_id, Metadata >::post ( std::string::const_iterator  b,
std::string::const_iterator  e,
const Metadata &  md 
) const
inlineoverride

Definition at line 296 of file serialization_handlers.h.

◆ post() [3/3]

template<typename Data , int scheme_id, typename Metadata >
std::vector<char>::const_iterator goby::middleware::PublisherCallback< Data, scheme_id, Metadata >::post ( std::vector< char >::const_iterator  b,
std::vector< char >::const_iterator  e,
const Metadata &  md 
) const
inlineoverride

Definition at line 303 of file serialization_handlers.h.

◆ scheme()

template<typename Data , int scheme_id, typename Metadata >
int goby::middleware::PublisherCallback< Data, scheme_id, Metadata >::scheme ( ) const
inlineoverridevirtual

◆ subscribed_group()

template<typename Data , int scheme_id, typename Metadata >
const Group& goby::middleware::PublisherCallback< Data, scheme_id, Metadata >::subscribed_group ( ) const
inlineoverridevirtual

◆ type_name()

template<typename Data , int scheme_id, typename Metadata >
const std::string& goby::middleware::PublisherCallback< Data, scheme_id, Metadata >::type_name ( ) const
inlineoverridevirtual

The documentation for this class was generated from the following file: