Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Types | Public Member Functions | Static Public Member Functions | List of all members
datatools::configuration::variant_registry Class Reference

Registry of configuration variant parameters and associated variants. More...

#include <bayeux/datatools/configuration/variant_registry.h>

Inheritance diagram for datatools::configuration::variant_registry:
datatools::enriched_base datatools::i_serializable datatools::i_tree_dumpable

Public Types

enum  list_flags {
  LIST_ACTIVE_ONLY = datatools::bit_mask::bit00, LIST_NO_SET = datatools::bit_mask::bit01, LIST_NO_UNSET = datatools::bit_mask::bit02, LIST_CLEAR = datatools::bit_mask::bit03,
  LIST_NO_PARAMETERS = datatools::bit_mask::bit04, LIST_NO_VARIANTS = datatools::bit_mask::bit05, LIST_RANKED = datatools::bit_mask::bit06
}
 Flags for building the list of parameters. More...
 
typedef std::map< std::string, variant_recordrecord_dict_type
 Type of dictionary of configuration variant records. More...
 
- Public Types inherited from datatools::enriched_base
enum  export_config_flags {
  EXPORT_CONFIG_CLEAR = bit_mask::bit00, EXPORT_CONFIG_NAME = bit_mask::bit01, EXPORT_CONFIG_DISPLAY_NAME = bit_mask::bit02, EXPORT_CONFIG_TERSE_DESCRIPTION = bit_mask::bit03,
  EXPORT_CONFIG_LOGGING_PRIORITY = bit_mask::bit04, EXPORT_CONFIG_AUXILIARIES = bit_mask::bit05, EXPORT_CONFIG_DEFAULT, EXPORT_CONFIG_LAST = EXPORT_CONFIG_AUXILIARIES
}
 Flags for export to a container of properties. More...
 
- Public Types inherited from datatools::i_tree_dumpable
enum  ostream_type { OSTREAM_COUT = 1, OSTREAM_CERR = 2, OSTREAM_CLOG = 3 }
 Enumeration for standard output streams. More...
 

Public Member Functions

virtual bool is_name_valid (const std::string &name_) const
 Check if a name is valid. More...
 
 variant_registry ()
 Default constructor. More...
 
virtual ~variant_registry ()
 Destructor. More...
 
bool has_top_variant_name () const
 Check if the top variant name is set. More...
 
const std::string & get_top_variant_name () const
 Return the name of the top variant used to initialize the registry. More...
 
record_dict_typegrab_records ()
 Return a reference to the mutable dictionary of records. More...
 
const record_dict_typeget_records () const
 Return a reference to the non-mutable dictionary of records. More...
 
bool is_mounted () const
 Check if the registry is mounted in some parent repository. More...
 
const std::string & get_mounting_name () const
 Return the mounting name. More...
 
bool has_parent_repository () const
 Check the parent repository. More...
 
void set_parent_repository (const variant_repository &, const std::string &mounting_name_)
 Set the parent repository. More...
 
void reset_parent_repository ()
 Reset the parent repository. More...
 
const variant_repositoryget_parent_repository () const
 Return the handle to the parent repository. More...
 
bool is_initialized () const
 Check initialization. More...
 
void initialize_from (const variant_registry_manager &mgr_, const std::string &top_variant_="", const std::string &name_="", const std::string &display_name_="", const std::string &terse_description_="")
 Initialize. More...
 
void reset ()
 Reset. More...
 
variant_recordadd_record (const std::string &record_path_)
 Add a new record. More...
 
bool has_variant_record (const std::string &record_path_) const
 Check if a variant record exists. More...
 
variant_recordgrab_variant_record (const std::string &record_path_)
 Return a reference to a mutable variant record. More...
 
bool parameter_exists (const std::string &variant_path_) const
 Check if a variant parameter exists (active or not) More...
 
bool variant_exists (const std::string &variant_path_) const
 Check if a variant exists (active or not) More...
 
bool is_active_variant (const std::string &variant_path_) const
 Check if a variant is active. More...
 
const variant_recordget_variant_record (const std::string &record_path_) const
 Return a reference to a non mutable variant record. More...
 
bool has_parameter_record (const std::string &record_path_) const
 Check if a parameter record exists. More...
 
bool has_parameter_record_value_group (const std::string &param_group_path_) const
 Check if a parameter record group exists. More...
 
