|
|
||||||
|
Faudes object serialization. Detailed DescriptionObjects of a class derived from the universal base faudes::Type provide a uniform interface for serialization, which are to be implemented for derived classes. This is supported by
A token hast value types attached, e.g., type string, number, and/or tag. Tags indicate the beginning or end of a section, must balance, and must be XML compliant. The character data inbetween the 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 individual tokens from a C++ stream, the TokenReader and TokenWriter classes keep track of nested sections. Thus, opening a file via a TokenReader allows to scan for a particular section or to loop over all tokens from a particular section. Tokens by example
Faudes serialisation example <Generator name="simple machine">
<Alphabet>
alpha +C+ beta mue lambda
</Alphabet>
<States>
idle busy down
</States>
<TransRel>
idle alpha busy
busy beta idle
busy mue down
down lambda idle
</TransRel>
<InitStates>
idle
</InitStates>
<MarkedStates>
idle
</MarkedStates>
% this is a comment: it will be ignored by TokenReader
<!-- another comment, will be ignored by TokenReader and other XML parsers -->
</Generator>
TaNameSet< AttributeCFlags > Alphabet Convenience typedef for event sets with controllability attributes. Definition: cfl_cgenerator.h:240 vGenerator Generator Plain generator, api typedef for generator with no attributes. Definition: cfl_generator.h:3240
Note that the special characters
Technical Note: alternative file format libFAUDES token formats are intended to be human editable. However, the specific interpretation of the character data between the begin and end elements can not be covered a formal XML document model. The design objective here was a balance between a formal model and human editable data input. Since the initial design, however, a number of faudes types where inroduced to configure the run-time behaviour of tools like the simulator or hardware access. Theese kind of objects are seldomly edited and we feel that a more rigoruos XML format is required to make use of professional XML editors/tools. Therefore we started in libFAUDES 2.16f to implement an alternative serialization format. Recent versions of libFAUDES still read the old format and provide the utility Typical user data like generators and alphabets by default continue to use the original file format for token output. However, for applications that require the more rigoruos XML format, the base class Type provides the additional interface XWrite().
libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen |