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

Registry to manage displays by topic name. More...

#include <display_registry.hpp>

Public Types

using DisplayMap = std::map< std::string, std::shared_ptr< Display > >
 

Public Member Functions

 DisplayRegistry ()=default
 
 ~DisplayRegistry ()=default
 
bool contains (const std::string &topic) const
 Check if a topic is already registered.
 
std::shared_ptr< Displayget (const std::string &topic) const
 Get a display for a topic.
 
void set (const std::string &topic, std::shared_ptr< Display > display)
 Register or replace a display for a topic.
 
const DisplayMapall () const
 Return the full registry map.
 
void clear ()
 Stop all displays and clear the registry.
 

Detailed Description

Registry to manage displays by topic name.

This class owns display instances and provides lookup helpers.

Member Typedef Documentation

◆ DisplayMap

using awviz_common::DisplayRegistry::DisplayMap = std::map<std::string, std::shared_ptr<Display> >

Constructor & Destructor Documentation

◆ DisplayRegistry()

awviz_common::DisplayRegistry::DisplayRegistry ( )
default

◆ ~DisplayRegistry()

awviz_common::DisplayRegistry::~DisplayRegistry ( )
default

Member Function Documentation

◆ all()

const DisplayRegistry::DisplayMap & awviz_common::DisplayRegistry::all ( ) const

Return the full registry map.

Returns
Map of topic name to display.

◆ clear()

void awviz_common::DisplayRegistry::clear ( )

Stop all displays and clear the registry.

◆ contains()

bool awviz_common::DisplayRegistry::contains ( const std::string &  topic) const

Check if a topic is already registered.

Parameters
topicTopic name.
Returns
true if the topic exists.

◆ get()

std::shared_ptr< Display > awviz_common::DisplayRegistry::get ( const std::string &  topic) const

Get a display for a topic.

Parameters
topicTopic name.
Returns
Shared pointer to display, or nullptr if not found.

◆ set()

void awviz_common::DisplayRegistry::set ( const std::string &  topic,
std::shared_ptr< Display display 
)

Register or replace a display for a topic.

Parameters
topicTopic name.
displayDisplay instance.

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