variant_recordgrab_parameter_record (const std::string &record_path_)
 Return a reference to a mutable parameter record. More...
 
const variant_recordget_parameter_record (const std::string &record_path_) const
 Return a reference to a non mutable parameter record. More...
 
const variant_recordget_top_variant_record () const
 Return a reference to the non mutable top variant record. More...
 
bool has_dependency_model () const
 Check if a local dependency model is set. More...
 
const variant_dependency_modelget_dependency_model () const
 Return the local dependency model. More...
 
void load_local_dependency_model (const datatools::properties &ldm_config_)
 Load local dependency model. More...
 
virtual void tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &inden_="", bool inherit_=false) const
 Smart print. More...
 
void list_of_ranked_parameters (std::vector< std::string > &paths_) const
 Compute the ranked list of parameters. More...
 
void list_of_ranked_records (std::vector< std::string > &paths_, uint32_t flags_=0) const
 Compute the ranked list of records. More...
 
void list_of_parameters (std::vector< std::string > &_paths_, uint32_t flags_=0) const
 Compute the list of parameters. More...
 
void list_of_unset_parameters (std::vector< std::string > &unset_paths_) const
 Compute the list of unset parameters. More...
 
void build_recursive_list_of_ranked_records (const variant_record &record_, std::vector< std::string > &ranked_) const
 
bool is_accomplished () const
 Check if all parameters are set. More...
 
void update ()
 Update record status. More...
 
- Public Member Functions inherited from datatools::enriched_base
 enriched_base ()
 Default constructor. More...
 
 enriched_base (const std::string &name_, const std::string &display_name_="", const std::string &terse_description_="", logger::priority lp_=logger::PRIO_FATAL)
 Constructor. More...
 
virtual ~enriched_base ()
 Destructor. More...
 
bool has_name () const
 Check if the name is not empty. More...
 
void set_name (const std::string &name_)
 Set the name. More...
 
enriched_baseset_name_c (const std::string &name_)
 Set the name. More...
 
const std::string & get_name () const
 Return the name. More...
 
void reset_name ()
 Reset the name. More...
 
bool has_display_name () const
 Check if the display name is empty. More...
 
void set_display_name (const std::string &display_name_)
 Set the display name. More...
 
enriched_baseset_display_name_c (const std::string &display_name_)
 Set the display name. More...
 
const std::string & get_display_name () const
 Return the display name. More...
 
bool has_terse_description () const
 Check if the description is empty. More...
 
void set_terse_description (const std::string &terse_description_)
 Set the description. More...
 
enriched_baseset_terse_description_c (const std::string &terse_description_)
 Set the description. More...
 
const std::string & get_terse_description () const
 Return the description. More...
 
bool has_auxiliaries () const
 Check if the container of auxiliary properties is empty. More...
 
const datatools::propertiesget_auxiliaries () const
 Return a reference to the non mutable container of auxiliary properties. More...
 
datatools::propertiesgrab_auxiliaries ()
 Return a reference to the mutable container of auxiliary properties. More...
 
void reset_auxiliaries ()
 Remove all auxiliary properties. More...
 
bool is_debug () const
 Check the debug status. More...
 
void set_logging_priority (logger::priority lp_)
 Set the logging priority threshold. More...
 
enriched_baseset_logging_priority_c (logger::priority lp_)
 Set the logging priority threshold. More...
 
void set_logging (const std::string &label_)
 Set the logging priority threshold from a string. More...
 
logger::priority get_logging_priority () const
 Return the logging priority threshold. More...
 
void clear ()
 Clear. More...
 
void reset ()
 Clear. More...
 
void print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const override
 Smart print. More...
 
void tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const override
 Smart print. More...
 
void initialize (const datatools::properties &config_, bool clear_=false)
 Initialization from a container of properties. More...
 
void export_to_config (datatools::properties &config_, uint32_t flags_=EXPORT_CONFIG_DEFAULT, const std::string &prefix_="") const
 Export to a container of properties. More...
 
- Public Member Functions inherited from datatools::i_serializable
 i_serializable ()
 Default constructor. More...
 
virtual ~i_serializable ()
 Destructor. More...
 
virtual const std::string & get_serial_tag () const =0
 Return the serialization string identifier of the class. More...
 
