Bayeux  3.4.1
Core Foundation library for SuperNEMO
Classes | Enumerations | Functions
datatools::introspection Namespace Reference

Nested namespace of the Bayeux/datatools module library. More...

Classes

class  argument
 Description of a method argument. More...
 
class  data_description
 Data description. More...
 
class  method
 Description of a method. More...
 
class  method_args_builder
 This class uses a variable map from the command line to build a list of arguments for calling a function/method through the reflection API. More...
 
class  method_builder
 This class uses the reflection API to build the description of a function or a class method. Special tags are expected in the reflection API of the function/method in order to generate the function introspective description. The mapped function may have or not a unique returned value. The mapped function can have an arbitrary number of input arguments. Only scalar argument/returned values of simple types (bool, integer, real, string) are supported for now. More...
 
class  unit_info
 Unit information associated to a parameter. More...
 

Enumerations

enum  access_type { ACCESS_INVALID = 0, ACCESS_INPUT = 1, ACCESS_OUTPUT = 2 }
 Access type associated to a method argument. More...
 
enum  data_layout { DATA_LAYOUT_INVALID = 0, DATA_LAYOUT_SCALAR = 1, DATA_LAYOUT_VECTOR_WITH_FIXED_SIZE = 2, DATA_LAYOUT_VECTOR_WITH_FREE_SIZE = 3 }
 Layout (scalar/vector) of the data. More...
 
enum  data_type {
  DATA_TYPE_INVALID = -1, DATA_TYPE_VOID = 0, DATA_TYPE_BOOLEAN = 1, DATA_TYPE_INT8 = 2,
  DATA_TYPE_UINT8 = 3, DATA_TYPE_INT16 = 4, DATA_TYPE_UINT16 = 5, DATA_TYPE_INT32 = 6,
  DATA_TYPE_UINT32 = 7, DATA_TYPE_INT64 = 8, DATA_TYPE_UINT64 = 9, DATA_TYPE_FLOAT = 10,
  DATA_TYPE_DOUBLE = 11, DATA_TYPE_STRING = 12, DATA_TYPE_PATH = 13, DATA_TYPE_ENUM = 100,
  DATA_TYPE_USER = 200
}
 Supported data types. More...
 
enum  unit_support_type { UNIT_SUPPORT_INVALID = -1, UNIT_SUPPORT_NONE = 0, UNIT_SUPPORT_IMPLICIT_UNIT = 1, UNIT_SUPPORT_EXPLICIT_DIMENSION = 2 }
 Unit support type for real parameters. More...
 

Functions

const std::string & to_string (access_type)
 Convert an access type to a string. More...
 
bool from_string (const std::string &label_, access_type &access_)
 Convert a string to an access type. More...
 
bool is_valid (access_type t_)
 Check the validity of an access type. More...
 
bool is_input (access_type t_)
 Check if an access type is input. More...
 
bool is_output (access_type t_)
 Check if an access type is output. More...
 
std::string function_builder_flag ()
 
std::string function_constness_flag ()
 
std::string function_description_tag ()
 
std::string name_tag ()
 
std::string description_tag ()
 
std::string type_tag ()
 
std::string layout_tag ()
 
std::string vector_fixed_size_tag ()
 
std::string implicit_unit_tag ()
 
std::string explicit_unit_dimension_tag ()
 
std::string preferred_unit_tag ()
 
std::string default_value_tag ()
 
std::string composed_tag (const std::string &prefix_, const std::string &what_)
 
std::string function_arg_prefix (std::size_t iarg_)
 
std::string function_arg_tag (std::size_t iarg_, const std::string &what_)
 
std::string function_returned_prefix ()
 
std::string function_returned_tag (const std::string &what_)
 
const std::string & to_string (data_layout)
 Convert a data layout to a string. More...
 
bool from_string (const std::string &label_, data_layout &layout_)
 Convert a string to a data layout. More...
 
bool is_valid (data_layout)
 Check the validity of a data layout. More...
 
bool is_scalar (data_layout)
 Check if a data layout is scalar. More...
 
bool is_vector (data_layout)
 Check if a data layout is vector. More...
 
const std::type_info & get_type_info (data_type dt_, const std::string &layout_label_="")
 
void make_value (boost::any &, data_type dt_, const std::string &layout_label_="")
 Make value as a boost::any object. More...
 
const std::string & to_string (data_type)
 Convert a data type to a string. More...
 
bool from_string (const std::string &label_, data_type &layout_)
 Convert a string to a data type. More...
 
data_type from_label_to_data_type (const std::string &label_)
 Convert a string to a data type. More...
 
bool is_valid (data_type)
 Check the validity of a data type. More...
 
