WireCellToolkit
Wire Cell Simulation, Signal Process and Reconstruction Toolki for Liquid Argon Detectors
WireCell::ConfigManager Class Reference

#include <ConfigManager.h>

Public Types

typedef std::pair< std::string, std::string > ClassInstance
 Return a list of all known configurables. More...
 

Public Member Functions

 ConfigManager ()
 
 ~ConfigManager ()
 
void extend (Configuration more)
 Extend current list of configuration objects with more. More...
 
int add (Configuration &cfg)
 
int add (Configuration &data, const std::string &type, const std::string &name="")
 
Configuration all () const
 Return top-level, aggregate configuration. More...
 
Configuration at (int index) const
 
int index (const std::string &type, const std::string &name="") const
 
int size () const
 Return the number of configuration objects. More...
 
Configuration pop (int ind)
 Remove configuration at given index and return it. More...
 
std::vector< ClassInstanceconfigurables () const
 

Detailed Description

Bundle up some policy for handling configuration.

Overall configuration object is a list of configuration objects for each configurable instance.

Each instance configuration is a dict with keys:

  • type gives the registered class name
  • name gives an instance name, ("" by default if omitted)
  • data gives a type-specific Configuration dictionary for the instance.

Definition at line 20 of file ConfigManager.h.

Member Typedef Documentation

◆ ClassInstance

typedef std::pair<std::string, std::string> WireCell::ConfigManager::ClassInstance

Return a list of all known configurables.

Definition at line 52 of file ConfigManager.h.

Constructor & Destructor Documentation

◆ ConfigManager()

ConfigManager::ConfigManager ( )

Definition at line 8 of file ConfigManager.cxx.

◆ ~ConfigManager()

ConfigManager::~ConfigManager ( )

Definition at line 12 of file ConfigManager.cxx.

Member Function Documentation

◆ add() [1/2]

int ConfigManager::add ( Configuration cfg)

Definition at line 39 of file ConfigManager.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add() [2/2]

int ConfigManager::add ( Configuration data,
const std::string &  type,
const std::string &  name = "" 
)

Definition at line 49 of file ConfigManager.cxx.

Here is the call graph for this function:

◆ all()

Configuration WireCell::ConfigManager::all ( ) const
inline

Return top-level, aggregate configuration.

Definition at line 37 of file ConfigManager.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ at()

Configuration ConfigManager::at ( int  index) const

Definition at line 58 of file ConfigManager.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ configurables()

std::vector< ConfigManager::ClassInstance > ConfigManager::configurables ( ) const

Definition at line 66 of file ConfigManager.cxx.

◆ extend()

void ConfigManager::extend ( Configuration  more)

Extend current list of configuration objects with more.

Definition at line 16 of file ConfigManager.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ index()

int ConfigManager::index ( const std::string &  type,
const std::string &  name = "" 
) const

Return index of configuration for given class and instance names. If not found, returned index == -1;

Definition at line 22 of file ConfigManager.cxx.

Here is the caller graph for this function:

◆ pop()

Configuration ConfigManager::pop ( int  ind)

Remove configuration at given index and return it.

Definition at line 75 of file ConfigManager.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ size()

int WireCell::ConfigManager::size ( ) const
inline

Return the number of configuration objects.

Definition at line 46 of file ConfigManager.h.

Here is the call graph for this function:
Here is the caller graph for this function:

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