Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
The datatools kernel singleton with embedded resources and components. More...
#include <bayeux/datatools/kernel.h>
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_service & | grab_urn_query () |
Return a mutable reference to the system URN query service. More... | |
const urn_query_service & | get_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_service & | grab_library_query () |
Return a mutable reference to the system library query service. More... | |
const library_query_service & | get_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_info & | grab_library_info_register () |
Return a mutable reference to the library/component info register. More... | |
const library_info & | get_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_repository & | get_variant_repository () const |
Return a non mutable reference to the configuration variant repository. More... | |
configuration::variant_repository & | grab_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_service & | get_variant_service () const |
Return a non mutable reference to the configuration variant service. More... | |
configuration::variant_service & | grab_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_repository & | get_effective_variant_repository () const |
Return a non mutable reference to the effective configuration variant repository. More... | |
configuration::variant_repository & | grab_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 ®istry_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 ®istry_name_) const |
Check for an external registry given its name. More... | |
void | clear_configuration_registry (const std::string ®istry_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 kernel & | instance () |
Return a mutable reference to the kernel singleton. More... | |
static kernel & | instantiate () |
Instantiate and return a mutable reference to the kernel singleton. More... | |
static const kernel & | const_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... | |
The datatools kernel singleton with embedded resources and components.
Kernel initialization flags (15 bits)
datatools::kernel::kernel | ( | ) |
Default constructor.
datatools::kernel::kernel | ( | int | argc_, |
char * | argv_[], | ||
uint32_t | flags = 0 |
||
) |
Constructor with on-the-fly initialization.
|
virtual |
Destruction with on-the-fly shutdown if needed.
|
static |
Build description of options.
void datatools::kernel::clear_configuration_registry | ( | const std::string & | registry_name_ | ) |
Remove a imported registry given its name.
void datatools::kernel::clear_configuration_repository | ( | ) |
Clear the configuration variant repository.
void datatools::kernel::clear_imported_configuration_repository | ( | ) |
Clear all imported registries from the configuration variant repository.
Return a non mutable reference to the kernel singleton.
const std::string& datatools::kernel::get_application_name | ( | ) | const |
Return the name of the current application.
int datatools::kernel::get_argc | ( | ) | const |
Return the command line argument count.
const std::vector<std::string>& datatools::kernel::get_args | ( | ) | const |
Return the list of command line arguments.
char** datatools::kernel::get_argv | ( | ) | const |
Return the command line arguments.
char* datatools::kernel::get_argv | ( | int | i_ | ) | const |
Return the command line argument by index.
const configuration::variant_repository& datatools::kernel::get_effective_variant_repository | ( | ) | const |
Return a non mutable reference to the effective configuration variant repository.
const library_info& datatools::kernel::get_library_info_register | ( | ) | const |
Return a non mutable reference to the library/component info register.
const library_query_service& datatools::kernel::get_library_query | ( | ) | const |
Return a non mutable reference to the system library query service.
const std::string& datatools::kernel::get_locale_category | ( | ) | const |
Return the locale category.
datatools::logger::priority datatools::kernel::get_logging | ( | ) | const |
Return the logging priority threshold.
unsigned int datatools::kernel::get_nargs | ( | ) | const |
Return the command line argument count.
const urn_query_service& datatools::kernel::get_urn_query | ( | ) | const |
Return a non mutable reference to the system URN query service.
const configuration::variant_repository& datatools::kernel::get_variant_repository | ( | ) | const |
Return a non mutable reference to the configuration variant repository.
const configuration::variant_service& datatools::kernel::get_variant_service | ( | ) | const |
Return a non mutable reference to the configuration variant service.
configuration::variant_repository& datatools::kernel::grab_effective_variant_repository | ( | ) |
Return a mutable reference to the effective configuration variant repository.
library_info& datatools::kernel::grab_library_info_register | ( | ) |
Return a mutable reference to the library/component info register.
library_query_service& datatools::kernel::grab_library_query | ( | ) |
Return a mutable reference to the system library query service.
urn_query_service& datatools::kernel::grab_urn_query | ( | ) |
Return a mutable reference to the system URN query service.
configuration::variant_repository& datatools::kernel::grab_variant_repository | ( | ) |
Return a mutable reference to the configuration variant repository.
configuration::variant_service& datatools::kernel::grab_variant_service | ( | ) |
Return a mutable reference to the configuration variant service.
bool datatools::kernel::has_application_name | ( | ) | const |
Check if the name of the current application is defined.
bool datatools::kernel::has_configuration_registries | ( | ) | const |
Check if the kernel has configuration variant registries.
bool datatools::kernel::has_effective_variant_repository | ( | ) | const |
Check if the effective configuration variant repository is available.
bool datatools::kernel::has_external_configuration_registry | ( | const std::string & | registry_name_ | ) | const |
Check for an external registry given its name.
bool datatools::kernel::has_library_info_register | ( | ) | const |
Check if the library/component info register is available.
bool datatools::kernel::has_library_query | ( | ) | const |
Check if the system library query service is available.
bool datatools::kernel::has_locale_category | ( | ) | const |
Check if a specific locale_category is defined.
bool datatools::kernel::has_services | ( | ) | const |
Check if the system services are available.
bool datatools::kernel::has_urn_query | ( | ) | const |
Check if the system URN query service is available.
bool datatools::kernel::has_variant_repository | ( | ) | const |
Check if the configuration variant repository is available.
bool datatools::kernel::has_variant_service | ( | ) | const |
Check if a configuration variant service is available.
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.
void datatools::kernel::import_configuration_repository | ( | configuration::variant_repository & | rep_ | ) |
Import a configuration variant repository.
void datatools::kernel::initialize | ( | int | argc_, |
char * | argv_[], | ||
uint32_t | flags_ = 0 |
||
) |
Initialization from command line arguments.
|
static |
Return a mutable reference to the kernel singleton.
|
static |
Instantiate and return a mutable reference to the kernel singleton.
bool datatools::kernel::is_initialized | ( | ) | const |
Check initialization status.
|
static |
Check if the kernel singleton is available.
bool datatools::kernel::is_library_info_register_activated | ( | ) | const |
Check if the library info register is activated
bool datatools::kernel::is_library_query_service_activated | ( | ) | const |
Check if the library query service is activated.
bool datatools::kernel::is_urn_query_service_activated | ( | ) | const |
Check if the URN query service is activated.
bool datatools::kernel::is_variant_repository_activated | ( | ) | const |
Check if the variant repository is activated.
bool datatools::kernel::is_variant_service_allowed | ( | ) | const |
Check if the variant service is allowed.
|
static |
Print description of options.
|
static |
Print splash screen.
void datatools::kernel::register_configuration_variant_registries | ( | ) |
Registration of configuration variant registries.
void datatools::kernel::register_resource_paths | ( | ) |
Registration of resource paths.
void datatools::kernel::reset_variant_service | ( | ) |
Reset variant service.
void datatools::kernel::set_locale_category | ( | const std::string & | lc_ | ) |
Set the locale category.
void datatools::kernel::set_logging | ( | datatools::logger::priority | ) |
Set the logging priority threshold.
void datatools::kernel::set_variant_service | ( | configuration::variant_service & | var_serv_ | ) |
Set a variant service.
void datatools::kernel::shutdown | ( | ) |
Shutdown.
|
virtual |
Smart print.
Reimplemented from datatools::i_tree_dumpable.
|
static |
Bit mask for the kernel initialization flags.