bool is_void (data_type)
 Check if a data type is a void. More...
 
bool is_boolean (data_type)
 Check if a data type is a boolean. More...
 
bool is_integer (data_type)
 Check if a data type is an integer. More...
 
bool is_real (data_type)
 Check if a data type is a real. More...
 
bool is_string (data_type)
 Check if a data type is a string. More...
 
bool is_path (data_type)
 Check if a data type is a path (string) More...
 
bool is_enum (data_type)
 Check if a data type is an enumeration. More...
 
bool is_user (data_type)
 Check if a data type is a user type. More...
 
const std::string & to_string (unit_support_type)
 Convert an unit support type to a string. More...
 
bool from_string (const std::string &label_, unit_support_type &us_)
 Convert a string to an unit support type. More...
 
unit_support_type from_label_to_unit_support (const std::string &label_)
 Convert a string to an unit support type. More...
 
bool is_valid (unit_support_type)
 Check the validity of an unit support type. More...
 
bool is_no_unit_support (unit_support_type)
 Check if an unit support type is none. More...
 
bool is_implicit_unit (unit_support_type)
 Check if an unit support type is implicit unit. More...
 
bool is_explicit_unit_dimension (unit_support_type)
 Check if an unit support type is explicit dimension. More...
 

Detailed Description

Nested namespace of the Bayeux/datatools module library.

Enumeration Type Documentation

◆ access_type

Access type associated to a method argument.

Enumerator
ACCESS_INVALID 

Invalid access.

ACCESS_INPUT 

Input.

ACCESS_OUTPUT 

Output.

◆ data_layout

Layout (scalar/vector) of the data.

Examples:

int i; // A "scalar" data
int t[3]; // A "vector" data with fixed size
std::vector<int> v; // A "vector" data with free size
Enumerator
DATA_LAYOUT_INVALID 

Invalid data layout.

DATA_LAYOUT_SCALAR 

Scalar data.

DATA_LAYOUT_VECTOR_WITH_FIXED_SIZE 

Vector data with fixed size.

DATA_LAYOUT_VECTOR_WITH_FREE_SIZE 

Vector data with free size.

◆ data_type

Supported data types.

Enumerator
DATA_TYPE_INVALID 

Invalid data type.

DATA_TYPE_VOID 

No type.

DATA_TYPE_BOOLEAN 

bool

DATA_TYPE_INT8 

int8_t

DATA_TYPE_UINT8 

uint8_t

DATA_TYPE_INT16 

int16_t

DATA_TYPE_UINT16 

uint16_t

DATA_TYPE_INT32 

int32_t

DATA_TYPE_UINT32 

uint32_t

DATA_TYPE_INT64 

int64_t

DATA_TYPE_UINT64 

uint64_t

DATA_TYPE_FLOAT 

float value

DATA_TYPE_DOUBLE 

double value

DATA_TYPE_STRING 

character string

DATA_TYPE_PATH 

filesystem path as a character string

DATA_TYPE_ENUM 

enumeration type

DATA_TYPE_USER 

user data type

◆ unit_support_type

Unit support type for real parameters.

Enumerator
UNIT_SUPPORT_INVALID 

Invalid unit support.

UNIT_SUPPORT_NONE 

No unit management (plain float/double)

UNIT_SUPPORT_IMPLICIT_UNIT 

Implicit unit associated to the parameter.

UNIT_SUPPORT_EXPLICIT_DIMENSION 

Explicit unit associated to the parameter.

Function Documentation

◆ composed_tag()

std::string datatools::introspection::composed_tag ( const std::string &  prefix_,
const std::string &  what_ 
)

◆ default_value_tag()

std::string datatools::introspection::default_value_tag ( )

◆ description_tag()

std::string datatools::introspection::description_tag ( )

◆ explicit_unit_dimension_tag()

std::string datatools::introspection::explicit_unit_dimension_tag ( )

◆ from_label_to_data_type()

data_type datatools::introspection::from_label_to_data_type ( const std::string &  label_)

Convert a string to a data type.

◆ from_label_to_unit_support()

unit_support_type datatools::introspection::from_label_to_unit_support ( const std::string &  label_)

Convert a string to an unit support type.

◆ from_string() [1/4]

bool datatools::introspection::from_string ( const std::string &  label_,
access_type access_ 
)

Convert a string to an access type.

◆ from_string() [2/4]

bool datatools::introspection::from_string ( const std::string &  label_,
unit_support_type us_ 
)

Convert a string to an unit support type.

◆ from_string() [3/4]

bool datatools::introspection::from_string ( const std::string &  label_,
data_layout layout_ 
)

Convert a string to a data layout.

