Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Types | Public Member Functions | Protected Member Functions | List of all members
genbb::manager Class Reference

GENBB particle manager management class. More...

#include <bayeux/genbb_help/manager.h>

Inheritance diagram for genbb::manager:
datatools::i_tree_dumpable

Public Types

enum  flag_type { BLANK = 0, NO_PRELOAD = datatools::bit_mask::bit00, FORCE_INITIALIZATION_AT_LOAD = datatools::bit_mask::bit01 }
 
- 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

bool has_service_manager () const
 
void set_service_manager (datatools::service_manager &service_mgr_)
 
void reset_service ()
 
 manager (datatools::logger::priority p_=datatools::logger::PRIO_WARNING, int flags_=0)
 Constructor. More...
 
 ~manager ()
 Destructor. More...
 
bool is_debug () const
 Check the debug flag. More...
 
void set_debug (bool debug_=true)
 Set the debug flag. More...
 
bool has_external_prng () const
 Check the use of some external PRNG. More...
 
void set_external_prng (mygsl::rng &)
 Set the external PRNG. More...
 
void reset_external_prng ()
 Reset the external PRNG. More...
 
mygsl::rnggrab_external_prng ()
 Return a mutable reference to the external PRNG. More...
 
const mygsl::rngget_external_prng () const
 Return a non-mutable reference to the external PRNG. More...
 
mygsl::rnggrab_embedded_prng ()
 Return a mutable reference to the embedded PRNG. More...
 
const mygsl::rngget_embedded_prng () const
 Return a non-mutable reference to the embedded PRNG. More...
 
void set_embedded_prng_seed (int seed_)
 Set the seed of the embedded PRNG. More...
 
mygsl::rnggrab_prng ()
 Return a mutable reference to the active PRNG. More...
 
const mygsl::rngget_prng () const
 Return a non-mutable reference to the active PRNG. More...
 
bool has_default_generator () const
 Check is a default generator is set. More...
 
void set_default_generator (const std::string &)
 Set the default generator name. More...
 
const std::string & get_default_generator () const
 Return the default generator name. More...
 
bool is_initialized () const
 Check the initialization flag. More...
 
void initialize (const datatools::properties &config_)
 Initialize the manager from a container of properties. More...
 
void reset ()
 Reset the manager. More...
 
bool has_pg_type (const std::string &id_) const
 Check if the factory has a given type. More...
 
template<class PgClass >
void register_pg_type (const std::string &id_)
 Register a given type in the factory. More...
 
void unregister_pg_type (const std::string &id_)
 Unregister a given type from the factory. More...
 
bool has (const std::string &name_) const
 
bool is_initialized (const std::string &name_) const
 
bool can_drop (const std::string &name_) const
 
void drop (const std::string &name_)
 
void reset (const std::string &name_)
 
const std::string & get_id (const std::string &name_) const
 
const i_genbbget (const std::string &name_) const
 
i_genbbgrab (const std::string &name_)
 
void load (const std::string &name_, const std::string &id_, const datatools::properties &config_)
 
void load (const datatools::multi_properties &config_)
 
void dump_particle_generators (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="") const
 
