Template Class CMsgPublisher

Inheritance Relationships

Base Type

Class Documentation

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

eCAL abstract message publisher class.

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

Public Functions

CMsgPublisher()

Constructor.

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.

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

Creates this object.

Return

True if it succeeds, false if it fails.

Parameters
  • topic_name_: Unique topic name.

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

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

bool Destroy()

Destroys this object.

Return

True if it succeeds, false if it fails.

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

Send serialized message.

Return

Number of bytes sent.

Parameters
  • msg_: The message object.

  • time_: Optional time stamp.