AWViz-ROS
Loading...
Searching...
No Matches
awviz_common::RosTopicProperty Class Reference

Struct representing a property of ROS msg display instance. More...

#include <property.hpp>

Public Member Functions

 RosTopicProperty ()=default
 
 RosTopicProperty (const std::string &type, const std::string &topic, const std::shared_ptr< std::unordered_map< std::string, std::string > > entity_roots)
 Construct instance.
 
void set_type (const std::string &type)
 Set ROS message type name.
 
void set_topic (const std::string &topic)
 Set ROS topic name.
 
void set_entity_roots (const std::shared_ptr< std::unordered_map< std::string, std::string > > entity_roots)
 Set entity path of record.
 
const std::string & type () const noexcept
 Get ROS message type.
 
const std::string & topic () const noexcept
 Get ROS topic name.
 
const std::string & entity () const noexcept
 Return the entity path using topic name.
 
std::optional< std::string > entity (const std::string &frame_id) const noexcept
 Return the entity path using the corresponding root and its frame ID with its topic.
 
std::optional< std::string > entity_without_topic (const std::string &frame_id) const noexcept
 Return the entity path using the corresponding root and its frame ID without its topic.
 
bool is_initialized () const
 

Detailed Description

Struct representing a property of ROS msg display instance.

Constructor & Destructor Documentation

◆ RosTopicProperty() [1/2]

awviz_common::RosTopicProperty::RosTopicProperty ( )
default

◆ RosTopicProperty() [2/2]

awviz_common::RosTopicProperty::RosTopicProperty ( const std::string &  type,
const std::string &  topic,
const std::shared_ptr< std::unordered_map< std::string, std::string > >  entity_roots 
)
inline

Construct instance.

Parameters
typeROS msg type.
topicName of topic.
entity_rootsRoot entity paths to recording.

Member Function Documentation

◆ entity() [1/2]

const std::string & awviz_common::RosTopicProperty::entity ( ) const
inlinenoexcept

Return the entity path using topic name.

Returns
Topic name used as entity path.

◆ entity() [2/2]

std::optional< std::string > awviz_common::RosTopicProperty::entity ( const std::string &  frame_id) const
inlinenoexcept

Return the entity path using the corresponding root and its frame ID with its topic.

Parameters
frame_idFrame ID.
Returns
Return "/<Root>/<FrameID>/<Topic>" if the corresponding root exists, otherwise return std::nullopt.

◆ entity_without_topic()

std::optional< std::string > awviz_common::RosTopicProperty::entity_without_topic ( const std::string &  frame_id) const
inlinenoexcept

Return the entity path using the corresponding root and its frame ID without its topic.

Parameters
frame_idFrame ID.
Returns
Return "/<Root>/<FrameID>" if the corresponding root exists, otherwise return std::nullopt.

◆ is_initialized()

bool awviz_common::RosTopicProperty::is_initialized ( ) const
inline

◆ set_entity_roots()

void awviz_common::RosTopicProperty::set_entity_roots ( const std::shared_ptr< std::unordered_map< std::string, std::string > >  entity_roots)
inline

Set entity path of record.

Parameters
entityEntity path of record.

◆ set_topic()

void awviz_common::RosTopicProperty::set_topic ( const std::string &  topic)
inline

Set ROS topic name.

Parameters
topicName of topic.

◆ set_type()

void awviz_common::RosTopicProperty::set_type ( const std::string &  type)
inline

Set ROS message type name.

Parameters
typeName of ROS message type.

◆ topic()

const std::string & awviz_common::RosTopicProperty::topic ( ) const
inlinenoexcept

Get ROS topic name.

Returns
Name of topic.

◆ type()

const std::string & awviz_common::RosTopicProperty::type ( ) const
inlinenoexcept

Get ROS message type.

Returns
ROS message type name.

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