libFAUDES

Sections

Index

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 ParameterAt (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< ParametermParameters
 Vector of Parameter-objects.


Constructor & Destructor Documentation

faudes::Signature::Signature ( void   )  [inline]

Constructor.

faudes::Signature::~Signature ( void   )  [inline]

Destructor.


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:
rName 

void faudes::Signature::Clear ( void   )  [virtual]

Clear signature.

Reimplemented from faudes::Type.

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:
n Position of patameter.
Exceptions:
Exception 
  • Index out of range

void faudes::Signature::Append ( const Parameter rParam  ) 

Append positional parameter.

Parameters:
rParam Parameter to append

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:
Exception 
  • IO error (id 1)
  • Token mismatch

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:
Exception 
  • IO errors (id 2)

Reimplemented from faudes::Type.


Member Data Documentation

std::string faudes::Signature::mName [protected]

Variable to store name.

std::vector<Parameter> faudes::Signature::mParameters [protected]

Vector of Parameter-objects.


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

libFAUDES 2.13a c++ source docu by doxygen 1.5.6