Bayeux  3.4.1
Core Foundation library for SuperNEMO
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
datatools Namespace Reference

The Bayeux/datatools library top-level namespace. More...

Namespaces

 configuration
 Nested namespace of the Bayeux/datatools module library.
 
 detail
 Nested namespace of the Bayeux/datatools module library (detail)
 
 introspection
 Nested namespace of the Bayeux/datatools module library.
 
 qt
 
 ui
 
 units
 Utilities for units based on the CLHEP library's implementation.
 

Classes

class  _system_factory_registrator
 Utility template class to enable auto-(un)registration of a derived class in a system factory register of a base class. More...
 
class  array_input_buffer
 Input stream buffer associated to a plain array of characters (char *) More...
 
class  bad_things_cast
 An exception for invalid cast operation within the things class. More...
 
class  base_factory_register
 The base class for all specialized template factory registration classes. More...
 
class  base_service
 The base service class. More...
 
struct  bit_mask
 Some useful constants to manipulate bits typically within an unsigned integer of 32 bits. More...
 
struct  caster
 Templatized concrete caster class for casting pointers from a covariant class hierarchy to some other type. More...
 
class  command
 Generic command utilities. More...
 
struct  computing_time
 A class that compute time statistics. More...
 
class  configuration_property_description
 An object that describes the way an objet of a given class can be configured from properties. More...
 
class  data_reader
 A generic data reader based on Boost/Serialization. More...
 
class  data_writer
 A generic data writer based on Boost/Serialization. More...
 
class  dependency_graph
 Dependency graph. More...
 
struct  dependency_info_type
 Record that stores informations about the dependency between services : More...
 
class  enriched_base
 A base class with useful attributes usable in many contexts. More...
 
class  event_id
 A simple event identifier based on a run number and an event number Run and event numbers are represented by 32 bits signed integrals. The event_id class is serializable through the Boost.Serialization library. Utilities for standard I/O streams is also provided. More...
 
class  event_id_equal_predicate
 Predicate to check if an event_id equals another one. More...
 
class  factory_register
 Template factory registration class. More...
 
class  handle
 Templatized handle class that wraps a Boost shared pointer and behaves like a reference. More...
 
class  handle_pool
 A pool of handles on a given class. More...
 
struct  handle_predicate
 Forward declaration : More...
 
struct  i_caster
 Templatized abstract interface class with a cast method using covariant return types . More...
 
class  i_clear
 A pure abstract class (interface) for inherited clearable classes. More...
 
class  i_cloneable
 A pure abstract class (interface) for inherited cloneable classes. More...
 
class  i_named
 A pure abstract class (interface) for named objects, possibly with dynamic name. Example: a class with fixed name. More...
 
class  i_predicate
 A template predicate abstract class. More...
 
class  i_serializable
 Base abstract class of all serializable (and possibly introspectable) classes. More...
 
class  i_tree_dumpable
 An interface with utilities for printable objects. More...
 
class  iarraystream
 std::istream interface for a plain array of characters (char *) More...
 
class  integer_range
 A class representing an interval of integer values. More...
 
struct  io
 I/O utilities. More...
 
class  io_factory
 A generic base reader/writer class based on Boost/Serialization. More...
 
class  io_reader
 A generic reader class inherited from the io_factory class. More...
 
class  io_writer
 A generic writer class inherited from the io_factory class. More...
 
class  ivectorstream
 std::istream interface for a std::vector of characters (std::vector<char>) More...
 
class  kernel
 The datatools kernel singleton with embedded resources and components. More...
 
class  library_info
 Host a register of static and/or dynamic informations about libraries or software components. More...
 
class  library_loader
 A DLL loader class. More...
 
class  library_query_service
 Library information query service. More...
 
struct  logger
 Organise logging functionality under one roof. More...
 
class  mother_to_daughter_predicate
 A template mother-to-daughter caster predicate class. More...
 
class  multi_properties
 A container of mapped properties objects. More...
 
class  object_configuration_description
 An object that describes the way an object of a given class can be configured through properties. More...
 
class  ocd_driver
 The OCD manual application. More...
 
struct  ocd_driver_params
 Parameters of the OCD manual object. More...
 
class  ostream_manipulator
 ostream_manipulator class More...
 
class  ostream_manipulator_ref
 ostream_manipulator_ref class More...
 
class  ovectorstream
 std::ostream interface for a std::vector of characters (std::vector<char>) More...
 
class  properties
 A dictionary of arbitrary properties. More...
 
struct  range_tools
 Utility that hosts constants relative to range and interval objects. More...
 
class  real_range
 A class representing an interval of real (double precision) values with support of embedded units. More...
 
class  safe_serial
 Template container wrapper class for safe storage of object with regards to Boost/Serilization memory tracking feature. More...
 