- Public Member Functions inherited from datatools::i_tree_dumpable
 i_tree_dumpable ()
 Constructor. More...
 
virtual ~i_tree_dumpable ()
 Destructor. More...
 
void print_tree_json (std::ostream &out_=std::clog, const std::string &json_options_="") const
 Printing with jsonized options. More...
 
void print_tree_json (std::ostream &out_=std::clog, const char *json_options_=nullptr) const
 Printing with jsonized options. More...
 
void tree_dump_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="", const bool inherit_=false) const
 
void tree_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="") const
 
void smart_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="") const
 

Static Public Member Functions

static const std::string & default_top_variant_name ()
 Return the default root variant name. More...
 
- Static Public Member Functions inherited from datatools::enriched_base
static bool validate_name (const std::string &candidate_name_)
 Validate a name. More...
 
static logger::priority default_logging_priority ()
 Return the default logging priority threshold. More...
 
static void init_ocd (datatools::object_configuration_description &)
 OCD support. More...
 
- Static Public Member Functions inherited from datatools::i_tree_dumpable
static const boost::property_tree::ptree & empty_options ()
 
static boost::property_tree::ptree make_base_print_options (const std::string &title_, const std::string &indent_="", const bool inherit_=false)
 
static std::ostream & last_skip_tag (std::ostream &out_)
 
static std::ostream & skip_tag (std::ostream &out_)
 
static std::ostream & last_tag (std::ostream &out_)
 
static std::ostream & tag (std::ostream &out_)
 

Detailed Description

Registry of configuration variant parameters and associated variants.

Member Typedef Documentation

◆ record_dict_type

Type of dictionary of configuration variant records.

Member Enumeration Documentation

◆ list_flags

Flags for building the list of parameters.

Enumerator
LIST_ACTIVE_ONLY 
LIST_NO_SET 
LIST_NO_UNSET 
LIST_CLEAR 
LIST_NO_PARAMETERS 
LIST_NO_VARIANTS 
LIST_RANKED 

Constructor & Destructor Documentation

◆ variant_registry()

datatools::configuration::variant_registry::variant_registry ( )

Default constructor.

◆ ~variant_registry()

virtual datatools::configuration::variant_registry::~variant_registry ( )
virtual

Destructor.

Member Function Documentation

◆ add_record()

variant_record& datatools::configuration::variant_registry::add_record ( const std::string &  record_path_)

Add a new record.

◆ build_recursive_list_of_ranked_records()

void datatools::configuration::variant_registry::build_recursive_list_of_ranked_records ( const variant_record record_,
std::vector< std::string > &  ranked_ 
) const

Compute the recursive list of ranked records For variant records, the explicitely ranked daughter params are listed first, then come unranked params in arbitrary (alphabetical) order. For parameter records, daughter variant records are listed in native order.

◆ default_top_variant_name()

static const std::string& datatools::configuration::variant_registry::default_top_variant_name ( )
static

Return the default root variant name.

◆ get_dependency_model()

const variant_dependency_model& datatools::configuration::variant_registry::get_dependency_model ( ) const

Return the local dependency model.

◆ get_mounting_name()

const std::string& datatools::configuration::variant_registry::get_mounting_name ( ) const

Return the mounting name.

◆ get_parameter_record()

const variant_record& datatools::configuration::variant_registry::get_parameter_record ( const std::string &  record_path_) const

Return a reference to a non mutable parameter record.

◆ get_parent_repository()

const variant_repository& datatools::configuration::variant_registry::get_parent_repository ( ) const

Return the handle to the parent repository.

◆ get_records()

const record_dict_type& datatools::configuration::variant_registry::get_records ( ) const

Return a reference to the non-mutable dictionary of records.

◆ get_top_variant_name()

const std::string& datatools::configuration::variant_registry::get_top_variant_name ( ) const

Return the name of the top variant used to initialize the registry.

◆ get_top_variant_record()

const variant_record& datatools::configuration::variant_registry::get_top_variant_record ( ) const

Return a reference to the non mutable top variant record.

◆ get_variant_record()

const variant_record& datatools::configuration::variant_registry::get_variant_record ( const std::string &  record_path_) const

Return a reference to a non mutable variant record.

◆ grab_parameter_record()

variant_record& datatools::configuration::variant_registry::grab_parameter_record ( const std::string &  record_path_)

