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

Host a register of static and/or dynamic informations about libraries or software components. More...

#include <bayeux/datatools/library_info.h>

Inheritance diagram for datatools::library_info:
datatools::i_tree_dumpable

Classes

struct  keys
 Library/software component description property keys. More...
 

Public Member Functions

 library_info ()
 Constructor. More...
 
virtual ~library_info ()
 Destructor. More...
 
logger::priority get_logging () const
 Return the logging priority of the library info register. More...
 
void set_logging (logger::priority)
 Set the logging priority of the library info register. More...
 
void names (std::vector< std::string > &) const
 Build a list of currently registered library names. More...
 
void aliases (std::vector< std::string > &) const
 Build a list of currently defined library aliases. More...
 
void add_alias (const std::string &library_alias_, const std::string &library_name_)
 Add alias. More...
 
void remove_alias (const std::string &library_alias_)
 Remove alias. More...
 
bool resolve_path (const std::string &path_, std::string &resolved_path_, std::string &error_msg_) const
 
void path_registration (const std::string &library_name_, const std::string &topic_, const std::string &path_, bool overwrite_=false)
 Register a path associated to a library/app name. More...
 
void path_unregistration (const std::string &library_name_, const std::string &topic_)
 Unregister a path associated to a library/app name. More...
 
propertiesregistration (const std::string &library_name_, const std::string &library_desc_="", const std::string &library_version_="", const std::string &install_prefix_="", const std::string &install_lib_path_="", const std::string &install_resource_path_="")
 Register basic infos for a given library. More...
 
void unregistration (const std::string &library_name_)
 Unregister a given library. More...
 
bool has (const std::string &library_key_) const
 Check if some infos about a given library exist (by name or alias) More...
 
bool is_library (const std::string &library_name_) const
 Check if a given library exist (by name) More...
 
bool is_alias (const std::string &library_key_) const
 Check if an alias is defined. More...
 
std::string resolve (const std::string &library_key_, bool check_=false) const
 Resolve the true name of the library. More...
 
void update (const std::string &library_name_, const std::string &info_key_, const std::string &info_value_, const std::string &info_type_="", bool locked_=true)
 Update. More...
 
void erase (const std::string &library_name_, const std::string &info_key_)
 Erase a library info from the register. More...
 
void clear ()
 Clear all library infos from the register. More...
 
void print (const std::string &library_name_, std::ostream &out_=std::clog) const
 Print the library infos from the register. More...
 
void initialize ()
 Initialize the library info register. More...
 
void reset ()
 Terminate the library info register. More...
 
bool is_initialized ()
 Check the library info register initialization status. More...
 
const propertiesget (const std::string &library_key_) const
 Return a non-mutable reference to the library infos container. More...
 
propertiesgrab (const std::string &library_key_)
 Return a mutable reference to the library infos container. More...
 
void tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
 Smart print. 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 const std::set< std::string > & topic_labels ()
 
static std::string default_topic_label ()
 
static std::string topic_label_to_install_key (const std::string &label_)
 
static std::string topic_label_to_env_key (const std::string &label_)
 
static bool parse_path_registration_directive (const std::string &rule_, std::string &library_name_, std::string &topic_, std::string &path_, std::string &error_msg_)
 
- 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_)
 

Additional Inherited Members

- 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...
 

Detailed Description

Host a register of static and/or dynamic informations about libraries or software components.

Constructor & Destructor Documentation

◆ library_info()

datatools::library_info::library_info ( )

Constructor.

◆ ~library_info()

virtual datatools::library_info::~library_info ( )
virtual

Destructor.

Member Function Documentation

◆ add_alias()

void datatools::library_info::add_alias ( const std::string &  library_alias_,
const std::string &  library_name_ 
)

Add alias.

◆ aliases()

void datatools::library_info::aliases ( std::vector< std::string > &  ) const

Build a list of currently defined library aliases.

◆ clear()

void datatools::library_info::clear ( )

Clear all library infos from the register.

◆ default_topic_label()

static std::string datatools::library_info::default_topic_label ( )
static

◆ erase()

void datatools::library_info::erase ( const std::string &  library_name_,
const std::string &  info_key_ 
)

Erase a library info from the register.

◆ get()

const properties& datatools::library_info::get ( const std::string &  library_key_) const

Return a non-mutable reference to the library infos container.