◆ from_string() [4/4]

bool datatools::introspection::from_string ( const std::string &  label_,
data_type layout_ 
)

Convert a string to a data type.

◆ function_arg_prefix()

std::string datatools::introspection::function_arg_prefix ( std::size_t  iarg_)

◆ function_arg_tag()

std::string datatools::introspection::function_arg_tag ( std::size_t  iarg_,
const std::string &  what_ 
)

◆ function_builder_flag()

std::string datatools::introspection::function_builder_flag ( )

◆ function_constness_flag()

std::string datatools::introspection::function_constness_flag ( )

◆ function_description_tag()

std::string datatools::introspection::function_description_tag ( )

◆ function_returned_prefix()

std::string datatools::introspection::function_returned_prefix ( )

◆ function_returned_tag()

std::string datatools::introspection::function_returned_tag ( const std::string &  what_)

◆ get_type_info()

const std::type_info& datatools::introspection::get_type_info ( data_type  dt_,
const std::string &  layout_label_ = "" 
)

Return the type info associated to a given data type with specific layout

Supported layout labels are:

  • "scalar" for int value;
  • "vector" for std::vector<int> values;
  • "list" for std::list<int> values;
  • "map" for std::map<std::string, int> values;

◆ implicit_unit_tag()

std::string datatools::introspection::implicit_unit_tag ( )

◆ is_boolean()

bool datatools::introspection::is_boolean ( data_type  )

Check if a data type is a boolean.

◆ is_enum()

bool datatools::introspection::is_enum ( data_type  )

Check if a data type is an enumeration.

◆ is_explicit_unit_dimension()

bool datatools::introspection::is_explicit_unit_dimension ( unit_support_type  )

Check if an unit support type is explicit dimension.

◆ is_implicit_unit()

bool datatools::introspection::is_implicit_unit ( unit_support_type  )

Check if an unit support type is implicit unit.

◆ is_input()

bool datatools::introspection::is_input ( access_type  t_)

Check if an access type is input.

◆ is_integer()

bool datatools::introspection::is_integer ( data_type  )

Check if a data type is an integer.

◆ is_no_unit_support()

bool datatools::introspection::is_no_unit_support ( unit_support_type  )

Check if an unit support type is none.

◆ is_output()

bool datatools::introspection::is_output ( access_type  t_)

Check if an access type is output.

◆ is_path()

bool datatools::introspection::is_path ( data_type  )

Check if a data type is a path (string)

◆ is_real()

bool datatools::introspection::is_real ( data_type  )

Check if a data type is a real.

◆ is_scalar()

bool datatools::introspection::is_scalar ( data_layout  )

Check if a data layout is scalar.

◆ is_string()

bool datatools::introspection::is_string ( data_type  )

Check if a data type is a string.

◆ is_user()

bool datatools::introspection::is_user ( data_type  )

Check if a data type is a user type.

◆ is_valid() [1/4]

bool datatools::introspection::is_valid ( access_type  t_)

Check the validity of an access type.

◆ is_valid() [2/4]

bool datatools::introspection::is_valid ( unit_support_type  )

Check the validity of an unit support type.

◆ is_valid() [3/4]

bool datatools::introspection::is_valid ( data_layout  )

Check the validity of a data layout.

◆ is_valid() [4/4]

bool datatools::introspection::is_valid ( data_type  )

Check the validity of a data type.

◆ is_vector()

bool datatools::introspection::is_vector ( data_layout  )

Check if a data layout is vector.

◆ is_void()

bool datatools::introspection::is_void ( data_type  )

Check if a data type is a void.

◆ layout_tag()

std::string datatools::introspection::layout_tag ( )

◆ make_value()

void datatools::introspection::make_value ( boost::any &  ,
data_type  dt_,
const std::string &  layout_label_ = "" 
)

Make value as a boost::any object.

◆ name_tag()

std::string datatools::introspection::name_tag ( )

◆ preferred_unit_tag()

std::string datatools::introspection::preferred_unit_tag ( )

◆ to_string() [1/4]

const std::string& datatools::introspection::to_string ( access_type  )

Convert an access type to a string.

◆ to_string() [2/4]

const std::string& datatools::introspection::to_string ( unit_support_type  )

Convert an unit support type to a string.

◆ to_string() [3/4]

const std::string& datatools::introspection::to_string ( data_layout  )

Convert a data layout to a string.

◆ to_string() [4/4]

const std::string& datatools::introspection::to_string ( data_type  )

Convert a data type to a string.

◆ type_tag()

std::string datatools::introspection::type_tag ( )

◆ vector_fixed_size_tag()

std::string datatools::introspection::vector_fixed_size_tag ( )