class  service_entry
 Internal entry for service objects stored in the service manager class. More...
 
class  service_manager
 Service management class. More...
 
class  smart_filename
 A class that builds an arbitrary list of filenames on user request. Supported modes are: More...
 
class  smart_ref
 A template class that stores a reference to an object and additional associated meta-data. More...
 
class  temp_file
 A class for the management of temporary unique file stored in a given directory. More...
 
class  things
 A generic serializable and noncopyable container for arbitrary serializable objects. More...
 
class  tracer
 A tracer object stores some arbitrary output in a trace file. More...
 
class  urn
 A class representing a simplified URN conforming parts of the RFC2141. More...
 
class  urn_db_service
 A service with a dictionary of URN informations. More...
 
class  urn_info
 A class documenting an object addressed by its unique URN and linked to other objects (also addressed by URNs).. More...
 
class  urn_query_service
 A service which allows queries about URNs thanks to embedded specialized dictionaries of URN informations and URN/path resolver tables. More...
 
class  urn_to_path
 A class representing the association of an URN to some paths. A path maybe a filesystem path, an URL, a hostname/port identifier or any other location address that can be represented as a character string. The list if registered paths is ordered to reflect some possible priority policy, depending on the way paths have been inserted in the register. More...
 
class  urn_to_path_resolver_service
 URN to file path resolver service. More...
 
class  vector_input_buffer
 Input stream buffer associated to a std::vector of characters (std::vector<char>) More...
 
class  vector_output_buffer
 Output stream buffer associated to a std::vector of characters (std::vector<char>) More...
 
struct  version
 Describe the datatools API version and features. More...
 
class  version_id
 A class representing a version ID : More...
 

Typedefs

typedef datatools::handle< base_serviceservice_handle_type
 
typedef std::map< std::string, int > dependency_level_dict_type
 
typedef std::map< std::string, dependency_info_typeservice_dependency_dict_type
 
typedef std::shared_ptr< service_entryservice_entry_ptr
 Type alias for a shared pointer on a service entry instance. More...
 
typedef std::map< std::string, service_entry_ptrservice_dict_type
 Type alias for a flat dictionary of service entries. More...
 

Enumerations

enum  datatools_init_flags {
  init_no_help = datatools::bit_mask::bit00, init_no_splash = datatools::bit_mask::bit01, init_no_locale_category = datatools::bit_mask::bit02, init_no_logging = datatools::bit_mask::bit03,
  init_no_inhibit_libquery = datatools::bit_mask::bit04, init_no_libquery_logging = datatools::bit_mask::bit05, init_no_inhibit_libinfo = datatools::bit_mask::bit04, init_no_libinfo_logging = datatools::bit_mask::bit05,
  init_no_resource_path = datatools::bit_mask::bit06, init_no_inhibit_variant = datatools::bit_mask::bit07, init_no_variant = datatools::bit_mask::bit08, init_no_inhibit_qt_gui = datatools::bit_mask::bit09,
  init_no_inhibit_urnquery = datatools::bit_mask::bit10, init_reserved_11 = datatools::bit_mask::bit11, init_reserved_12 = datatools::bit_mask::bit12, init_reserved_13 = datatools::bit_mask::bit13,
  init_reserved_14 = datatools::bit_mask::bit14, init_kernel_inhibit = datatools::bit_mask::bit15
}
 datatools initialization flags More...
 
enum  range_bound_info_type { range_bound_undefined = -1, range_bound_unbounded = 0, range_bound_included = 1, range_bound_excluded = 2 }
 
enum  dependency_level_type {
  DEPENDENCY_UNKNOWN = -1, DEPENDENCY_NONE = 0, DEPENDENCY_OPTIONAL = 1, DEPENDENCY_WEAK = 2,
  DEPENDENCY_STRICT = 3
}
 Constants to measure the level of dependance between services. More...
 
enum  basic_type {
  TYPE_NONE = 0x0, TYPE_BOOLEAN = 0x1, TYPE_INTEGER = 0x2, TYPE_REAL = 0x3,
  TYPE_STRING = 0x4, TYPE_ANY = 0xFFFFFFFF
}
 Basic type identifier. More...
 
enum  data_type { DATA_NONE = 0x0, DATA_SCALAR = 0x1, DATA_ARRAY = 0x2, DATA_ANY = DATA_SCALAR | DATA_ARRAY }
 Data type. More...
 
enum  return_code_type { SUCCESS = EXIT_SUCCESS, ERROR = EXIT_FAILURE, FAILURE = EXIT_FAILURE }
 Return codes. More...
 
enum  compare_result_type { COMPARE_UNDEFINED = -2, COMPARE_LESS = -1, COMPARE_EQUAL = 0, COMPARE_GREATER = 1 }
 Comparison result code for comparable objects. More...
 
