CARLA
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
MockPublisherMiddleware Class Reference
+ Inheritance diagram for MockPublisherMiddleware:

Public Member Functions

std::string GetTopicName () const override
 
bool Init (const std::string &topic_name) override
 Initialize the underlying middleware entities.
 
bool IsAlive () const override
 
bool Publish (void *message_data) override
 Serialize and write a message to the network.
 
- Public Member Functions inherited from carla::ros2::IPublisherMiddleware
virtual bool Init (const std::string &topic_name, const QosProfile &qos)
 Initialize with an explicit per-topic QoS profile (see QosProfile.h).
 
virtual ~IPublisherMiddleware ()=default
 

Public Attributes

bool alive {true}
 
bool init_called {false}
 
bool init_return_value {true}
 
void * last_published_data {nullptr}
 
std::string last_topic_name
 
bool publish_called {false}
 
bool publish_return_value {true}
 

Detailed Description

Definition at line 1069 of file test_ros2_middleware.cpp.

Member Function Documentation

◆ GetTopicName()

std::string MockPublisherMiddleware::GetTopicName ( ) const
inlineoverridevirtual
Returns
The topic name this publisher is bound to.

Implements carla::ros2::IPublisherMiddleware.

Definition at line 1093 of file test_ros2_middleware.cpp.

References last_topic_name.

◆ Init()

bool MockPublisherMiddleware::Init ( const std::string &  topic_name)
inlineoverridevirtual

Initialize the underlying middleware entities.

Parameters
topic_nameFull topic name including "rt/" prefix.
Returns
true on success.

Implements carla::ros2::IPublisherMiddleware.

Definition at line 1080 of file test_ros2_middleware.cpp.

References init_called, init_return_value, and last_topic_name.

◆ IsAlive()

bool MockPublisherMiddleware::IsAlive ( ) const
inlineoverridevirtual
Returns
true if at least one subscriber is matched.

Implements carla::ros2::IPublisherMiddleware.

Definition at line 1092 of file test_ros2_middleware.cpp.

References alive.

◆ Publish()

bool MockPublisherMiddleware::Publish ( void *  message_data)
inlineoverridevirtual

Serialize and write a message to the network.

Parameters
message_dataPointer to the message object (type-erased, cast internally).
Returns
true if the write succeeded.

Implements carla::ros2::IPublisherMiddleware.

Definition at line 1086 of file test_ros2_middleware.cpp.

References last_published_data, publish_called, and publish_return_value.

Member Data Documentation

◆ alive

bool MockPublisherMiddleware::alive {true}

Definition at line 1073 of file test_ros2_middleware.cpp.

Referenced by IsAlive().

◆ init_called

bool MockPublisherMiddleware::init_called {false}

Definition at line 1075 of file test_ros2_middleware.cpp.

Referenced by Init().

◆ init_return_value

bool MockPublisherMiddleware::init_return_value {true}

Definition at line 1071 of file test_ros2_middleware.cpp.

Referenced by Init().

◆ last_published_data

void* MockPublisherMiddleware::last_published_data {nullptr}

Definition at line 1078 of file test_ros2_middleware.cpp.

Referenced by Publish().

◆ last_topic_name

std::string MockPublisherMiddleware::last_topic_name

Definition at line 1077 of file test_ros2_middleware.cpp.

Referenced by GetTopicName(), and Init().

◆ publish_called

bool MockPublisherMiddleware::publish_called {false}

Definition at line 1076 of file test_ros2_middleware.cpp.

Referenced by Publish().

◆ publish_return_value

bool MockPublisherMiddleware::publish_return_value {true}

Definition at line 1072 of file test_ros2_middleware.cpp.

Referenced by Publish().


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