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

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

#include <bayeux/datatools/introspection/builder.h>

Public Member Functions

 method_builder ()
 Default constructor. More...
 
 method_builder (const std::string &funcname_)
 Constructor. More...
 
 method_builder (const std::string &classname_, const std::string &funcname_)
 Constructor. More...
 
void reset ()
 Reset the builder. More...
 
void set_classname (const std::string &classname_)
 Set the class name. More...
 
void set_funcname (const std::string &funcname_)
 
void set_function (const camp::Function &func_)
 Set the function. More...
 
void build_parameter_data_description (camp::Type param_type_, std::size_t param_index_, data_description &param_dd_)
 Build a data description for a parameter. More...
 
void build_argument (std::size_t arg_index_, argument &arg_)
 Build an input argument at given index. More...
 
void build_returned (argument &returned_)
 Build the returned parameter. More...
 
void build (method &method_)
 Build the description of the method from the reflection function object. More...
 

Static Public Member Functions

static void dump_func (const camp::Function &func_, std::ostream &out_=std::clog)
 

Public Attributes

datatools::logger::priority logging = datatools::logger::PRIO_FATAL
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ method_builder() [1/3]

datatools::introspection::method_builder::method_builder ( )

Default constructor.

◆ method_builder() [2/3]

datatools::introspection::method_builder::method_builder ( const std::string &  funcname_)

Constructor.

◆ method_builder() [3/3]

datatools::introspection::method_builder::method_builder ( const std::string &  classname_,
const std::string &  funcname_ 
)

Constructor.

Member Function Documentation

◆ build()

void datatools::introspection::method_builder::build ( method method_)

Build the description of the method from the reflection function object.

◆ build_argument()

void datatools::introspection::method_builder::build_argument ( std::size_t  arg_index_,
argument arg_ 
)

Build an input argument at given index.

◆ build_parameter_data_description()

void datatools::introspection::method_builder::build_parameter_data_description ( camp::Type  param_type_,
std::size_t  param_index_,
data_description param_dd_ 
)

Build a data description for a parameter.

◆ build_returned()

void datatools::introspection::method_builder::build_returned ( argument returned_)

Build the returned parameter.

◆ dump_func()

static void datatools::introspection::method_builder::dump_func ( const camp::Function &  func_,
std::ostream &  out_ = std::clog 
)
static

◆ reset()

void datatools::introspection::method_builder::reset ( )

Reset the builder.

◆ set_classname()

void datatools::introspection::method_builder::set_classname ( const std::string &  classname_)

Set the class name.

◆ set_funcname()

void datatools::introspection::method_builder::set_funcname ( const std::string &  funcname_)

Set the function name (if not provided, the name of the reflection function object will be used.

◆ set_function()

void datatools::introspection::method_builder::set_function ( const camp::Function &  func_)

Set the function.

Member Data Documentation

◆ logging

datatools::logger::priority datatools::introspection::method_builder::logging = datatools::logger::PRIO_FATAL

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