enum  name_validation_flags {
  NV_NO_COLON = bit_mask::bit00, NV_NO_DOT = bit_mask::bit01, NV_NO_HYPHEN = bit_mask::bit02, NV_NO_UNDERSCORE = bit_mask::bit03,
  NV_LEADING_DIGIT = bit_mask::bit04, NV_DEFAULT = NV_NO_HYPHEN, NV_INSTANCE = NV_NO_HYPHEN | NV_NO_COLON, NV_MODEL = NV_NO_HYPHEN
}
 

Functions

template<class Base , class Derived >
bool is_covariant (const Base &b_)
 
void initialize (int argc_=0, char *argv_[]=0, uint32_t flags_=0)
 Initialize the datatools library and kernel. More...
 
void terminate ()
 Terminate the datatools library and kernel. More...
 
template<typename ConfigurableType >
bool load_ocd (::datatools::object_configuration_description &, typename boost::disable_if< has_load< ::datatools::detail::ocd::loader< ConfigurableType > > >::type *=0)
 
template<typename ConfigurableType >
bool load_ocd (::datatools::object_configuration_description &ocd_, typename boost::enable_if< has_load< ::datatools::detail::ocd::loader< ConfigurableType > > >::type *dummy=0)
 
template<typename T , typename... Args>
handle< T > make_handle (Args &&... args)
 Constructs an object of type T and wraps it in a datatools::handle. More...
 
template<class T >
const std::string & serial_tag ()
 
template<class T >
const std::string & backward_serial_tag (int i=0)
 
template<typename T >
bool check_serial_tag (const std::string stag_, const std::string alt_tag_="", typename boost::disable_if< has_bsts< T > >::type *dummy_=0)
 
template<typename T >
bool check_serial_tag (const std::string stag_, const std::string alt_tag_="", typename boost::enable_if< has_bsts< T > >::type *dummy_=0)
 
void print_multi_lines (std::ostream &out_, const std::string &text_, const std::string &indent_="")
 
const propertiesempty_config ()
 Return a non mutable reference to a singleton empty configuration container (can be used as default empty set of configuration parameters) More...
 
 for (pmap::const_iterator iter=_props_.begin();iter !=_props_.end();++iter)
 
 for (keys_col_type::const_iterator i=ks.begin();i !=ks.end();++i)
 
std::string get_resource_dir (bool overriden_env_=false)
 
std::string get_resource (const std::string &rname_, bool overriden_env_=false)
 
template<class T >
bool has (const service_dict_type &services_, const std::string &service_name_)
 
template<class T >
T & grab (service_dict_type &services_, const std::string &service_name_)
 
template<class T >
const T & get (const service_dict_type &services_, const std::string &service_name_)
 
bool service_exists (const service_dict_type &services_, const std::string &service_name_)
 Check if a service with given name exists. More...
 
bool service_of_type_exists (const service_dict_type &services_, const std::string &service_type_id_, const std::string &service_name_)
 Check if a service with given name and registered service type identifier exists. More...
 
void merge_services (service_dict_type &services_, service_dict_type &merged_, bool duplicate_throw_=false)
 Merge a service dictionary. More...
 
bool find_service_name_with_id (const service_dict_type &services_, const std::string &service_type_id_, std::string &service_name_)
 Find the service name with given registered service type identifier from a dictionary of services. More...
 
bool find_service_names_with_id (const service_dict_type &services_, const std::string &service_type_id_, std::vector< std::string > &service_names_)
 Find all service names with given registered service type identifier from a dictionary of services. More...
 
base_servicegrab_service (service_dict_type &services_, const std::string &service_name_)
 Return the mutable reference to a service given its name. More...
 
const base_serviceget_service (const service_dict_type &services_, const std::string &service_name_)
 Return the const reference to a service given its name. More...
 
const std::string get_label_from_type (int type_)
 Return the label associated to a data type. More...
 
int get_type_from_label (const std::string &label_)
 Return the data type associated to a label. More...
 
const std::string & empty_string ()
 
const std::string & none_label ()
 
const std::string & yes_label ()
 
const std::string & no_label ()
 
void invalidate (float &value_)
 
float invalid_real_single ()
 Return invalid single precision float (set at NaN): More...
 
bool is_valid (float value_)
 
bool is_infinity (float value_)
 
bool is_plus_infinity (float value_)
 
bool is_minus_infinity (float value_)
 
void plus_infinity (float &value_)
 
void minus_infinity (float &value_)
 
void infinity (float &value_)
 
void invalidate (double &value_)
 
double invalid_real_double ()
 Return invalid double precision real (set at NaN): More...
 
double invalid_real ()
 Return invalid double precision real (set at NaN): More...
 
bool is_valid (double value_)
 
bool is_infinity (double value_)
 