Return a reference to a mutable parameter record.

◆ grab_records()

record_dict_type& datatools::configuration::variant_registry::grab_records ( )

Return a reference to the mutable dictionary of records.

◆ grab_variant_record()

variant_record& datatools::configuration::variant_registry::grab_variant_record ( const std::string &  record_path_)

Return a reference to a mutable variant record.

◆ has_dependency_model()

bool datatools::configuration::variant_registry::has_dependency_model ( ) const

Check if a local dependency model is set.

◆ has_parameter_record()

bool datatools::configuration::variant_registry::has_parameter_record ( const std::string &  record_path_) const

Check if a parameter record exists.

◆ has_parameter_record_value_group()

bool datatools::configuration::variant_registry::has_parameter_record_value_group ( const std::string &  param_group_path_) const

Check if a parameter record group exists.

◆ has_parent_repository()

bool datatools::configuration::variant_registry::has_parent_repository ( ) const

Check the parent repository.

◆ has_top_variant_name()

bool datatools::configuration::variant_registry::has_top_variant_name ( ) const

Check if the top variant name is set.

◆ has_variant_record()

bool datatools::configuration::variant_registry::has_variant_record ( const std::string &  record_path_) const

Check if a variant record exists.

◆ initialize_from()

void datatools::configuration::variant_registry::initialize_from ( const variant_registry_manager mgr_,
const std::string &  top_variant_ = "",
const std::string &  name_ = "",
const std::string &  display_name_ = "",
const std::string &  terse_description_ = "" 
)

Initialize.

◆ is_accomplished()

bool datatools::configuration::variant_registry::is_accomplished ( ) const

Check if all parameters are set.

◆ is_active_variant()

bool datatools::configuration::variant_registry::is_active_variant ( const std::string &  variant_path_) const

Check if a variant is active.

◆ is_initialized()

bool datatools::configuration::variant_registry::is_initialized ( ) const

Check initialization.

◆ is_mounted()

bool datatools::configuration::variant_registry::is_mounted ( ) const

Check if the registry is mounted in some parent repository.

◆ is_name_valid()

virtual bool datatools::configuration::variant_registry::is_name_valid ( const std::string &  name_) const
virtual

Check if a name is valid.

Reimplemented from datatools::enriched_base.

◆ list_of_parameters()

void datatools::configuration::variant_registry::list_of_parameters ( std::vector< std::string > &  _paths_,
uint32_t  flags_ = 0 
) const

Compute the list of parameters.

◆ list_of_ranked_parameters()

void datatools::configuration::variant_registry::list_of_ranked_parameters ( std::vector< std::string > &  paths_) const

Compute the ranked list of parameters.

◆ list_of_ranked_records()

void datatools::configuration::variant_registry::list_of_ranked_records ( std::vector< std::string > &  paths_,
uint32_t  flags_ = 0 
) const

Compute the ranked list of records.

◆ list_of_unset_parameters()

void datatools::configuration::variant_registry::list_of_unset_parameters ( std::vector< std::string > &  unset_paths_) const

Compute the list of unset parameters.

◆ load_local_dependency_model()

void datatools::configuration::variant_registry::load_local_dependency_model ( const datatools::properties ldm_config_)

Load local dependency model.

◆ parameter_exists()

bool datatools::configuration::variant_registry::parameter_exists ( const std::string &  variant_path_) const

Check if a variant parameter exists (active or not)

◆ reset()

void datatools::configuration::variant_registry::reset ( )

Reset.

◆ reset_parent_repository()

void datatools::configuration::variant_registry::reset_parent_repository ( )

Reset the parent repository.

◆ set_parent_repository()

void datatools::configuration::variant_registry::set_parent_repository ( const variant_repository ,
const std::string &  mounting_name_ 
)

Set the parent repository.

◆ tree_dump()

virtual void datatools::configuration::variant_registry::tree_dump ( std::ostream &  out_ = std::clog,
const std::string &  title_ = "",
const std::string &  inden_ = "",
bool  inherit_ = false 
) const
virtual

Smart print.

Reimplemented from datatools::i_tree_dumpable.

◆ update()

void datatools::configuration::variant_registry::update ( )

Update record status.

◆ variant_exists()

bool datatools::configuration::variant_registry::variant_exists ( const std::string &  variant_path_) const

Check if a variant exists (active or not)


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