CARLA
Loading...
Searching...
No Matches
MockSubscriberMiddleware Class Reference
Inheritance diagram for MockSubscriberMiddleware:

Public Member Functions

std::string GetTopicName () const override
bool Init (const std::string &topic_name, void *message_ptr, bool *new_message_flag) override
 Initialize the underlying middleware entities.
bool IsAlive () const override
Public Member Functions inherited from carla::ros2::ISubscriberMiddleware
virtual bool Init (const std::string &topic_name, void *message_ptr, bool *new_message_flag, const QosProfile &qos)
 Initialize with an explicit per-topic QoS profile (see QosProfile.h).
virtual ~ISubscriberMiddleware ()=default

Public Attributes

bool alive {true}
bool init_called {false}
bool init_return_value {true}
std::string last_topic_name
bool * stored_flag_ptr {nullptr}
void * stored_message_ptr {nullptr}

Detailed Description

Definition at line 1098 of file test_ros2_middleware.cpp.

Member Function Documentation

◆ GetTopicName()

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

Implements carla::ros2::ISubscriberMiddleware.

Definition at line 1120 of file test_ros2_middleware.cpp.

References last_topic_name.

◆ Init()

bool MockSubscriberMiddleware::Init ( const std::string & topic_name,
void * message_ptr,
bool * new_message_flag )
inlineoverridevirtual

Initialize the underlying middleware entities.

The middleware writes incoming messages to *message_ptr and sets *new_message_flag = true.

Parameters
topic_nameFull topic name.
message_ptrPointer to the message storage owned by the caller.
new_message_flagPointer to the new-message flag owned by the caller.
Returns
true on success.

Implements carla::ros2::ISubscriberMiddleware.

Definition at line 1108 of file test_ros2_middleware.cpp.

References init_called, init_return_value, last_topic_name, stored_flag_ptr, and stored_message_ptr.

◆ IsAlive()

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

Implements carla::ros2::ISubscriberMiddleware.

Definition at line 1119 of file test_ros2_middleware.cpp.

References alive.

Member Data Documentation

◆ alive

bool MockSubscriberMiddleware::alive {true}

Definition at line 1101 of file test_ros2_middleware.cpp.

Referenced by IsAlive().

◆ init_called

bool MockSubscriberMiddleware::init_called {false}

Definition at line 1103 of file test_ros2_middleware.cpp.

Referenced by Init().

◆ init_return_value

bool MockSubscriberMiddleware::init_return_value {true}

Definition at line 1100 of file test_ros2_middleware.cpp.

Referenced by Init().

◆ last_topic_name

std::string MockSubscriberMiddleware::last_topic_name

Definition at line 1104 of file test_ros2_middleware.cpp.

Referenced by GetTopicName(), and Init().

◆ stored_flag_ptr

bool* MockSubscriberMiddleware::stored_flag_ptr {nullptr}

Definition at line 1106 of file test_ros2_middleware.cpp.

Referenced by Init().

◆ stored_message_ptr

void* MockSubscriberMiddleware::stored_message_ptr {nullptr}

Definition at line 1105 of file test_ros2_middleware.cpp.

Referenced by Init().


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