bool is_plus_infinity (double value_)
 
bool is_minus_infinity (double value_)
 
bool is_normal (double value_)
 
void plus_infinity (double &value_)
 
void minus_infinity (double &value_)
 
void infinity (double &value_)
 
compare_result_type compare_real (double x1_, double x2_, double abs_eps_=0.0, double rel_eps_=0.0)
 
bool name_validation (const std::string &name_, uint32_t flags_=NV_DEFAULT)
 Check if a name (object identifier) is valid using simple criteria. More...
 
bool is_quoted (const std::string &text_, char q_='"')
 
void add_quotes (const std::string &from_, std::string &to_, char q_='"')
 Add quotes to a string. More...
 
void add_quotes (std::string &text_, char q_='"')
 Add quotes to a string. More...
 
void remove_quotes (const std::string &from_, std::string &to_, char q_='"')
 Remove quotes from a string. More...
 
void remove_quotes (std::string &text_, char q_='"')
 Remove quotes from a string. More...
 
void remove_all_quotes (std::string &text_)
 Remove all quotes from a string. More...
 
bool resolve_library_info_path_keys (const std::string &library_topic_, std::string &install_path_key_, std::string &environ_path_key_)
 Extract the keys used by library information registration mechanism. More...
 
std::string fetch_path (const std::string &path_str_)
 
bool fetch_path (std::string &word_, std::string &errmsg_)
 Extract the expanded path computed from the 'word' string. More...
 
bool fetch_path_with_env (std::string &word_)
 
bool fetch_path_with_env (std::string &word_, std::string &errmsg_)
 Extract the expanded path computed from the 'word' string. More...
 
bool fetch_path_without_env (std::string &word_)
 
bool fetch_path_with_env_p (std::string &word_, const std::string &parent_path_)
 
bool fetch_path_with_env_g (std::string &word_)
 
bool fetch_path_with_env_pg (std::string &word_, const std::string &parent_path_)
 
bool has_global_path ()
 
void reset_global_path ()
 
void set_global_path (const std::string &gpath_)
 
const std::string & get_global_path ()
 
std::string expand_path (const std::string &path_str_)
 
void split_string (const std::string &word_, const std::string &separators_, std::list< std::string > &words_)
 
template<typename Integral >
void set_bit (Integral &number_, int pos_)
 
template<typename Integral >
void unset_bit (Integral &number_, int pos_)
 
template<typename Integral >
void toggle_bit (Integral &number_, int pos_)
 
template<typename Integral >
bool check_bit (Integral &number_, int pos_)
 
bool validate_version (const std::string &label_, const version_id &vid_, const std::string &version_rules_)
 

Variables

keys_col_type ks
 
 return
 

Detailed Description

The Bayeux/datatools library top-level namespace.

Standard library:

file datatools/real_range.h

Template support for configurable type.

Top-level namespace of the Bayeux/datatools module library.

datatools::safe_serial is a template class useful to record a list of instances of some type in a safe way for serialization. We can access one instance at a time (the current instance) but previous instances are accumulated in some internal container, being never erased. This behaviour is fundamental when using the memory tracking features of the Boost/serialization library.

safe.make(); // create a new instance and make it the current one
safe.get(); // access to the current instance

Standard BOOST I/O file format for SuperNEMO data is :

Metadata: medadata as 'datatools::properties'

Typedef Documentation

◆ dependency_level_dict_type

typedef std::map<std::string, int> datatools::dependency_level_dict_type

◆ service_dependency_dict_type

◆ service_dict_type

typedef std::map<std::string, service_entry_ptr> datatools::service_dict_type

Type alias for a flat dictionary of service entries.

◆ service_entry_ptr

typedef std::shared_ptr<service_entry> datatools::service_entry_ptr

Type alias for a shared pointer on a service entry instance.

◆ service_handle_type

Enumeration Type Documentation

◆ basic_type

Basic type identifier.

Enumerator
TYPE_NONE 

Not defined.

TYPE_BOOLEAN 

Boolean data.

TYPE_INTEGER 

Integer data.

TYPE_REAL 

Real data (should be 0x4 to use it as a mask)

TYPE_STRING 

Character string data (should be 0x8 to use it as a mask)

TYPE_ANY 

Any type.

◆ compare_result_type

Comparison result code for comparable objects.

Enumerator
COMPARE_UNDEFINED 

Comparison cannot be performed.

COMPARE_LESS 

Less than.

COMPARE_EQUAL 

Equal to.

COMPARE_GREATER 

Greater than.

◆ data_type

Data type.

Enumerator
DATA_NONE 

Not defined.

DATA_SCALAR 

Data is a scalar.

DATA_ARRAY 

Data is an array (or vector)

DATA_ANY 

Data can be both.

◆ datatools_init_flags

datatools initialization flags

