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

Description of a method. More...

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

Inheritance diagram for datatools::introspection::method:
datatools::enriched_base datatools::i_serializable datatools::i_tree_dumpable

Public Types

enum  method_xc_flags {
  METHOD_XC_CONSTNESS = (datatools::enriched_base::EXPORT_CONFIG_LAST << 1), METHOD_XC_TYPE_ID = (datatools::enriched_base::EXPORT_CONFIG_LAST << 2), METHOD_XC_ARGUMENTS = (datatools::enriched_base::EXPORT_CONFIG_LAST << 3), METHOD_XC_DEFAULT,
  METHOD_XC_LAST = (METHOD_XC_ARGUMENTS)
}
 Flags for export to a container of properties. More...
 
- Public Types inherited from datatools::enriched_base
enum  export_config_flags {
  EXPORT_CONFIG_CLEAR = bit_mask::bit00, EXPORT_CONFIG_NAME = bit_mask::bit01, EXPORT_CONFIG_DISPLAY_NAME = bit_mask::bit02, EXPORT_CONFIG_TERSE_DESCRIPTION = bit_mask::bit03,
  EXPORT_CONFIG_LOGGING_PRIORITY = bit_mask::bit04, EXPORT_CONFIG_AUXILIARIES = bit_mask::bit05, EXPORT_CONFIG_DEFAULT, EXPORT_CONFIG_LAST = EXPORT_CONFIG_AUXILIARIES
}
 Flags for export to a container of properties. 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

 method ()
 Default constructor. More...
 
virtual ~method ()
 Destructor. More...
 
bool has_constness () const
 Check if constness is set. More...
 
bool is_constness () const
 Check if the method is const. More...
 
void set_constness (bool)
 Set the method constness. More...
 
void reset_constness ()
 Reset the method constness. More...
 
bool has_type_id () const
 Check if type identifier is set. More...
 
void set_type_id (const std::string &)
 Set the type identifier. More...
 
void reset_type_id ()
 Reset the type identifier. More...
 
const std::string & get_type_id () const
 Return the type identifier. More...
 
bool has_arguments () const
 Check if the method has arguments. More...
 
bool has_input_arguments () const
 Check if the method has input arguments. More...
 
bool has_output_arguments () const
 Check if the method has output arguments. More...
 
bool has_unique_returned () const
 Check if the method has a single returned value/argument. More...
 
const argumentget_unique_returned () const
 Return the unique returned argument (if any) More...
 
void add_argument (const argument &arg_, const std::string &arg_name_="")
 Add an argument. More...
 
bool has_argument_by_rank (std::size_t rank_) const
 Check if an argument at given rank exists. More...
 
bool has_argument_by_name (const std::string &name_) const
 Check if an argument at given name exists. More...
 
const argumentget_argument_by_name (const std::string &name_) const
 Return argument by name. More...
 
const argumentget_argument_by_rank (std::size_t rank_) const
 Return argument by rank. More...
 
void build_list_of_input_argument_names (std::vector< std::string > &) const
 Build the list of input arguments' names. More...
 
void build_list_of_output_argument_names (std::vector< std::string > &) const
 Build the list of output arguments' names. More...
 
bool is_valid () const
 Check validity. More...
 
void initialize ()
 Initialization. More...
 
void initialize (const datatools::properties &)
 Initialization. More...
 
void reset ()
 Reset. More...
 
void export_to_config (datatools::properties &config_, uint32_t flags_=METHOD_XC_DEFAULT, const std::string &prefix_="") const
 Export to a container of properties. More...
 
virtual void tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
 Smart print. More...
 
void make_scalar_setter (const std::string &arg_name_, data_type arg_type_, const std::string &arg_info_="", const std::string &arg_info2_="", const std::string &method_desc_="", const std::string &method_name_="set")
 Make a setter method with one unique input scalar argument. More...
 
void make_scalar_getter (const std::string &arg_name_, data_type arg_type_, const std::string &arg_info_="", const std::string &arg_info2_="", const std::string &method_desc_="", const std::string &method_name_="get")
 Make a getter method with one unique output scalar argument. More...
 
