libFAUDES

Sections

Index

Faudes object serialization.

Objects of a class derived from the univarsal base faudes::Type provide a uniform interface for serialization. More...

Classes

class  faudes::Token
 Tokens model atomic data for stream IO. More...
class  faudes::TokenReader
 A TokenReader reads sequential tokens from a file or string. More...
class  faudes::TokenWriter
 A TokenWriter writes sequential tokens to a file, a string or stdout. More...

Detailed Description

Objects of a class derived from the univarsal base faudes::Type provide a uniform interface for serialization.

It includes reading and writing the objects configuration data from/to a file or a std::string; see faudes::Type for the actual interface.

Serialization is implemented by three classes

  • the faudes::TokenReader class to read tokenized character stream from file or string
  • the faudes::TokenWriter class to write tokenized character stream to file or string
  • the faudes::Token class to model atomic data units like integers, sections tags and strings.

A token is either of principle type string, number, or tag. Tags indicate the beginning or end of a section, must balance, and are XML comliant. The character data inbeween tags is interpreted as a sequence of strings and numbers, to e.g. conveniently represent a list of events, transition or states. While the Token class implements reading and writing tokens from a C++ stream, the TokenReader and TokenWriter classes keep track of sections. Thus, opening a file via a TokenReader allows to scan for a particular tag or to loop over all tokens from a particular section.

Technical Note: new XML format

Up to libFAUDES 2.16b, the actual stream format was intended to be human editable, and this will continue to be the case for generators and alphabets. However, since the first design of libFAUDES, a number of other faudes types where inroduced, mainly to configure the run-time behaviour of tools like the simulator or hardware access. For the latter kind of objects, we feel that a more rigorous XML format is more apropriate, since this enables the ussage of professional XML editors for configuration and input-data maintenance. Thus, in 2.16f we started to implement an alternative serialization format which will coexist with the old format for some time. During this transitional phase, libFAUDES will read both formats and use the new format as a default for output (exept for generators and alphabets, which will continue use the original human editable format as a default). The transitional phase is expected be completed until libFAUDES 2.20, the utility libfaudes/bin/fts2ftx is supplied for file conversion.

libFAUDES 2.18b --- 2010-12-17 --- c++ source docu by doxygen 1.6.3