Enumerator
init_no_help 

Inhibit help screen about kernel switches from the CLI terminal.

init_no_splash 

Inhibit splash screen from the CLI terminal.

init_no_locale_category 

Inhibit local category setting from CLI.

init_no_logging 

Inhibit logging level setting from CLI.

init_no_inhibit_libquery 

Inhibit system library query service.

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 

Inhibit system URN query service.

init_reserved_11 

Reserved for future kernel initialization.

init_reserved_12 

Reserved for future kernel initialization.

init_reserved_13 

Reserved for future kernel initialization.

init_reserved_14 

Reserved for future kernel initialization.

init_kernel_inhibit 

Kernel inhibition flag (expert only)

◆ dependency_level_type

Constants to measure the level of dependance between services.

Enumerator
DEPENDENCY_UNKNOWN 

Unknown/undefined dependency relationship.

DEPENDENCY_NONE 

The service does not depend on the external service.

DEPENDENCY_OPTIONAL 

The service can work without the external service.

DEPENDENCY_WEAK 

Not so strong dependency on the external service (however part of the service may be invalidated)

DEPENDENCY_STRICT 

Strictly depends on the external service.

◆ name_validation_flags

Enumerator
NV_NO_COLON 

Forbid the 'colon' character in names.

NV_NO_DOT 

Forbid the 'dot' character in names.

NV_NO_HYPHEN 

Forbid the 'hyphen' character in names.

NV_NO_UNDERSCORE 

Forbid the 'underscore' character in names.

NV_LEADING_DIGIT 

Allow leading digit.

NV_DEFAULT 

Default validation rule.

NV_INSTANCE 

Default validation rule for object instance.

NV_MODEL 

Default validation rule for object model.

◆ range_bound_info_type

Enumerator
range_bound_undefined 

Undefined bound status.

range_bound_unbounded 

Bound is not set.

range_bound_included 

Bound is set and included in the interval.

range_bound_excluded 

Bound is set and excluded from the interval.

◆ return_code_type

Return codes.

Enumerator
SUCCESS 

Returned code in case of success.

ERROR 

Returned code in case of failure.

FAILURE 

Returned code in case of failure.

Function Documentation

◆ add_quotes() [1/2]

void datatools::add_quotes ( const std::string &  from_,
std::string &  to_,
char  q_ = '"' 
)

Add quotes to a string.

◆ add_quotes() [2/2]

void datatools::add_quotes ( std::string &  text_,
char  q_ = '"' 
)

Add quotes to a string.

◆ backward_serial_tag()

template<class T >
const std::string& datatools::backward_serial_tag ( int  i = 0)

◆ check_bit()

template<typename Integral >
bool datatools::check_bit ( Integral &  number_,
int  pos_ 
)

Check the bit at a given position in an integral number

  • number the integral number
  • pos the bit index

◆ check_serial_tag() [1/2]

template<typename T >
bool datatools::check_serial_tag ( const std::string  stag_,
const std::string  alt_tag_ = "",
typename boost::disable_if< has_bsts< T > >::type *  dummy_ = 0 
)

◆ check_serial_tag() [2/2]

template<typename T >
bool datatools::check_serial_tag ( const std::string  stag_,
const std::string  alt_tag_ = "",
typename boost::enable_if< has_bsts< T > >::type *  dummy_ = 0 
)

◆ compare_real()

compare_result_type datatools::compare_real ( double  x1_,
double  x2_,
double  abs_eps_ = 0.0,
double  rel_eps_ = 0.0 
)

Compare two real numbers given explicit absolute and/or relative tolerances

  • x1_ the first value to be compared
  • x2_ the second value to be compared
  • abs_eps_ the absolute precision for the comparison
  • rel_eps_ the relative precision for the comparison
    Returns
    the comparison result code

◆ empty_config()

const properties& datatools::empty_config ( )

Return a non mutable reference to a singleton empty configuration container (can be used as default empty set of configuration parameters)

◆ empty_string()

const std::string& datatools::empty_string ( )

◆ expand_path()

std::string datatools::expand_path ( const std::string &  path_str_)

Extract the expanded path computed from a string. Internally uses the system's shell.

This method is not very elegant. It uses brute force, asking a shell to interpret the string via a 'system' call and using a temporary file to save the result. Urrkkk! That enables the expansion of environment variables embeded in the 'path_str' string:

Example: '$HOME/foo.dat' is expanded to '/home/>login</foo.dat'

Deprecated:
Use the fetch_path or fetch_path_with_env functions.

◆ fetch_path() [1/2]

std::string datatools::fetch_path ( const std::string &  path_str_)

Fetch the expanded path computed from a string.

  • path_str the string representing the path to be processed
    Returns
    the processed string with resolved environment variable and registered library path

◆ fetch_path() [2/2]