void print_particle_generators (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", const std::string &mode_="") const
 
virtual void tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
 Smart print. More...
 
const datatools::factory_register< i_genbb > & get_factory_register () const
 
datatools::factory_register< i_genbb > & grab_factory_register ()
 
datatools::logger::priority get_logging_priority () const
 
void set_logging_priority (datatools::logger::priority p_)
 
- Public Member Functions inherited from datatools::i_tree_dumpable
 i_tree_dumpable ()
 Constructor. More...
 
virtual ~i_tree_dumpable ()
 Destructor. More...
 
virtual void print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const
 Main new interface method for printing. 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
 

Protected Member Functions

void _load_pg (const std::string &name_, const std::string &id_, const datatools::properties &config_)
 
void _preload_global_dict ()
 
void _create_pg (detail::pg_entry_type &entry_)
 
void _initialize_pg (detail::pg_entry_type &entry_)
 
void _reset_pg (detail::pg_entry_type &entry_)
 

Additional Inherited Members

- 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

GENBB particle manager management class.

Member Enumeration Documentation

◆ flag_type

Enumerator
BLANK 
NO_PRELOAD 
FORCE_INITIALIZATION_AT_LOAD 

Constructor & Destructor Documentation

◆ manager()

genbb::manager::manager ( datatools::logger::priority  p_ = datatools::logger::PRIO_WARNING,
int  flags_ = 0 
)

Constructor.

◆ ~manager()

genbb::manager::~manager ( )

Destructor.

Member Function Documentation

◆ _create_pg()

void genbb::manager::_create_pg ( detail::pg_entry_type entry_)
protected

◆ _initialize_pg()

void genbb::manager::_initialize_pg ( detail::pg_entry_type entry_)
protected

◆ _load_pg()

void genbb::manager::_load_pg ( const std::string &  name_,
const std::string &  id_,
const datatools::properties config_ 
)
protected

◆ _preload_global_dict()

void genbb::manager::_preload_global_dict ( )
protected

◆ _reset_pg()

void genbb::manager::_reset_pg ( detail::pg_entry_type entry_)
protected

◆ can_drop()

bool genbb::manager::can_drop ( const std::string &  name_) const

Check if a given PG can be removed

Parameters
name_The name of the PG to be completely removed

◆ drop()

void genbb::manager::drop ( const std::string &  name_)
Parameters
name_The name of the PG to be completely removed

◆ dump_particle_generators()

void genbb::manager::dump_particle_generators ( std::ostream &  out_ = std::clog,
const std::string &  title_ = "",
const std::string &  indent_ = "" 
) const

◆ get()

const i_genbb& genbb::manager::get ( const std::string &  name_) const
Parameters
name_The name of the PG to be returned
Returns
a non-mutable reference to the PG

◆ get_default_generator()

const std::string& genbb::manager::get_default_generator ( ) const

Return the default generator name.

◆ get_embedded_prng()

const mygsl::rng& genbb::manager::get_embedded_prng ( ) const

Return a non-mutable reference to the embedded PRNG.

◆ get_external_prng()

const mygsl::rng& genbb::manager::get_external_prng ( ) const

Return a non-mutable reference to the external PRNG.

◆ get_factory_register()

const datatools::factory_register<i_genbb>& genbb::manager::get_factory_register ( ) const

◆ get_id()

const std::string& genbb::manager::get_id ( const std::string &  name_) const
Parameters
name_The name of the PG to be reset
Returns
the registration ID of the PG

◆ get_logging_priority()

datatools::logger::priority genbb::manager::get_logging_priority ( ) const

◆ get_prng()

const mygsl::rng& genbb::manager::get_prng ( ) const

Return a non-mutable reference to the active PRNG.

◆ grab()

i_genbb& genbb::manager::grab ( const std::string &  name_)
Parameters
name_The name of the PG to be returned
Returns
a mutable reference to the PG

◆ grab_embedded_prng()

mygsl::rng& genbb::manager::grab_embedded_prng ( )

Return a mutable reference to the embedded PRNG.

◆ grab_external_prng()

mygsl::rng& genbb::manager::grab_external_prng ( )

Return a mutable reference to the external PRNG.

◆ grab_factory_register()

datatools::factory_register<i_genbb>& genbb::manager::grab_factory_register ( )

◆ grab_prng()

mygsl::rng& genbb::manager::grab_prng ( )

Return a mutable reference to the active PRNG.

◆ has()

bool genbb::manager::has ( const std::string &  name_) const
Parameters
name_The name of the PG to be checked
Returns
true if the manager hosts the PG requested by name

◆ has_default_generator()

bool genbb::manager::has_default_generator ( ) const

Check is a default generator is set.

◆ has_external_prng()

bool genbb::manager::has_external_prng ( ) const

Check the use of some external PRNG.

◆ has_pg_type()

bool genbb::manager::has_pg_type ( const std::string &  id_) const

Check if the factory has a given type.

◆ has_service_manager()

bool genbb::manager::has_service_manager ( ) const

◆ initialize()

void genbb::manager::initialize ( const datatools::properties config_)

Initialize the manager from a container of properties.

◆ is_debug()

bool genbb::manager::is_debug ( ) const

Check the debug flag.

◆ is_initialized() [1/2]

bool genbb::manager::is_initialized ( ) const

Check the initialization flag.

◆ is_initialized() [2/2]

bool genbb::manager::is_initialized ( const std::string &  name_) const
Parameters
name_The name of the PG to be checked
Returns
true if the PG is initialized

◆ load() [1/2]

void genbb::manager::load ( const std::string &  name_,
const std::string &  id_,
const datatools::properties config_ 
)

◆ load() [2/2]

void genbb::manager::load ( const datatools::multi_properties config_)

◆ print_particle_generators()

void genbb::manager::print_particle_generators ( std::ostream &  out_ = std::clog,
const std::string &  title_ = "",
const std::string &  indent_ = "",
const std::string &  mode_ = "" 
) const

◆ register_pg_type()

template<class PgClass >
void genbb::manager::register_pg_type ( const std::string &  id_)

Register a given type in the factory.

◆ reset() [1/2]

void genbb::manager::reset ( )

Reset the manager.

◆ reset() [2/2]

void genbb::manager::reset ( const std::string &  name_)
Parameters
name_The name of the PG to be reset

◆ reset_external_prng()

void genbb::manager::reset_external_prng ( )

Reset the external PRNG.

◆ reset_service()

void genbb::manager::reset_service ( )

◆ set_debug()

void genbb::manager::set_debug ( bool  debug_ = true)

Set the debug flag.

◆ set_default_generator()

void genbb::manager::set_default_generator ( const std::string &  )

Set the default generator name.

◆ set_embedded_prng_seed()

void genbb::manager::set_embedded_prng_seed ( int  seed_)

Set the seed of the embedded PRNG.

◆ set_external_prng()

void genbb::manager::set_external_prng ( mygsl::rng )

Set the external PRNG.

◆ set_logging_priority()

void genbb::manager::set_logging_priority ( datatools::logger::priority  p_)

◆ set_service_manager()

void genbb::manager::set_service_manager ( datatools::service_manager service_mgr_)

◆ tree_dump()

virtual void genbb::manager::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.

◆ unregister_pg_type()

void genbb::manager::unregister_pg_type ( const std::string &  id_)

Unregister a given type from the factory.


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