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

The datatools kernel singleton with embedded resources and components. More...

#include <bayeux/datatools/kernel.h>

Inheritance diagram for datatools::kernel:
datatools::i_tree_dumpable

Classes

struct  param_type
 The set of configuration parameters for the datatools kernel. More...
 

Public Types

enum  init_flags {
  init_no_help = datatools::init_no_help, init_no_splash = datatools::init_no_splash, init_no_locale_category = datatools::init_no_locale_category, init_no_logging = datatools::init_no_logging,
  init_no_inhibit_libquery = datatools::init_no_inhibit_libquery, init_no_libquery_logging = datatools::init_no_libquery_logging, init_no_inhibit_libinfo = datatools::init_no_inhibit_libinfo, init_no_libinfo_logging = datatools::init_no_libinfo_logging,
  init_no_resource_path = datatools::init_no_resource_path, init_no_inhibit_variant = datatools::init_no_inhibit_variant, init_no_variant = datatools::init_no_variant, init_no_inhibit_qt_gui = datatools::init_no_inhibit_qt_gui,
  init_no_inhibit_urnquery = datatools::init_no_inhibit_urnquery, init_reserved_11 = datatools::init_reserved_11, init_reserved_12 = datatools::init_reserved_12, init_reserved_13 = datatools::init_reserved_13,
  init_reserved_14 = datatools::init_reserved_14
}
 Kernel initialization flags (15 bits) 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

 kernel ()
 Default constructor. More...
 
 kernel (int argc_, char *argv_[], uint32_t flags=0)
 Constructor with on-the-fly initialization. More...
 
virtual ~kernel ()
 Destruction with on-the-fly shutdown if needed. More...
 
void initialize (int argc_, char *argv_[], uint32_t flags_=0)
 Initialization from command line arguments. More...
 
void shutdown ()
 Shutdown. More...
 
bool is_initialized () const
 Check initialization status. More...
 
datatools::logger::priority get_logging () const
 Return the logging priority threshold. More...
 
void set_logging (datatools::logger::priority)
 Set the logging priority threshold. More...
 
bool has_services () const
 Check if the system services are available. More...
 
bool has_urn_query () const
 Check if the system URN query service is available. More...
 
urn_query_servicegrab_urn_query ()
 Return a mutable reference to the system URN query service. More...
 
const urn_query_serviceget_urn_query () const
 Return a non mutable reference to the system URN query service. More...
 
bool has_library_query () const
 Check if the system library query service is available. More...
 
library_query_servicegrab_library_query ()
 Return a mutable reference to the system library query service. More...
 
const library_query_serviceget_library_query () const
 Return a non mutable reference to the system library query service. More...
 
bool has_library_info_register () const
 Check if the library/component info register is available. More...
 
library_infograb_library_info_register ()
 Return a mutable reference to the library/component info register. More...
 
const library_infoget_library_info_register () const
 Return a non mutable reference to the library/component info register. More...
 
bool has_variant_repository () const
 Check if the configuration variant repository is available. More...
 
const configuration::variant_repositoryget_variant_repository () const
 Return a non mutable reference to the configuration variant repository. More...
 
configuration::variant_repositorygrab_variant_repository ()
 Return a mutable reference to the configuration variant repository. More...
 
bool has_variant_service () const
 Check if a configuration variant service is available. More...
 
const configuration::variant_serviceget_variant_service () const
 Return a non mutable reference to the configuration variant service. More...
 
configuration::variant_servicegrab_variant_service ()
 Return a mutable reference to the configuration variant service. More...
 
void set_variant_service (configuration::variant_service &var_serv_)
 Set a variant service. More...
 
void reset_variant_service ()
 Reset variant service. More...
 
bool has_effective_variant_repository () const
 Check if the effective configuration variant repository is available. More...
 
const configuration::variant_repositoryget_effective_variant_repository () const
 Return a non mutable reference to the effective configuration variant repository. More...
 
configuration::variant_repositorygrab_effective_variant_repository ()
 Return a mutable reference to the effective configuration variant repository. More...
 
