Detailed Description

Structure to model a parameter type within the Signature of a Function.

A Parameter is made of a descriptive name, a faudes type and an io-attribute. The latter specifies whether the parameter is a const argument (In), a result (Out) or a both-ways parameter (InOut). To support the code generators of the run-time-interface, you may use the CReturn flag to indicate that the parameter is implemented as the return value in the corresponding C function. The current version of the code generators will handle this case for the elementary types Integer, Boolean and String. They will, however, fail on any other faudes types.

Definition at line 45 of file cfl_functions.h.

#include <cfl_functions.h>

Public Types

enum  ParamAttr { In , Out , InOut , UnDef }
 A function parameter has has one out of four so called io-attrributes;. More...
 

Public Member Functions

 Parameter (void)
 Constructor, default. More...
 
 Parameter (const std::string &rName, const std::string &rTypeName, ParamAttr attr=UnDef, bool cret=false)
 Constructor, by member values. More...
 
 ~Parameter (void)
 Desctructor. More...
 
const std::string & Name (void) const
 Get name. More...
 
void Name (const std::string &rName)
 Set name. More...
 
const std::string & Type (void) const
 Get type. More...
 
void Type (const std::string &rTypeName)
 Set type. More...
 
const ParamAttrAttribute (void) const
 Get Attribute. More...
 
void Attribute (const ParamAttr &rAttr)
 Set Attribute. More...
 
void Attribute (const std::string &rAttrStr)
 Set Attribute by string. More...
 
bool CReturn (void) const
 Get C-Return flag. More...
 
void CReturn (bool cret)
 Set C-Return flag. More...
 
std::string Str (void) const
 Convenience method to produce a textual representation of a parameter. More...
 
void Clear ()
 Set to "undefined". More...
 
bool operator== (const Parameter &rOther) const
 Test equality. More...
 

Static Public Member Functions

static std::string AStr (Parameter::ParamAttr attr)
 Convenience method to produce a textual representation of an io attribute. More...
 

Protected Attributes

std::string mName
 Name. More...
 
std::string mTDName
 Faudes type. More...
 
ParamAttr mAttr
 IO-Attribute. More...
 
bool mCReturn
 C-Return flag. More...
 

Member Enumeration Documentation

◆ ParamAttr

A function parameter has has one out of four so called io-attrributes;.

Enumerator
In 
Out 
InOut 
UnDef 

Definition at line 52 of file cfl_functions.h.

Constructor & Destructor Documentation

◆ Parameter() [1/2]

faudes::Parameter::Parameter ( void  )

Constructor, default.

Definition at line 42 of file cfl_functions.cpp.

◆ Parameter() [2/2]

faudes::Parameter::Parameter ( const std::string &  rName,
const std::string &  rTypeName,
ParamAttr  attr = UnDef,
bool  cret = false 
)

Constructor, by member values.

Definition at line 47 of file cfl_functions.cpp.

◆ ~Parameter()

faudes::Parameter::~Parameter ( void  )

Desctructor.

Definition at line 52 of file cfl_functions.cpp.

Member Function Documentation

◆ AStr()

std::string faudes::Parameter::AStr ( Parameter::ParamAttr  attr)
static

Convenience method to produce a textual representation of an io attribute.

Parameters
attrEnum value denoting the attribute.
Returns
Parameter IO attribute as std::string

Definition at line 95 of file cfl_functions.cpp.

◆ Attribute() [1/3]

void faudes::Parameter::Attribute ( const ParamAttr rAttr)

Set Attribute.

Parameters
rAttrIn/Out/InOut attribute of parameter.

Definition at line 75 of file cfl_functions.cpp.

◆ Attribute() [2/3]

void faudes::Parameter::Attribute ( const std::string &  rAttrStr)

Set Attribute by string.

Convenience method, defaults to UnDef.

Parameters
rAttrStrIn/Out/InOut attribute of parameter.

Definition at line 87 of file cfl_functions.cpp.

◆ Attribute() [3/3]

const Parameter::ParamAttr & faudes::Parameter::Attribute ( void  ) const

Get Attribute.

Returns
In/Out/InOut attribute of parameter.

Definition at line 71 of file cfl_functions.cpp.

◆ Clear()

void faudes::Parameter::Clear ( void  )

Set to "undefined".

Definition at line 112 of file cfl_functions.cpp.

◆ CReturn() [1/2]

void faudes::Parameter::CReturn ( bool  cret)

Set C-Return flag.

Parameters
cretNew value of C-Return flag.

Definition at line 83 of file cfl_functions.cpp.

◆ CReturn() [2/2]

bool faudes::Parameter::CReturn ( void  ) const

Get C-Return flag.

Returns
C-Return flag

Definition at line 79 of file cfl_functions.cpp.

◆ Name() [1/2]

void faudes::Parameter::Name ( const std::string &  rName)

Set name.

Parameters
rNameNew name of parameter

Definition at line 59 of file cfl_functions.cpp.

◆ Name() [2/2]

const std::string & faudes::Parameter::Name ( void  ) const

Get name.

Returns
Name of parameter

Definition at line 55 of file cfl_functions.cpp.

◆ operator==()

bool faudes::Parameter::operator== ( const Parameter rOther) const

Test equality.

Parameters
rOtherOther signature to compare with.

Definition at line 120 of file cfl_functions.cpp.

◆ Str()

std::string faudes::Parameter::Str ( void  ) const

Convenience method to produce a textual representation of a parameter.

Definition at line 106 of file cfl_functions.cpp.

◆ Type() [1/2]

void faudes::Parameter::Type ( const std::string &  rTypeName)

Set type.

Parameters
rTypeNameNew faudes type of parameter

Definition at line 67 of file cfl_functions.cpp.

◆ Type() [2/2]

const std::string & faudes::Parameter::Type ( void  ) const

Get type.

Returns
Faudes type of parameter

Definition at line 63 of file cfl_functions.cpp.

Member Data Documentation

◆ mAttr

ParamAttr faudes::Parameter::mAttr
protected

IO-Attribute.

Definition at line 180 of file cfl_functions.h.

◆ mCReturn

bool faudes::Parameter::mCReturn
protected

C-Return flag.

Definition at line 183 of file cfl_functions.h.

◆ mName

std::string faudes::Parameter::mName
protected

Name.

Definition at line 174 of file cfl_functions.h.

◆ mTDName

std::string faudes::Parameter::mTDName
protected

Faudes type.

Definition at line 177 of file cfl_functions.h.


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

libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen