Template Class CMsgPublisher#

Inheritance Relationships#

Base Type#

Class Documentation#

template<typename T>
class CMsgPublisher : public eCAL::CPublisher#

eCAL abstract message publisher class.

Abstract publisher template class for messages. For details see documentation of CPublisher class.

Public Functions

inline CMsgPublisher()#

Constructor.

inline CMsgPublisher(const std::string &topic_name_, const std::string &topic_type_ = "", const std::string &topic_desc_ = "")#

Constructor.

Parameters
  • topic_name_ – Unique topic name.

  • topic_type_ – Type name (optional for type checking).

  • topic_desc_ – Type description (optional for description checking).

CMsgPublisher(const CMsgPublisher&) = delete#

Copy Constructor is not available.

CMsgPublisher &operator=(const CMsgPublisher&) = delete#

Copy Constructor is not available.

CMsgPublisher(CMsgPublisher&&) = default#

Move Constructor.

CMsgPublisher &operator=(CMsgPublisher&&) = default#

Move assignment.

virtual ~CMsgPublisher() = default#
inline bool Create(const std::string &topic_name_, const std::string &topic_type_ = "", const std::string &topic_desc_ = "")#

Creates this object.

Parameters
  • topic_name_ – Unique topic name.

  • topic_type_ – Type name (optional for type checking).

  • topic_desc_ – Type description (optional for description checking).

Returns

True if it succeeds, false if it fails.

inline bool Destroy()#

Destroys this object.

Returns

True if it succeeds, false if it fails.

inline size_t Send(const T &msg_, long long time_ = -1)#

Send serialized message.

Parameters
  • msg_ – The message object.

  • time_ – Optional time stamp.

Returns

Number of bytes sent.