Class DataWarehouse

Inheritance Relationships

Base Type

  • public std::enable_shared_from_this< DataWarehouse >

Class Documentation

class DataWarehouse : public std::enable_shared_from_this<DataWarehouse>

Container for all of the SetupConfig object singletons.

Public Functions

DataWarehouse(const rclcpp::Node::SharedPtr &parent_node)
void preloadWithURDFPath(const std::filesystem::path &urdf_path)
void preloadWithFullConfig(const std::string &package_path_or_name)
SetupConfigPtr get(const std::string &config_name, std::string config_class = "")

Get the singleton for a given config name and class.

Parameters:
  • config_name – The name of the SetupConfig

  • config_class – The string used to load the class via pluginlib. If empty, the registered type is used.

Throws:

std::runtime_error – If the name is not registered to a type

Returns:

Shared pointer to the generic SetupConfig object

template<typename T>
inline std::shared_ptr<T> get(const std::string &config_name, const std::string &config_class = "")

Get the specific singleton for a given config name and class.

Unlike the non-templated version of this method, this returns the SetupConfig pointer cast to the specific config type.

Parameters:
  • config_name – The name of the SetupConfig

  • config_class – The string used to load the class via pluginlib. If empty, the registered type is used.

Throws:

std::runtime_error – If the name is not registered to a type

Returns:

Shared pointer to the specific SetupConfig object

template<typename T>
inline std::unordered_map<std::string, std::shared_ptr<T>> getAll()

Get all of the registered configs that match the given config_class.

Parameters:

config_class – The string representing the class name

Returns:

Map of shared pointers from config names to singleton config

void registerType(const std::string &config_name, const std::string &config_class)

Associates a class_name with the given name. Makes calls to get more succinct.

std::vector<SetupConfigPtr> getConfigured()

Returns a list of the SetupConfig for which isConfigured is true.

const std::vector<std::string> &getRegisteredNames() const

Returns a list of config_names that have registered types associated with them.

Public Members

bool debug = {false}

Is this application in debug mode?

Protected Attributes

rclcpp::Node::SharedPtr parent_node_
pluginlib::ClassLoader<SetupConfig> config_loader_
std::unordered_map<std::string, SetupConfigPtr> configs_
std::unordered_map<std::string, std::string> registered_types_
std::vector<std::string> registered_names_