bool has_locale_category () const
 Check if a specific locale_category is defined. More...
 
void set_locale_category (const std::string &lc_)
 Set the locale category. More...
 
const std::string & get_locale_category () const
 Return the locale category. More...
 
const std::string & get_application_name () const
 Return the name of the current application. More...
 
bool has_application_name () const
 Check if the name of the current application is defined. More...
 
unsigned int get_nargs () const
 Return the command line argument count. More...
 
const std::vector< std::string > & get_args () const
 Return the list of command line arguments. More...
 
int get_argc () const
 Return the command line argument count. More...
 
char ** get_argv () const
 Return the command line arguments. More...
 
char * get_argv (int i_) const
 Return the command line argument by index. More...
 
bool is_library_info_register_activated () const
 
bool is_library_query_service_activated () const
 Check if the library query service is activated. More...
 
bool is_urn_query_service_activated () const
 Check if the URN query service is activated. More...
 
bool is_variant_repository_activated () const
 Check if the variant repository is activated. More...
 
bool is_variant_service_allowed () const
 Check if the variant service is allowed. More...
 
void tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
 Smart print. More...
 
void register_resource_paths ()
 Registration of resource paths. More...
 
void register_configuration_variant_registries ()
 Registration of configuration variant registries. More...
 
void import_configuration_registry (configuration::variant_repository &rep_, const std::string &registry_name_="")
 Import some (or all) configuration variant registry from a repository. More...
 
bool has_configuration_registries () const
 Check if the kernel has configuration variant registries. More...
 
bool has_external_configuration_registry (const std::string &registry_name_) const
 Check for an external registry given its name. More...
 
void clear_configuration_registry (const std::string &registry_name_)
 Remove a imported registry given its name. More...
 
void import_configuration_repository (configuration::variant_repository &rep_)
 Import a configuration variant repository. More...
 
void clear_configuration_repository ()
 Clear the configuration variant repository. More...
 
void clear_imported_configuration_repository ()
 Clear all imported registries from the configuration variant repository. More...
 
- 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
 

Static Public Member Functions

static bool is_instantiated ()
 Check if the kernel singleton is available. More...
 
static kernelinstance ()
 Return a mutable reference to the kernel singleton. More...
 
static kernelinstantiate ()
 Instantiate and return a mutable reference to the kernel singleton. More...
 
static const kernelconst_instance ()
 Return a non mutable reference to the kernel singleton. More...
 
static void build_opt_desc (boost::program_options::options_description &, param_type &, uint32_t flags_=0)
 Build description of options. More...
 
static void print_splash (std::ostream &=std::clog)
 Print splash screen. More...
 
static void print_opt_desc (const boost::program_options::options_description &, std::ostream &=std::clog, const std::string &indent_="")
 Print description of options. 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_)
 

Static Public Attributes

static const uint32_t init_mask = datatools::bit_mask::nbits15
 Bit mask for the kernel initialization flags. More...
 

Detailed Description

The datatools kernel singleton with embedded resources and components.

Member Enumeration Documentation

◆ init_flags

Kernel initialization flags (15 bits)

Enumerator
init_no_help 
init_no_splash 
init_no_locale_category 
init_no_logging 
init_no_inhibit_libquery 
init_no_libquery_logging 
init_no_inhibit_libinfo 

Deprecated.

init_no_libinfo_logging 

Deprecated.

init_no_resource_path 
init_no_inhibit_variant 
init_no_variant 
init_no_inhibit_qt_gui 
init_no_inhibit_urnquery 
init_reserved_11 
init_reserved_12 
init_reserved_13 
init_reserved_14 

Constructor & Destructor Documentation

◆ kernel() [1/2]

datatools::kernel::kernel ( )

Default constructor.

◆ kernel() [2/2]

datatools::kernel::kernel ( int  argc_,
char *  argv_[],
uint32_t  flags = 0 
)

Constructor with on-the-fly initialization.

◆ ~kernel()

virtual datatools::kernel::~kernel ( )
virtual

Destruction with on-the-fly shutdown if needed.

Member Function Documentation

◆ build_opt_desc()

static void datatools::kernel::build_opt_desc ( boost::program_options::options_description &  ,
param_type ,
uint32_t  flags_ = 0 
)
static

Build description of options.

◆ clear_configuration_registry()

void datatools::kernel::clear_configuration_registry ( const std::string &  registry_name_)

Remove a imported registry given its name.

◆ clear_configuration_repository()

void datatools::kernel::clear_configuration_repository ( )

Clear the configuration variant repository.

◆ clear_imported_configuration_repository()

void datatools::kernel::clear_imported_configuration_repository ( )

Clear all imported registries from the configuration variant repository.

◆ const_instance()

static const kernel& datatools::kernel::const_instance ( )
static

Return a non mutable reference to the kernel singleton.

◆ get_application_name()

const std::string& datatools::kernel::get_application_name ( ) const

Return the name of the current application.

◆ get_argc()

int datatools::kernel::get_argc ( ) const

Return the command line argument count.

◆ get_args()

const std::vector<std::string>& datatools::kernel::get_args ( ) const

Return the list of command line arguments.

◆ get_argv() [1/2]

char** datatools::kernel::get_argv ( ) const

Return the command line arguments.

◆ get_argv() [2/2]

char* datatools::kernel::get_argv ( int  i_) const

Return the command line argument by index.

◆ get_effective_variant_repository()

const configuration::variant_repository& datatools::kernel::get_effective_variant_repository ( ) const

Return a non mutable reference to the effective configuration variant repository.

◆ get_library_info_register()

const library_info& datatools::kernel::get_library_info_register ( ) const

Return a non mutable reference to the library/component info register.

◆ get_library_query()

const library_query_service& datatools::kernel::get_library_query ( ) const

Return a non mutable reference to the system library query service.

◆ get_locale_category()

const std::string& datatools::kernel::get_locale_category ( ) const

Return the locale category.

◆ get_logging()

datatools::logger::priority datatools::kernel::get_logging ( ) const

Return the logging priority threshold.

◆ get_nargs()

unsigned int datatools::kernel::get_nargs ( ) const

Return the command line argument count.

◆ get_urn_query()

const urn_query_service& datatools::kernel::get_urn_query ( ) const

Return a non mutable reference to the system URN query service.

◆ get_variant_repository()

const configuration::variant_repository& datatools::kernel::get_variant_repository ( ) const

Return a non mutable reference to the configuration variant repository.

◆ get_variant_service()

const configuration::variant_service& datatools::kernel::get_variant_service ( ) const

Return a non mutable reference to the configuration variant service.

◆ grab_effective_variant_repository()

configuration::variant_repository& datatools::kernel::grab_effective_variant_repository ( )

Return a mutable reference to the effective configuration variant repository.

◆ grab_library_info_register()

library_info& datatools::kernel::grab_library_info_register ( )

Return a mutable reference to the library/component info register.

◆ grab_library_query()

library_query_service& datatools::kernel::grab_library_query ( )

Return a mutable reference to the system library query service.

◆ grab_urn_query()

urn_query_service& datatools::kernel::grab_urn_query ( )

Return a mutable reference to the system URN query service.

◆ grab_variant_repository()

configuration::variant_repository& datatools::kernel::grab_variant_repository ( )

Return a mutable reference to the configuration variant repository.

◆ grab_variant_service()

configuration::variant_service& datatools::kernel::grab_variant_service ( )

Return a mutable reference to the configuration variant service.

◆ has_application_name()

bool datatools::kernel::has_application_name ( ) const

Check if the name of the current application is defined.

◆ has_configuration_registries()

bool datatools::kernel::has_configuration_registries ( ) const

Check if the kernel has configuration variant registries.

◆ has_effective_variant_repository()

bool datatools::kernel::has_effective_variant_repository ( ) const

Check if the effective configuration variant repository is available.

◆ has_external_configuration_registry()