- Public Member Functions inherited from datatools::enriched_base
virtual bool is_name_valid (const std::string &name_) const
 Check if a name is valid. More...
 
 enriched_base ()
 Default constructor. More...
 
 enriched_base (const std::string &name_, const std::string &display_name_="", const std::string &terse_description_="", logger::priority lp_=logger::PRIO_FATAL)
 Constructor. More...
 
virtual ~enriched_base ()
 Destructor. More...
 
bool has_name () const
 Check if the name is not empty. More...
 
void set_name (const std::string &name_)
 Set the name. More...
 
enriched_baseset_name_c (const std::string &name_)
 Set the name. More...
 
const std::string & get_name () const
 Return the name. More...
 
void reset_name ()
 Reset the name. More...
 
bool has_display_name () const
 Check if the display name is empty. More...
 
void set_display_name (const std::string &display_name_)
 Set the display name. More...
 
enriched_baseset_display_name_c (const std::string &display_name_)
 Set the display name. More...
 
const std::string & get_display_name () const
 Return the display name. More...
 
bool has_terse_description () const
 Check if the description is empty. More...
 
void set_terse_description (const std::string &terse_description_)
 Set the description. More...
 
enriched_baseset_terse_description_c (const std::string &terse_description_)
 Set the description. More...
 
const std::string & get_terse_description () const
 Return the description. More...
 
bool has_auxiliaries () const
 Check if the container of auxiliary properties is empty. More...
 
const datatools::propertiesget_auxiliaries () const
 Return a reference to the non mutable container of auxiliary properties. More...
 
datatools::propertiesgrab_auxiliaries ()
 Return a reference to the mutable container of auxiliary properties. More...
 
void reset_auxiliaries ()
 Remove all auxiliary properties. More...
 
bool is_debug () const
 Check the debug status. More...
 
void set_logging_priority (logger::priority lp_)
 Set the logging priority threshold. More...
 
enriched_baseset_logging_priority_c (logger::priority lp_)
 Set the logging priority threshold. More...
 
void set_logging (const std::string &label_)
 Set the logging priority threshold from a string. More...
 
logger::priority get_logging_priority () const
 Return the logging priority threshold. More...
 
void clear ()
 Clear. More...
 
void reset ()
 Clear. More...
 
void print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const override
 Smart print. More...
 
void initialize (const datatools::properties &config_, bool clear_=false)
 Initialization from a container of properties. More...
 
void export_to_config (datatools::properties &config_, uint32_t flags_=EXPORT_CONFIG_DEFAULT, const std::string &prefix_="") const
 Export to a container of properties. More...
 
- Public Member Functions inherited from datatools::i_serializable
 i_serializable ()
 Default constructor. More...
 
virtual ~i_serializable ()
 Destructor. More...
 
virtual const std::string & get_serial_tag () const =0
 Return the serialization string identifier of the class. More...
 
- Public Member Functions inherited from datatools::i_tree_dumpable
 i_tree_dumpable ()
 Constructor. More...
 
virtual ~i_tree_dumpable ()
 Destructor. 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
 

Additional Inherited Members

- Static Public Member Functions inherited from datatools::enriched_base
static bool validate_name (const std::string &candidate_name_)
 Validate a name. More...
 
static logger::priority default_logging_priority ()
 Return the default logging priority threshold. More...
 
static void init_ocd (datatools::object_configuration_description &)
 OCD support. 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_)
 

Detailed Description

Description of a method.

Member Enumeration Documentation

◆ method_xc_flags

Flags for export to a container of properties.

Enumerator
METHOD_XC_CONSTNESS 
METHOD_XC_TYPE_ID 
METHOD_XC_ARGUMENTS 
METHOD_XC_DEFAULT 
METHOD_XC_LAST 

Constructor & Destructor Documentation

◆ method()

datatools::introspection::method::method ( )

Default constructor.

◆ ~method()

virtual datatools::introspection::method::~method ( )
virtual

