Class DataLoader#

Class Documentation#

class DataLoader#

Class for managing and loading data using different loaders.

This class manages a set of Loader objects and provides methods for registering, removing, and loading data using these objects. It also defines a method for loading control messages from data sources using the registered loaders.

Public Functions

DataLoader() = default#

Default constructor for the DataLoader class.

DataLoader(nlohmann::json config)#

Constructor with config for the DataLoader class.

~DataLoader() = default#

Destructor for the DataLoader class.

std::shared_ptr<ControlMessage> load(
std::shared_ptr<ControlMessage> control_message
)#

Method for loading a control message using the registered loaders.

Parameters:

control_message – A shared pointer to the control message to be loaded.

Returns:

A shared pointer to the loaded control message.

void add_loader(
const std::string &loader_id,
std::shared_ptr<Loader> loader,
bool overwrite = true
)#

Method for registering a loader instance with the data loader.

Parameters:
  • loader_id – A string identifier for the loader instance.

  • loader – A shared pointer to the Loader object to be registered.

  • overwrite – A boolean indicating whether to overwrite an existing loader instance with the same identifier.

void remove_loader(
const std::string &loader_id,
bool throw_if_not_found = true
)#

Method for removing a loader instance from the data loader.

Parameters:
  • loader_id – A string identifier for the loader instance to be removed.

  • throw_if_not_found – A boolean indicating whether to throw an exception if the loader instance with the given identifier is not found.