bool datatools::kernel::has_external_configuration_registry ( const std::string &  registry_name_) const

Check for an external registry given its name.

◆ has_library_info_register()

bool datatools::kernel::has_library_info_register ( ) const

Check if the library/component info register is available.

◆ has_library_query()

bool datatools::kernel::has_library_query ( ) const

Check if the system library query service is available.

◆ has_locale_category()

bool datatools::kernel::has_locale_category ( ) const

Check if a specific locale_category is defined.

◆ has_services()

bool datatools::kernel::has_services ( ) const

Check if the system services are available.

◆ has_urn_query()

bool datatools::kernel::has_urn_query ( ) const

Check if the system URN query service is available.

◆ has_variant_repository()

bool datatools::kernel::has_variant_repository ( ) const

Check if the configuration variant repository is available.

◆ has_variant_service()

bool datatools::kernel::has_variant_service ( ) const

Check if a configuration variant service is available.

◆ import_configuration_registry()

void datatools::kernel::import_configuration_registry ( configuration::variant_repository rep_,
const std::string &  registry_name_ = "" 
)

Import some (or all) configuration variant registry from a repository.

◆ import_configuration_repository()

void datatools::kernel::import_configuration_repository ( configuration::variant_repository rep_)

Import a configuration variant repository.

◆ initialize()

void datatools::kernel::initialize ( int  argc_,
char *  argv_[],
uint32_t  flags_ = 0 
)

Initialization from command line arguments.

◆ instance()

static kernel& datatools::kernel::instance ( )
static

Return a mutable reference to the kernel singleton.

◆ instantiate()

static kernel& datatools::kernel::instantiate ( )
static

Instantiate and return a mutable reference to the kernel singleton.

◆ is_initialized()

bool datatools::kernel::is_initialized ( ) const

Check initialization status.

◆ is_instantiated()

static bool datatools::kernel::is_instantiated ( )
static

Check if the kernel singleton is available.

◆ is_library_info_register_activated()

bool datatools::kernel::is_library_info_register_activated ( ) const

Check if the library info register is activated

Deprecated:

◆ is_library_query_service_activated()

bool datatools::kernel::is_library_query_service_activated ( ) const

Check if the library query service is activated.

◆ is_urn_query_service_activated()

bool datatools::kernel::is_urn_query_service_activated ( ) const

Check if the URN query service is activated.

◆ is_variant_repository_activated()

bool datatools::kernel::is_variant_repository_activated ( ) const

Check if the variant repository is activated.

◆ is_variant_service_allowed()

bool datatools::kernel::is_variant_service_allowed ( ) const

Check if the variant service is allowed.

◆ print_opt_desc()

static void datatools::kernel::print_opt_desc ( const boost::program_options::options_description &  ,
std::ostream &  = std::clog,
const std::string &  indent_ = "" 
)
static

Print description of options.

◆ print_splash()

static void datatools::kernel::print_splash ( std::ostream &  = std::clog)
static

Print splash screen.

◆ register_configuration_variant_registries()

void datatools::kernel::register_configuration_variant_registries ( )

Registration of configuration variant registries.

◆ register_resource_paths()

void datatools::kernel::register_resource_paths ( )

Registration of resource paths.

◆ reset_variant_service()

void datatools::kernel::reset_variant_service ( )

Reset variant service.

◆ set_locale_category()

void datatools::kernel::set_locale_category ( const std::string &  lc_)

Set the locale category.

◆ set_logging()

void datatools::kernel::set_logging ( datatools::logger::priority  )

Set the logging priority threshold.

◆ set_variant_service()

void datatools::kernel::set_variant_service ( configuration::variant_service var_serv_)

Set a variant service.

◆ shutdown()

void datatools::kernel::shutdown ( )

Shutdown.

◆ tree_dump()

void datatools::kernel::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.

Member Data Documentation

◆ init_mask

const uint32_t datatools::kernel::init_mask = datatools::bit_mask::nbits15
static

Bit mask for the kernel initialization flags.


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