Destructor.

Member Function Documentation

◆ add_argument()

void datatools::introspection::method::add_argument ( const argument arg_,
const std::string &  arg_name_ = "" 
)

Add an argument.

◆ build_list_of_input_argument_names()

void datatools::introspection::method::build_list_of_input_argument_names ( std::vector< std::string > &  ) const

Build the list of input arguments' names.

◆ build_list_of_output_argument_names()

void datatools::introspection::method::build_list_of_output_argument_names ( std::vector< std::string > &  ) const

Build the list of output arguments' names.

◆ export_to_config()

void datatools::introspection::method::export_to_config ( datatools::properties config_,
uint32_t  flags_ = METHOD_XC_DEFAULT,
const std::string &  prefix_ = "" 
) const

Export to a container of properties.

◆ get_argument_by_name()

const argument& datatools::introspection::method::get_argument_by_name ( const std::string &  name_) const

Return argument by name.

◆ get_argument_by_rank()

const argument& datatools::introspection::method::get_argument_by_rank ( std::size_t  rank_) const

Return argument by rank.

◆ get_type_id()

const std::string& datatools::introspection::method::get_type_id ( ) const

Return the type identifier.

◆ get_unique_returned()

const argument& datatools::introspection::method::get_unique_returned ( ) const

Return the unique returned argument (if any)

◆ has_argument_by_name()

bool datatools::introspection::method::has_argument_by_name ( const std::string &  name_) const

Check if an argument at given name exists.

◆ has_argument_by_rank()

bool datatools::introspection::method::has_argument_by_rank ( std::size_t  rank_) const

Check if an argument at given rank exists.

◆ has_arguments()

bool datatools::introspection::method::has_arguments ( ) const

Check if the method has arguments.

◆ has_constness()

bool datatools::introspection::method::has_constness ( ) const

Check if constness is set.

◆ has_input_arguments()

bool datatools::introspection::method::has_input_arguments ( ) const

Check if the method has input arguments.

◆ has_output_arguments()

bool datatools::introspection::method::has_output_arguments ( ) const

Check if the method has output arguments.

◆ has_type_id()

bool datatools::introspection::method::has_type_id ( ) const

Check if type identifier is set.

◆ has_unique_returned()

bool datatools::introspection::method::has_unique_returned ( ) const

Check if the method has a single returned value/argument.

◆ initialize() [1/2]

void datatools::introspection::method::initialize ( )

Initialization.

◆ initialize() [2/2]

void datatools::introspection::method::initialize ( const datatools::properties )

Initialization.

◆ is_constness()

bool datatools::introspection::method::is_constness ( ) const

Check if the method is const.

◆ is_valid()

bool datatools::introspection::method::is_valid ( ) const

Check validity.

◆ make_scalar_getter()

void datatools::introspection::method::make_scalar_getter ( const std::string &  arg_name_,
data_type  arg_type_,
const std::string &  arg_info_ = "",
const std::string &  arg_info2_ = "",
const std::string &  method_desc_ = "",
const std::string &  method_name_ = "get" 
)

Make a getter method with one unique output scalar argument.

◆ make_scalar_setter()

void datatools::introspection::method::make_scalar_setter ( const std::string &  arg_name_,
data_type  arg_type_,
const std::string &  arg_info_ = "",
const std::string &  arg_info2_ = "",
const std::string &  method_desc_ = "",
const std::string &  method_name_ = "set" 
)

Make a setter method with one unique input scalar argument.

◆ reset()

void datatools::introspection::method::reset ( )

Reset.

◆ reset_constness()

void datatools::introspection::method::reset_constness ( )

Reset the method constness.

◆ reset_type_id()

void datatools::introspection::method::reset_type_id ( )

Reset the type identifier.

◆ set_constness()

void datatools::introspection::method::set_constness ( bool  )

Set the method constness.

◆ set_type_id()

void datatools::introspection::method::set_type_id ( const std::string &  )

Set the type identifier.

◆ tree_dump()

virtual void datatools::introspection::method::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::enriched_base.


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