bool datatools::fetch_path ( std::string &  word_,
std::string &  errmsg_ 
)

Extract the expanded path computed from the 'word' string.

◆ fetch_path_with_env() [1/2]

bool datatools::fetch_path_with_env ( std::string &  word_)

Extract the expanded path computed from the 'word' string. Internally uses the getenv function and the datatools::library_info register.

  • word the string path to be processed
    Returns
    true if the processing was successful (successfully resolved environ variables and registered library path)
    Supported formats:
  • Plain path:

    "/tmp/foo/bar/baz.txt" "./foo/bar/baz.txt"

  • Path with special tokens and/or environment variables::

    "~/foo/bar/baz.txt" "~foo/bar/baz.txt" "${HOME}/foo/bar/baz.txt" "${ENV1}/foo/bar/baz.txt" "${ENV1}/foo/${ENV2}/baz.txt"

  • Path from registered/mount point:

    "@foo:bar/baz.txt" "@foo.resources:config/simulation/1.0/manager.conf" "@foo.data:dataset/march2017/run_1.data"

  • URN resolved as path:
    • plain URN:

      "urn:snemo:analysis:setup:1.0"

    • URN with explicit category:

      "urn:snemo:analysis:setup:1.0@configuration" "urn:snemo:analysis:logo:small@image" "urn:snemo:analysis:run:1234@data"

◆ fetch_path_with_env() [2/2]

bool datatools::fetch_path_with_env ( std::string &  word_,
std::string &  errmsg_ 
)

Extract the expanded path computed from the 'word' string.

◆ fetch_path_with_env_g()

bool datatools::fetch_path_with_env_g ( std::string &  word_)

Extract the expanded path computed from a string. Internally uses the getenv function and the datatools::library_info register.

◆ fetch_path_with_env_p()

bool datatools::fetch_path_with_env_p ( std::string &  word_,
const std::string &  parent_path_ 
)

Extract the expanded path computed from a string. Internally uses the getenv function and the datatools::library_info register.

◆ fetch_path_with_env_pg()

bool datatools::fetch_path_with_env_pg ( std::string &  word_,
const std::string &  parent_path_ 
)

Extract the expanded path computed from a string. Internally uses the getenv function and the datatools::library_info register.

◆ fetch_path_without_env()

bool datatools::fetch_path_without_env ( std::string &  word_)

Extract the expanded path computed from a string. Internally uses the datatools::library_info register.

  • word the string path to be processed
    Returns
    true if the processing was successful (successfully resolved registered library path)

◆ find_service_name_with_id()

bool datatools::find_service_name_with_id ( const service_dict_type services_,
const std::string &  service_type_id_,
std::string &  service_name_ 
)

Find the service name with given registered service type identifier from a dictionary of services.

◆ find_service_names_with_id()

bool datatools::find_service_names_with_id ( const service_dict_type services_,
const std::string &  service_type_id_,
std::vector< std::string > &  service_names_ 
)

Find all service names with given registered service type identifier from a dictionary of services.

◆ for() [1/2]

datatools::for ( pmap::const_iterator  iter = _props_.begin(); iter != _props_.end(); ++iter)

◆ for() [2/2]

datatools::for ( keys_col_type::const_iterator  i = ks.begin(); i != ks.end(); ++i)

◆ get()

template<class T >
const T& datatools::get ( const service_dict_type services_,
const std::string &  service_name_ 
)

Return a non mutable reference to a typed service object with given name from a dictionary of services

Parameters
services_The dictionary of service entries
service_name_The name of the service to be checked
Returns
a const reference to the service instance requested by name and type

◆ get_global_path()

const std::string& datatools::get_global_path ( )

Get the datatools global path

◆ get_label_from_type()

const std::string datatools::get_label_from_type ( int  type_)

Return the label associated to a data type.

◆ get_resource()

std::string datatools::get_resource ( const std::string &  rname_,
bool  overriden_env_ = false 
)

Return URL, i.e. a path, to named resource By default the encoded resource root, determined at compile time is used to search for the resource. This can be overriden by setting the DATATOOLS_RESOURCE_DIR environment variable to a path holding custom resources.

Parameters
rname_name of resource, given as a path relative to resource root.
overriden_env_flag to allow path overriding by the DATATOOLS_RESOURCE_DIR environment variable.

◆ get_resource_dir()

std::string datatools::get_resource_dir ( bool  overriden_env_ = false)

Return URL, i.e. a path, to the base directory where resource files are installed

Parameters
overriden_env_If set this flag trigger the search for the environment variable DATATOOLS_RESOURCE_DIR as a directory path on the filesystem as an alternative base directory for resources in place of the standard installation path

◆ get_service()

const base_service& datatools::get_service ( const service_dict_type services_,
const std::string &  service_name_ 
)

