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

Model of a configuration variant. More...

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

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

Classes

struct  parameter_record
 Parameter record. More...
 

Public Types

enum  rst_flags { PRINT_RST_NO_TITLE = datatools::bit_mask::bit00 }
 ReST formating flags. More...
 
typedef std::map< std::string, parameter_recordparameter_dict_type
 Dictionary of parameter physicals. 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_model ()
 Default constructor. More...
 
virtual ~variant_model ()
 Destructor. More...
 
bool has_documentation () const
 Check if the documentation is empty. More...
 
void set_documentation (const std::string &documentation_)
 Set the documentation. More...
 
const std::string & get_documentation () const
 Return the documentation. More...
 
bool has_parameter (const std::string &name_) const
 Check if a parameter exists. More...
 
void add_parameter (const std::string &parameter_name_, const pm_handle_type &parameter_model_handle_, const std::string &description_="", const std::string &occurence_def_="", int rank_=-1)
 Add a new parameter. More...
 
void remove_parameter (const std::string &parameter_name_)
 Remove parameter. More...
 
bool is_rank_used (int rank_) const
 Check if a rank is already used. More...
 
bool is_ranked_parameter (const std::string &parameter_name_) const
 Check ranked parameter. More...
 
int get_parameter_rank (const std::string &parameter_name_) const
 Return the rank of a parameter. More...
 
void set_parameter_rank (const std::string &parameter_name_, int rank_)
 Set the rank of a parameter. More...
 
void build_list_of_ranked_parameters (std::vector< std::string > &) const
 Build list of ranked parameters. More...
 
const std::string & get_parameter_description (const std::string &parameter_name_) const
 Return a description string associated to a given parameter. More...
 
const parameter_modelget_parameter_model (const std::string &parameter_name_) const
 Return a const reference to a parameter. More...
 
pm_handle_type get_parameter_model_handle (const std::string &parameter_name_) const
 Return a parameter model handle associated to a given parameter. More...
 
bool has_parameter_occurrence (const std::string &parameter_name_) const
 Check is an occurrence is associated to a given parameter. More...
 
const i_occurrenceget_parameter_occurrence (const std::string &parameter_name_) const
 Return a const reference to the occurrence associated to a given parameter. More...
 
virtual void tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
 Smart print. More...
 
void print_rst (std::ostream &out_, const std::string &indent_="", uint32_t flags_=0) const
 Print in ReST format. More...
 
bool is_initialized () const
 Check initialization status. More...
 
void initialize (const properties &config_, model_item_dict_type &items_)
 Initialization from properties and a dictionary of configuration items. More...
 
void initialize_standalone (const properties &config_)
 Initialization from properties only. More...
 
void initialize_simple ()
 Bare initialization. More...
 
void reset ()
 Reset. More...
 
const parameter_dict_typeget_parameters () const
 Return the dictionary of children parameters. 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 void init_ocd (datatools::object_configuration_description &)
 OCD support. 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_)
 

Protected Member Functions

void _set_default ()
 Set default values. More...
 

Detailed Description

Model of a configuration variant.

Member Typedef Documentation

◆ parameter_dict_type

Dictionary of parameter physicals.

Member Enumeration Documentation

◆ rst_flags

ReST formating flags.

Enumerator
PRINT_RST_NO_TITLE 

Constructor & Destructor Documentation

◆ variant_model()

datatools::configuration::variant_model::variant_model ( )

Default constructor.

◆ ~variant_model()

virtual datatools::configuration::variant_model::~variant_model ( )
virtual

Destructor.

Member Function Documentation

◆ _set_default()

void datatools::configuration::variant_model::_set_default ( )
protected

Set default values.

◆ add_parameter()

void datatools::configuration::variant_model::add_parameter ( const std::string &  parameter_name_,
const pm_handle_type parameter_model_handle_,
const std::string &  description_ = "",
const std::string &  occurence_def_ = "",
int  rank_ = -1 
)

Add a new parameter.

◆ build_list_of_ranked_parameters()

void datatools::configuration::variant_model::build_list_of_ranked_parameters ( std::vector< std::string > &  ) const

Build list of ranked parameters.

◆ get_documentation()

const std::string& datatools::configuration::variant_model::get_documentation ( ) const

Return the documentation.

◆ get_parameter_description()

const std::string& datatools::configuration::variant_model::get_parameter_description ( const std::string &  parameter_name_) const

Return a description string associated to a given parameter.

◆ get_parameter_model()

const parameter_model& datatools::configuration::variant_model::get_parameter_model ( const std::string &  parameter_name_) const

Return a const reference to a parameter.

◆ get_parameter_model_handle()

pm_handle_type datatools::configuration::variant_model::get_parameter_model_handle ( const std::string &  parameter_name_) const

Return a parameter model handle associated to a given parameter.

◆ get_parameter_occurrence()

const i_occurrence& datatools::configuration::variant_model::get_parameter_occurrence ( const std::string &  parameter_name_) const

Return a const reference to the occurrence associated to a given parameter.

◆ get_parameter_rank()

int datatools::configuration::variant_model::get_parameter_rank ( const std::string &  parameter_name_) const

Return the rank of a parameter.

◆ get_parameters()

const parameter_dict_type& datatools::configuration::variant_model::get_parameters ( ) const

Return the dictionary of children parameters.

◆ has_documentation()

bool datatools::configuration::variant_model::has_documentation ( ) const

Check if the documentation is empty.

◆ has_parameter()

bool datatools::configuration::variant_model::has_parameter ( const std::string &  name_) const

Check if a parameter exists.

◆ has_parameter_occurrence()

bool datatools::configuration::variant_model::has_parameter_occurrence ( const std::string &  parameter_name_) const

Check is an occurrence is associated to a given parameter.

◆ init_ocd()

static void datatools::configuration::variant_model::init_ocd ( datatools::object_configuration_description )
static

OCD support.

◆ initialize()

void datatools::configuration::variant_model::initialize ( const properties config_,
model_item_dict_type items_ 
)

Initialization from properties and a dictionary of configuration items.

◆ initialize_simple()

void datatools::configuration::variant_model::initialize_simple ( )

Bare initialization.

◆ initialize_standalone()

void datatools::configuration::variant_model::initialize_standalone ( const properties config_)

Initialization from properties only.

◆ is_initialized()

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

Check initialization status.

◆ is_name_valid()

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

Check if a name is valid.

Reimplemented from datatools::enriched_base.

◆ is_rank_used()

bool datatools::configuration::variant_model::is_rank_used ( int  rank_) const

Check if a rank is already used.

◆ is_ranked_parameter()

bool datatools::configuration::variant_model::is_ranked_parameter ( const std::string &  parameter_name_) const

Check ranked parameter.

◆ print_rst()

void datatools::configuration::variant_model::print_rst ( std::ostream &  out_,
const std::string &  indent_ = "",
uint32_t  flags_ = 0 
) const

Print in ReST format.

◆ remove_parameter()

void datatools::configuration::variant_model::remove_parameter ( const std::string &  parameter_name_)

Remove parameter.

◆ reset()

void datatools::configuration::variant_model::reset ( )

Reset.

◆ set_documentation()

void datatools::configuration::variant_model::set_documentation ( const std::string &  documentation_)

Set the documentation.

◆ set_parameter_rank()

void datatools::configuration::variant_model::set_parameter_rank ( const std::string &  parameter_name_,
int  rank_ 
)

Set the rank of a parameter.

◆ tree_dump()

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

Smart print.

Reimplemented from datatools::i_tree_dumpable.


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