◆ get_logging()

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

Return the logging priority of the library info register.

◆ grab()

properties& datatools::library_info::grab ( const std::string &  library_key_)

Return a mutable reference to the library infos container.

◆ has()

bool datatools::library_info::has ( const std::string &  library_key_) const

Check if some infos about a given library exist (by name or alias)

◆ initialize()

void datatools::library_info::initialize ( )

Initialize the library info register.

◆ is_alias()

bool datatools::library_info::is_alias ( const std::string &  library_key_) const

Check if an alias is defined.

◆ is_initialized()

bool datatools::library_info::is_initialized ( )

Check the library info register initialization status.

◆ is_library()

bool datatools::library_info::is_library ( const std::string &  library_name_) const

Check if a given library exist (by name)

◆ names()

void datatools::library_info::names ( std::vector< std::string > &  ) const

Build a list of currently registered library names.

◆ parse_path_registration_directive()

static bool datatools::library_info::parse_path_registration_directive ( const std::string &  rule_,
std::string &  library_name_,
std::string &  topic_,
std::string &  path_,
std::string &  error_msg_ 
)
static

Parse of a path registration directive

Format is :

"NAME[.TOPIC]@PATH/TO/REGISTERED/DIR"

where:

  • NAME : is the registration name (should not contains dots),
  • TOPIC : is chosen among "resources" (default), "data", "libraries", "plugins"...,
  • PATH/TO/REGISTERED/DIR : is the (absolute) path which should contain the topic files. Examples:
    "foo@dir/subdir/subsubdir/..."
    "foo.resource@dir/subdir/subsubdir/..."
    "foo.libraries@dir/subdir/subsubdir/..."
    "foo.binaries@dir/subdir/subsubdir/..."
    "foo.plugins@dir/subdir/subsubdir/..."
    "foo.docs@dir/subdir/subsubdir/..."
    "foo.prefix@dir/subdir/subsubdir/..."
    "foo.data@dir/subdir/subsubdir/..."

◆ path_registration()

void datatools::library_info::path_registration ( const std::string &  library_name_,
const std::string &  topic_,
const std::string &  path_,
bool  overwrite_ = false 
)

Register a path associated to a library/app name.

◆ path_unregistration()

void datatools::library_info::path_unregistration ( const std::string &  library_name_,
const std::string &  topic_ 
)

Unregister a path associated to a library/app name.

◆ print()

void datatools::library_info::print ( const std::string &  library_name_,
std::ostream &  out_ = std::clog 
) const

Print the library infos from the register.

◆ registration()

properties& datatools::library_info::registration ( const std::string &  library_name_,
const std::string &  library_desc_ = "",
const std::string &  library_version_ = "",
const std::string &  install_prefix_ = "",
const std::string &  install_lib_path_ = "",
const std::string &  install_resource_path_ = "" 
)

Register basic infos for a given library.

◆ remove_alias()

void datatools::library_info::remove_alias ( const std::string &  library_alias_)

Remove alias.

◆ reset()

void datatools::library_info::reset ( )

Terminate the library info register.

◆ resolve()

std::string datatools::library_info::resolve ( const std::string &  library_key_,
bool  check_ = false 
) const

Resolve the true name of the library.

◆ resolve_path()

bool datatools::library_info::resolve_path ( const std::string &  path_,
std::string &  resolved_path_,
std::string &  error_msg_ 
) const

Resolve a path with the syntax:

"@foo[.TOPIC]:dir/subdir/subsubdir/..."

with TOPIC chosen among "resources" (default), "data", "libraries", "plugins"...

◆ set_logging()

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

Set the logging priority of the library info register.

◆ topic_label_to_env_key()

static std::string datatools::library_info::topic_label_to_env_key ( const std::string &  label_)
static

◆ topic_label_to_install_key()

static std::string datatools::library_info::topic_label_to_install_key ( const std::string &  label_)
static

◆ topic_labels()

static const std::set<std::string>& datatools::library_info::topic_labels ( )
static

◆ tree_dump()

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

◆ unregistration()

void datatools::library_info::unregistration ( const std::string &  library_name_)

Unregister a given library.

◆ update()

void datatools::library_info::update ( const std::string &  library_name_,
const std::string &  info_key_,
const std::string &  info_value_,
const std::string &  info_type_ = "",
bool  locked_ = true 
)

Update.


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