faudes::AttributeVoid Class Reference

#include <attributes.h>

Inheritance diagram for faudes::AttributeVoid:

faudes::AttributeFlags faudes::AttributeTimedGlobal faudes::SimConditionAttribute faudes::AttributeCFlags faudes::AttributeTimedState faudes::AttributeTimedTrans faudes::SimEventAttribute List of all members.

Detailed Description

Minimal Attribute.

Attributes are used as template parameters for faudes containers and generators and facilitate the modelling of customized properties of events, states and transitions. The AttributeVoid class defines the minimal interface of faudes attributes and therefore is the designated base class for all attribute implementations. The AttributeVoid class does not define any actual properties. See AttributeFlags for a non-trivial example.

Definition at line 43 of file attributes.h.

Public Member Functions

 AttributeVoid (void)
 Constructor.
virtual ~AttributeVoid (void)
 Destructor.
void Write (const std::string &rLabel="", const Type *pContext=0) const
 Write attribute to console.
void Write (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0, std::ios::openmode openmode=std::ios::out|std::ios::trunc) const
 Write attribute to a file.
void Write (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write attribute to TokenWriter.
std::string ToString (const std::string &rLabel="", const Type *pContext=0) const
 Write attribute to a string.
void Read (const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
 Read from file with label specified.
void Read (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 Read from TokenReader with label sepcified.
bool IsDefault (void) const
 Test for default value.
void SetDefault (void)
 Set to fefault value.
void Clear (void)
 Synonym for SetDefault to match std interface.

Protected Member Functions

virtual void DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 Actual read method to read attribute from tokenreader.
virtual void DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Actual write method to write the attribute to a TokenWriter.
void Skip (TokenReader &rTr)
 Skip attribute tokens.


Constructor & Destructor Documentation

faudes::AttributeVoid::AttributeVoid void   )  [inline]
 

Constructor.

Definition at line 47 of file attributes.h.

virtual faudes::AttributeVoid::~AttributeVoid void   )  [inline, virtual]
 

Destructor.

Definition at line 50 of file attributes.h.


Member Function Documentation

void faudes::AttributeVoid::Clear void   )  [inline]
 

Synonym for SetDefault to match std interface.

Definition at line 168 of file attributes.h.

void faudes::AttributeVoid::DoRead TokenReader rTr,
const std::string &  rLabel = "",
const Type pContext = 0
[protected, virtual]
 

Actual read method to read attribute from tokenreader.

For the base class AttributeVoid, this method skips all tokens until a String or Integer token indicates the end of all attribute values.

For derived attributue classes, this method must either read all tokens that belong to the respective attribute, or none. It may thorw exceptions on token mismatch within the relevant attribute, but it may not throw exceptions when it encounters tokens that possibly belong to another attribute.

Parameters:
rTr TokenReader to read from
rLabel Section to read
pContext Read context to provide contextual information
Exceptions:
Exception 
  • IO error (id 1)

Reimplemented in faudes::AttributeFlags, faudes::AttributeCFlags, faudes::SimConditionAttribute, faudes::SimEventAttribute, faudes::AttributeTimedTrans, faudes::AttributeTimedState, and faudes::AttributeTimedGlobal.

Definition at line 87 of file attributes.cpp.

void faudes::AttributeVoid::DoWrite TokenWriter rTw,
const std::string &  rLabel = "",
const Type pContext = 0
const [protected, virtual]
 

Actual write method to write the attribute to a TokenWriter.

Reimplement this method for derived attribute classes to define the token io format.

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 in faudes::AttributeFlags, faudes::AttributeCFlags, faudes::SimConditionAttribute, faudes::SimEventAttribute, faudes::AttributeTimedTrans, faudes::AttributeTimedState, and faudes::AttributeTimedGlobal.

Definition at line 81 of file attributes.cpp.

bool faudes::AttributeVoid::IsDefault void   )  const [inline]
 

Test for default value.

Reimplemented in faudes::AttributeFlags, faudes::AttributeCFlags, faudes::SimConditionAttribute, faudes::SimEventAttribute, faudes::AttributeTimedTrans, faudes::AttributeTimedState, and faudes::AttributeTimedGlobal.

Definition at line 158 of file attributes.h.

void faudes::AttributeVoid::Read TokenReader rTr,
const std::string &  rLabel = "",
const Type pContext = 0
 

Read from TokenReader with label sepcified.

Note: all read functions use the virtual function DoRead(), to be reimplemented for by derived attribute classes.

Parameters:
rTr Reference to tokenreader
rLabel Section to read
pContext Read context to provide contextual information
Exceptions:
Exception 
  • IO errors (id 1)
  • token mismatch from DoRead()

Definition at line 74 of file attributes.cpp.

void faudes::AttributeVoid::Read const std::string &  rFileName,
const std::string &  rLabel = "",
const Type pContext = 0
 

Read from file with label specified.

Note: all read functions use the virtual function DoRead(), to be reimplemented for by derived attribute classes.

Parameters:
rFileName Name of file
rLabel Section to read from
pContext Read context to provide contextual information
Exceptions:
Exception 
  • IO errors (id 1)
  • token mismatch from DoRead()

Definition at line 67 of file attributes.cpp.

void faudes::AttributeVoid::SetDefault void   )  [inline]
 

Set to fefault value.

Definition at line 163 of file attributes.h.

void faudes::AttributeVoid::Skip TokenReader rTr  )  [protected]
 

Skip attribute tokens.

Helper method to be called after all sttribute derived classes had their to read their data. It skips all tokens and sections until it reached a String or decimal Integer.

Parameters:
rTr TokenReader to read from
Exceptions:
Exception 
  • IO error (id 1)

Definition at line 93 of file attributes.cpp.

std::string faudes::AttributeVoid::ToString const std::string &  rLabel = "",
const Type pContext = 0
const
 

Write attribute to a string.

Note: all write functions use the virtual function DoWrite(), to be reimplemented by derived attributes.

Parameters:
rLabel Label of section to write
pContext Write context to provide contextual information
Returns:
output string
Exceptions:
Exception 
  • IO errors (id 2)

Definition at line 60 of file attributes.cpp.

void faudes::AttributeVoid::Write TokenWriter rTw,
const std::string &  rLabel = "",
const Type pContext = 0
const
 

Write attribute to TokenWriter.

Note: all write functions use the virtual function DoWrite(), to be reimplemented by derived attributes.

Parameters:
rTw Reference to TokenWriter
rLabel Label of section to write
pContext Write context to provide contextual information
Exceptions:
Exception 
  • IO errors (id 2)

Definition at line 55 of file attributes.cpp.

void faudes::AttributeVoid::Write const std::string &  pFileName,
const std::string &  rLabel = "",
const Type pContext = 0,
std::ios::openmode  openmode = std::ios::out|std::ios::trunc
const
 

Write attribute to a file.

Note: all write functions use the virtual function DoWrite(), to be reimplemented by derived attributes.

Parameters:
pFileName Name of file
rLabel Label of section to write
pContext Write context to provide contextual information
openmode ios::openmode
Exceptions:
Exception 
  • IO errors (id 2)

Definition at line 41 of file attributes.cpp.

void faudes::AttributeVoid::Write const std::string &  rLabel = "",
const Type pContext = 0
const
 

Write attribute to console.

Note: all write functions use the virtual function DoWrite(), to be reimplemented by derived attributes.

Parameters:
rLabel Label of section to write
pContext Write context to provide contextual information

Definition at line 35 of file attributes.cpp.


The documentation for this class was generated from the following files:
Generated on Mon Nov 10 08:13:17 2008 for libFAUDES 2.11v by  doxygen 1.4.4