Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
|
The EntryManager serves as a component to track the status of each required CARMA ROS 1 driver. More...
#include <entry_manager.hpp>
Public Member Functions | |
EntryManager () | |
Default constructor for EntryManager. More... | |
EntryManager (std::vector< std::string > required_entries) | |
Constructor for EntryManager to set required entries. More... | |
EntryManager (std::vector< std::string > required_entries, std::vector< std::string > camera_entries) | |
Constructor for EntryManager to set required entries and camera entires. More... | |
void | update_entry (const Entry &entry) |
Add a new entry if the given name does not exist. Update an existing entry if the given name exists. More... | |
std::vector< Entry > | get_entries () const |
Get all registed entries as a list. More... | |
boost::optional< Entry > | get_entry_by_name (const std::string &name) const |
Get a entry using name as the key. More... | |
void | delete_entry (const std::string &name) |
Delete an entry using the given name as the key. More... | |
bool | is_entry_required (const std::string &name) const |
Check if the entry is required. More... | |
int | is_camera_entry_required (const std::string &name) const |
Check if the entry is a required camera entry. More... | |
EntryManager ()=default | |
Default constructor for EntryManager. More... | |
void | update_entry (const Entry &entry) |
Add a new entry if the given name does not exist. Update an existing entry if the given name exists. More... | |
std::vector< Entry > | get_entries () const |
Get all entries as a list. More... | |
std::vector< std::string > | get_entry_names () const |
Get all entry names as a list. More... | |
boost::optional< Entry > | get_entry_by_name (const std::string &name) const |
Get a entry using name as the key. More... | |
void | delete_entry (const std::string &name) |
Delete an entry using the given name as the key. More... | |
Private Attributes | |
std::vector< Entry > | entry_list_ |
private list to keep track of all entries More... | |
std::vector< std::string > | required_entries_ |
std::vector< std::string > | camera_entries_ |
std::unordered_map< std::string, Entry > | entry_map_ |
private map by entry name to keep track of all entries More... | |
The EntryManager serves as a component to track the status of each required CARMA ROS 1 driver.
An entry manager keeps track of the set of entries and makes it easy to add or remove entries.
Definition at line 30 of file entry_manager.hpp.
subsystem_controllers::EntryManager::EntryManager | ( | ) |
subsystem_controllers::EntryManager::EntryManager | ( | std::vector< std::string > | required_entries | ) |
Constructor for EntryManager to set required entries.
Definition at line 24 of file entry_manager.cpp.
subsystem_controllers::EntryManager::EntryManager | ( | std::vector< std::string > | required_entries, |
std::vector< std::string > | camera_entries | ||
) |
Constructor for EntryManager to set required entries and camera entires.
Definition at line 26 of file entry_manager.cpp.
|
default |
Default constructor for EntryManager.
void subsystem_controllers::EntryManager::delete_entry | ( | const std::string & | name | ) |
Delete an entry using the given name as the key.
Definition at line 50 of file entry_manager.cpp.
References entry_list_, and process_bag::i.
void subsystem_controllers::EntryManager::delete_entry | ( | const std::string & | name | ) |
Delete an entry using the given name as the key.
std::vector< Entry > subsystem_controllers::EntryManager::get_entries | ( | ) | const |
Get all registed entries as a list.
Definition at line 44 of file entry_manager.cpp.
References entry_list_.
Referenced by subsystem_controllers::PluginManager::activate(), subsystem_controllers::PluginManager::cleanup(), subsystem_controllers::PluginManager::configure(), subsystem_controllers::PluginManager::deactivate(), subsystem_controllers::PluginManager::get_active_plugins(), subsystem_controllers::PluginManager::get_control_plugins_by_capability(), subsystem_controllers::PluginManager::get_registered_plugins(), subsystem_controllers::PluginManager::get_strategic_plugins_by_capability(), and subsystem_controllers::PluginManager::get_tactical_plugins_by_capability().
std::vector< Entry > subsystem_controllers::EntryManager::get_entries | ( | ) | const |
Get all entries as a list.
boost::optional< Entry > subsystem_controllers::EntryManager::get_entry_by_name | ( | const std::string & | name | ) | const |
Get a entry using name as the key.
Definition at line 62 of file entry_manager.cpp.
References entry_list_, and process_bag::i.
Referenced by subsystem_controllers::PluginManager::activate_plugin(), and subsystem_controllers::PluginManager::update_plugin_status().
boost::optional< Entry > subsystem_controllers::EntryManager::get_entry_by_name | ( | const std::string & | name | ) | const |
Get a entry using name as the key.
std::vector< std::string > subsystem_controllers::EntryManager::get_entry_names | ( | ) | const |
Get all entry names as a list.
Definition at line 40 of file entry_manager.cpp.
References entry_map_.
Referenced by subsystem_controllers::PluginManager::shutdown().
int subsystem_controllers::EntryManager::is_camera_entry_required | ( | const std::string & | name | ) | const |
Check if the entry is a required camera entry.
Definition at line 87 of file entry_manager.cpp.
References camera_entries_, and process_bag::i.
bool subsystem_controllers::EntryManager::is_entry_required | ( | const std::string & | name | ) | const |
Check if the entry is required.
Definition at line 75 of file entry_manager.cpp.
References process_bag::i, and required_entries_.
void subsystem_controllers::EntryManager::update_entry | ( | const Entry & | entry | ) |
Add a new entry if the given name does not exist. Update an existing entry if the given name exists.
Definition at line 29 of file entry_manager.cpp.
References subsystem_controllers::Entry::available_, entry_list_, process_bag::i, subsystem_controllers::Entry::name_, and subsystem_controllers::Entry::timestamp_.
Referenced by subsystem_controllers::PluginManager::PluginManager(), subsystem_controllers::PluginManager::activate(), subsystem_controllers::PluginManager::activate_plugin(), subsystem_controllers::PluginManager::add_plugin(), subsystem_controllers::PluginManager::cleanup(), subsystem_controllers::PluginManager::configure(), subsystem_controllers::PluginManager::deactivate(), and subsystem_controllers::PluginManager::update_plugin_status().
void subsystem_controllers::EntryManager::update_entry | ( | const Entry & | entry | ) |
Add a new entry if the given name does not exist. Update an existing entry if the given name exists.
entry | The entry to update or add |
|
private |
Definition at line 89 of file entry_manager.hpp.
Referenced by is_camera_entry_required().
|
private |
private list to keep track of all entries
Definition at line 83 of file entry_manager.hpp.
Referenced by delete_entry(), get_entries(), get_entry_by_name(), and update_entry().
|
private |
private map by entry name to keep track of all entries
Definition at line 69 of file entry_manager.h.
Referenced by get_entry_names().
|
private |
Definition at line 86 of file entry_manager.hpp.
Referenced by is_entry_required().