faudes::Signature Class Reference
#include <rtifncts.h>
Inherits faudes::Type.
List of all members.
Detailed Description
Signature of a
Function.
A Signature describes the faudes types of the positional parameters. Tecnically, a Signature is a vector of Parameters. Each Function may execute serveral variants indicated by setting a particular Signature. A list of valid Signatures is maintained in the coresponding FunctionDefinition.
Core members are
- mName: string to identify ths signature
- mParameters: vector of Paramters.
The Signature is formally derived from Type to inherit the std token io interface. It is not meant to be registered as a faudes type. The token io format is demonstrated by the following example:
<Signature>
"Sum of two integers"
<Parameters>
"arg1" "Integer" +InOut+
"arg2" "Integer" +In+
"result" "String" +Out+
</Parameters>
</Signature>
Technical note: the variable parameter feature offered by FunctionDefinition is a purely cosmetic hack implemented in FunctionDefinition:MergeDocumentation.
|
Public Member Functions |
| Signature (void) |
| Constructor.
|
| ~Signature (void) |
| Destructor.
|
std::string | Name (void) const |
| Return signature name.
|
void | Name (const std::string &rName) |
| Set signature name.
|
void | Clear (void) |
| Clear signature.
|
int | Size (void) const |
| Return number of parameters.
|
const Parameter & | At (int n) const |
| Get parameter type by position.
|
void | Append (const Parameter &rParam) |
| Append positional parameter.
|
Protected Member Functions |
virtual void | DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0) |
| Read signature from from TokenReader.
|
virtual void | DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
| Write configuration data of this object to TokenWriter.
|
Protected Attributes |
std::string | mName |
| Variable to store name.
|
std::vector< Parameter > | mParameters |
| Vector of Parameter-objects.
|
Constructor & Destructor Documentation
faudes::Signature::Signature |
( |
void |
|
) |
[inline] |
faudes::Signature::~Signature |
( |
void |
|
) |
[inline] |
Member Function Documentation
std::string faudes::Signature::Name |
( |
void |
|
) |
const |
Return signature name.
- Returns:
- Name
void faudes::Signature::Name |
( |
const std::string & |
rName |
) |
|
Set signature name.
- Parameters:
-
void faudes::Signature::Clear |
( |
void |
|
) |
[virtual] |
int faudes::Signature::Size |
( |
void |
|
) |
const |
Return number of parameters.
- Returns:
- int
const Parameter & faudes::Signature::At |
( |
int |
n |
) |
const |
Get parameter type by position.
- Parameters:
-
- Exceptions:
-
void faudes::Signature::Append |
( |
const Parameter & |
rParam |
) |
|
Append positional parameter.
- Parameters:
-
void faudes::Signature::DoRead |
( |
TokenReader & |
rTr, |
|
|
const std::string & |
rLabel = "" , |
|
|
const Type * |
pContext = 0 | |
|
) |
| | [protected, virtual] |
Read signature from from TokenReader.
The section is hardcoded to "Signature", context is ignored.
- Parameters:
-
| rTr | TokenReader to read from |
| rLabel | Section to read |
| pContext | Read context to provide contextual information (ignored) |
- Exceptions:
-
Reimplemented from faudes::Type.
void faudes::Signature::DoWrite |
( |
TokenWriter & |
rTw, |
|
|
const std::string & |
rLabel = "" , |
|
|
const Type * |
pContext = 0 | |
|
) |
| | const [protected, virtual] |
Write configuration data of this object to TokenWriter.
The section is hardcoded to "Signature", context is ignored.
- Parameters:
-
| rTw | Reference to TokenWriter |
| rLabel | Label of section to write |
| pContext | Write context to provide contextual information |
- Exceptions:
-
Reimplemented from faudes::Type.
Member Data Documentation
Vector of Parameter-objects.
The documentation for this class was generated from the following files: