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.

Definition at line 148 of file rtifncts.h.


Public Member Functions

 Signature (void)
 Constructor.
 ~Signature (void)
 Destructor.
const 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.

Definition at line 153 of file rtifncts.h.

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

Destructor.

Definition at line 156 of file rtifncts.h.


Member Function Documentation

const std::string & faudes::Signature::Name ( void   )  const [virtual]

Return signature name.

Returns:
Name

Reimplemented from faudes::Type.

Definition at line 50 of file rtifncts.cpp.

void faudes::Signature::Name ( const std::string &  rName  )  [virtual]

Set signature name.

Parameters:
rName 

Reimplemented from faudes::Type.

Definition at line 55 of file rtifncts.cpp.

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

Clear signature.

Reimplemented from faudes::Type.

Definition at line 43 of file rtifncts.cpp.

int faudes::Signature::Size ( void   )  const

Return number of parameters.

Returns:
int

Definition at line 60 of file rtifncts.cpp.

const Parameter & faudes::Signature::At ( int  n  )  const

Get parameter type by position.

Parameters:
n Position of patameter.
Exceptions:
Exception 
  • Index out of range

Definition at line 65 of file rtifncts.cpp.

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

Append positional parameter.

Parameters:
rParam Parameter to append

Definition at line 77 of file rtifncts.cpp.

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.

Definition at line 115 of file rtifncts.cpp.

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.

Definition at line 84 of file rtifncts.cpp.


Member Data Documentation

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

Variable to store name.

Reimplemented from faudes::Type.

Definition at line 245 of file rtifncts.h.

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

Vector of Parameter-objects.

Definition at line 248 of file rtifncts.h.


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

libFAUDES 2.14g --- 2009-12-3 --- c++ source docu by doxygen 1.5.6