Return the const reference to a service given its name.

◆ get_type_from_label()

int datatools::get_type_from_label ( const std::string &  label_)

Return the data type associated to a label.

◆ grab()

template<class T >
T& datatools::grab ( service_dict_type services_,
const std::string &  service_name_ 
)

Return a mutable reference to a typed service object with given name from a dictionary of services

Parameters
services_The dictionary of service entries
service_name_The name of the service to be checked
Returns
a mutable reference to the service instance requested by name and type

◆ grab_service()

base_service& datatools::grab_service ( service_dict_type services_,
const std::string &  service_name_ 
)

Return the mutable reference to a service given its name.

◆ has()

template<class T >
bool datatools::has ( const service_dict_type services_,
const std::string &  service_name_ 
)

Check if a typed service object with given name exist in a dictionary of services

Parameters
services_The dictionary of service entries
service_name_The name of the service to be checked
Returns
a mutable reference to the service instance requested by name and type

◆ has_global_path()

bool datatools::has_global_path ( )

Check if datatools has its global path activated

◆ infinity() [1/2]

void datatools::infinity ( float &  value_)

Set a float to +infinity:

  • value the real number to be set

◆ infinity() [2/2]

void datatools::infinity ( double &  value_)

Set a double to +infinity:

  • value the real number to be set

◆ initialize()

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

Initialize the datatools library and kernel.

◆ invalid_real()

double datatools::invalid_real ( )

Return invalid double precision real (set at NaN):

◆ invalid_real_double()

double datatools::invalid_real_double ( )

Return invalid double precision real (set at NaN):

◆ invalid_real_single()

float datatools::invalid_real_single ( )

Return invalid single precision float (set at NaN):

◆ invalidate() [1/2]

void datatools::invalidate ( float &  value_)

Invalidate a float (set at NaN):

  • value the real number to be invalidated

◆ invalidate() [2/2]

void datatools::invalidate ( double &  value_)

Invalidate a double (set at NaN):

  • value the real number to be invalidated

◆ is_covariant()

template<class Base , class Derived >
bool datatools::is_covariant ( const Base &  b_)

◆ is_infinity() [1/2]

bool datatools::is_infinity ( float  value_)

Check if a float is infinity (+/-inf):

  • value the real number to be checked

◆ is_infinity() [2/2]

bool datatools::is_infinity ( double  value_)

Check if a double is infinity (+/-inf):

  • value the real number to be checked

◆ is_minus_infinity() [1/2]

bool datatools::is_minus_infinity ( float  value_)

Check if a float is minus infinity (-inf):

  • value the real number to be checked

◆ is_minus_infinity() [2/2]

bool datatools::is_minus_infinity ( double  value_)

Check if a double is minus infinity (-inf):

  • value the real number to be checked

◆ is_normal()

bool datatools::is_normal ( double  value_)

Check if a double is normal (not a NaN and not inf):

  • value the real number to be checked

◆ is_plus_infinity() [1/2]

bool datatools::is_plus_infinity ( float  value_)

Check if a float is plus infinity (+inf):

  • value the real number to be checked

◆ is_plus_infinity() [2/2]

bool datatools::is_plus_infinity ( double  value_)

Check if a double is plus infinity (+inf):

  • value the real number to be checked

◆ is_quoted()

bool datatools::is_quoted ( const std::string &  text_,
char  q_ = '"' 
)

Check if a string is quoted

  • text_ the string to check
  • q_ the quoting character (may be double quote or single quote)
    Returns
    true if the string is quoted with a pair of quoting characters

◆ is_valid() [1/2]

bool datatools::is_valid ( float  value_)

Check if a float is valid (not a NaN):

  • value the real number to be checked

◆ is_valid() [2/2]

bool datatools::is_valid ( double  value_)

Check if a double is valid (not a NaN):

  • value the real number to be checked

◆ load_ocd() [1/2]

template<typename ConfigurableType >
bool datatools::load_ocd ( ::datatools::object_configuration_description ,
typename boost::disable_if< has_load< ::datatools::detail::ocd::loader< ConfigurableType > > >::type *  = 0 
)

◆ load_ocd() [2/2]

template<typename ConfigurableType >
bool datatools::load_ocd ( ::datatools::object_configuration_description ocd_,
typename boost::enable_if< has_load< ::datatools::detail::ocd::loader< ConfigurableType > > >::type *  dummy = 0 
)

◆ make_handle()

template<typename T , typename... Args>
handle<T> datatools::make_handle ( Args &&...  args)

Constructs an object of type T and wraps it in a datatools::handle.

This function behaves in the same way as std::make_shared or std::make_unique. It is functionally equivalent to:

handle<T>(new T(std::forward<Args>(args)...))
Template Parameters
Tthe type to construct and wrap in the handle
Parameters
argslist of arguments with which the instance of T will be constructed

Example:

#include <iostream>
struct Vec3
{
int x, y, z;
Vec3() : x(0), y(0), z(0) { }
Vec3(int x, int y, int z) : x(x), y(y), z(z) { }
friend std::ostream& operator<<(std::ostream& os, Vec3& v) {
return os << '{' << "x:" << v.x << " y:" << v.y << " z:" << v.z << '}';
}
};
int main()
{
// Uses default constructor
auto v1 = datatools::make_handle<Vec3>();
// Uses constructor matching the arguments
auto v2 = datatools::make_handle<Vec3>(1, 2, 3);
std::cout << "v1: " << v1.grab() << '\n'
<< "v2: " << v2.grab() << '\n';
}

Output:

v1: {x:0 y:0 z:0}
v2: {x:1 y:2 z:3}

◆ merge_services()

void datatools::merge_services ( service_dict_type services_,
service_dict_type merged_,
bool  duplicate_throw_ = false 
)

Merge a service dictionary.

◆ minus_infinity() [1/2]

void datatools::minus_infinity ( float &  value_)

Set a float to -infinity:

  • value the real number to be set

◆ minus_infinity() [2/2]

void datatools::minus_infinity ( double &  value_)

Set a double to -infinity:

  • value the real number to be set

◆ name_validation()

bool datatools::name_validation ( const std::string &  name_,
uint32_t  flags_ = NV_DEFAULT 
)

Check if a name (object identifier) is valid using simple criteria.

◆ no_label()

const std::string& datatools::no_label ( )

◆ none_label()

const std::string& datatools::none_label ( )

◆ plus_infinity() [1/2]

void datatools::plus_infinity ( float &  value_)

Set a float to +infinity:

  • value the real number to be set

◆ plus_infinity() [2/2]

void datatools::plus_infinity ( double &  value_)

Set a double to +infinity:

  • value the real number to be set

◆ print_multi_lines()

void datatools::print_multi_lines ( std::ostream &  out_,
const std::string &  text_,
const std::string &  indent_ = "" 
)

◆ remove_all_quotes()

void datatools::remove_all_quotes ( std::string &  text_)

Remove all quotes from a string.

◆ remove_quotes() [1/2]

void datatools::remove_quotes ( const std::string &  from_,
std::string &  to_,
char  q_ = '"' 
)

Remove quotes from a string.

◆ remove_quotes() [2/2]

void datatools::remove_quotes ( std::string &  text_,
char  q_ = '"' 
)

Remove quotes from a string.

◆ reset_global_path()

void datatools::reset_global_path ( )

Reset the datatools global path

◆ resolve_library_info_path_keys()

bool datatools::resolve_library_info_path_keys ( const std::string &  library_topic_,
std::string &  install_path_key_,
std::string &  environ_path_key_ 
)

Extract the keys used by library information registration mechanism.

◆ serial_tag()

template<class T >
const std::string& datatools::serial_tag ( )

◆ service_exists()

bool datatools::service_exists ( const service_dict_type services_,
const std::string &  service_name_ 
)

Check if a service with given name exists.

◆ service_of_type_exists()

bool datatools::service_of_type_exists ( const service_dict_type services_,
const std::string &  service_type_id_,
const std::string &  service_name_ 
)

Check if a service with given name and registered service type identifier exists.

◆ set_bit()

template<typename Integral >
void datatools::set_bit ( Integral &  number_,
int  pos_ 
)

Set the bit at a given position in an integral number

  • number the integral number
  • pos the bit index

◆ set_global_path()

void datatools::set_global_path ( const std::string &  gpath_)

Set/activate the datatools global path

◆ split_string()

void datatools::split_string ( const std::string &  word_,
const std::string &  separators_,
std::list< std::string > &  words_ 
)

The function splits a string using separators and provides a list of tokens.

The Boost library provides some powerful alternative through the tokenizer class and split string algorithms.

Deprecated:
Use the Boost string split function or tokenizer class

◆ terminate()

void datatools::terminate ( )

Terminate the datatools library and kernel.

◆ toggle_bit()

template<typename Integral >
void datatools::toggle_bit ( Integral &  number_,
int  pos_ 
)

Toggle the bit at a given position in an integral number

  • number the integral number
  • pos the bit index

◆ unset_bit()

template<typename Integral >
void datatools::unset_bit ( Integral &  number_,
int  pos_ 
)

Unset the bit at a given position in an integral number

  • number the integral number
  • pos the bit index

◆ validate_version()

bool datatools::validate_version ( const std::string &  label_,
const version_id vid_,
const std::string &  version_rules_ 
)

◆ yes_label()

const std::string& datatools::yes_label ( )

Variable Documentation

◆ ks

keys_col_type datatools::ks

◆ return

datatools::return