doxygen_groups.h
Go to the documentation of this file.
1/************************************************
2 ************************************************
3 ************************************************/
4
5/**
6
7@mainpage libFAUDES C++ API
8
9
10<p>
11As a C++ library, the natural application interface of libFAUDES is given by C++ class and
12function declarations. The API documentation is generated directly from the C++ source code
13and supplemented by <a href="group__Tutorials.html">tutorials</a> that illustrate the intended
14ussage by simple example programs.
15</p>
16<p>
17The C++ API is organized as follows:
18<ul class="l2">
19<li><p>
20<a href="group__ContainerClasses.html">container classes</a>
21for sets of events, states and transitions;
22</p></li>
23<li><p>
24<a href="group__GeneratorClasses.html">generator classes</a>
25to model finite state machines;
26</p></li>
27<li><p>
28<a href="group__GeneratorFunctions.html">functions</a>
29that implement general purpose algorithms on generators; and
30</p></li>
31<li><p>
32<a href="group__AllPlugins.html">plug-ins</a>
33to provide specialised algorithms and derived generator classes.
34</p></li>
35<li><p>
36<a href="group__RunTimeInterface.html">run-time interface (RTI)</a>
37for transparent extensions (advanced topic)
38<li><p>
39<a href="group__TokenIO.html">token-IO</a>
40to serialize faudes typed objects (advanced topic)
41</p></li>
42</ul>
43</p>
44
45
46<p>
47In addition to the C++ API, libFAUDES provides a
48<a href="../reference/index.html">user-reference</a> to address the typical user
49of a libFAUDES application without bothering with C++ implementation technicalities.
50</p>
51
52
53<br>
54
55@subsection SecHomeCompile Compile
56
57
58<p>
59libFAUDES is coded in posix C++ and should compile within any recent C++
60development environment. The supplied
61<tt>Makefile</tt> is targeted for the GNU-Tool-Chain and provides the
62following build targets:
63</p>
64
65<ul class="l2">
66<li><p>
67<tt>make configure</tt> to configure the library; e.g., select plug-ins, choose dynamic or static linking, etc.
68</p></li>
69<li><p>
70<tt>make</tt> to build the library and utility executables;
71</p></li>
72<li><p>
73<tt>make tutorial</tt> to compile examples from the tutorial section.
74</p></li>
75<li><p>
76<tt>make test</tt> to evaluate included test cases
77</p></li>
78</ul>
79
80<p>
81For more information on how to compile libFAUDES,
82see the
83<a href="../faudes_build.html">build-system documentation</a>.
84</p>
85
86<br/>
87
88
89@subsection SecCoding Coding Conventions
90
91
92<p>
93In order to ease communication, libFAUDES sources try
94to follow some notational conventions.
95They are extracted from
96<a href="http://www.possibility.com/Cpp/CppCodingStandard.html" target="_top">
97www.possibility.com/Cpp/CppCodingStandard.html</a>.
98</p>
99
100<ul class="l2">
101<li><p>
102member variable names are upper case with lower case prefix that
103indicates ownership, i.e.
104<tt>m</tt> for ordinary members,
105<tt>p</tt> for pointer to variables controlled somewhere else,
106<tt>r</tt> for refernces to variables controlled somewhere else, and
107<tt>mp</tt> for pointers to variables controlled here;
108</p></li>
109<li><p>
110function-local stack variables are lower case,
111</p></li>
112<li><p>
113class names are upper case, with prefix T for class templates.
114</p></li>
115<li><p>
116keep local stuff in the .cpp file, minimize .h files
117</p></li>
118</ul>
119
120<p>
121Moreover, we
122</p>
123<ul class="l2">
124<li><p>
125avoid the Set/Get prefixes of members functions and use overloading
126instead;
127</p></li>
128<li><p>
129throw exceptions rather than abort() or assert();
130</p></li>
131<li><p>
132use FAUDES_filename_H macro in headers;
133</p></li>
134<li><p>
135use the provided macros in cfl_definitions FD_WARN etc for any console output;
136</p></li>
137<li><p>
138use 2-space indent to have shorter lines of code;
139</p></li>
140<li><p>
141never ever have "using" statements in headers.
142</p></li>
143</ul>
144
145<br/>
146
147@sunsection SecHomeLicense License
148
149
150<p>
151The core libFAUDES sources incl. the C++ API
152are provided for free under conditions of the GNU Lesser General Public License.
153Note that different and perhaps more restrictive license terms may apply to the plug-ins that reside in the plug-in directory.
154</p>
155
156
157
158<p>
159Copyright (C) 2006 Bernd Opitz <br>
160Copyright (C) 2008 - 2010 Thomas Moor, Klaus Schmidt, Sebastian Perk <br>
161Copyright (C) 2010 - 2025 Thomas Moor, Klaus Schmidt<br>
162</p>
163*/
164
165/************************************************
166 ************************************************
167 ************************************************/
168
169
170/** @defgroup GeneratorClasses Generator Classes
171
172A generator is a tupel G = (Q, Sigma, Delta, Qo, Qm). Generators are used
173to represent the closed and the marked language L(G)
174and L_m(G) respectively. The core members of FAUDES generator classes are
175- mpStates, the stateset Q, type faudes::StateSet;
176- mpAlphabet, the Alphabet Sigma, type faudes::EventSet;
177- mpTransRel, the transitionrelation Delta, type faudes::TransSet;
178- mInitStates, the set of initial states Qo, type faudes::StateSet;
179- mMarkedStates, the set of marked states Qm, type faudes::StateSet.
180
181The base class for all libFAUDES generator classes is the faudes::vGenerator,
182also accessible as typedef faudes::Generator.
183It provides functions for read and write access to the core members and file IO.
184Derived generator classes provide attibutes attached to events, states and transitions
185in order to extend basic generator semantics.
186Examples for attributes are controllability flags for events;
187see also faudes::TcGenerator or faudes::System.
188
189*/
190
191/************************************************
192 ************************************************
193 ************************************************/
194
195/** @defgroup ContainerClasses State, Event and Transition Set
196
197This module collects all basic container classes aka state- event-
198and transition-sets, e.g.,
199
200- TBaseSet base class for all libFaudes containers,
201- IndexSet set of plain indices,
202- TaIndexSet set of indices with attributes,
203- NameSet set of indices with symbolic names,
204- TaNameSet set of indices with attributes and symbolic names,
205- TTransSet set of transitions in a sepcific order.
206
207All libFAUDES container classes share the same basic API
208similar to the one known from STL containers. In addition,
209they implement file IO via faudes token streams and/or XML.
210Most commonly used is the plain faudes::EventSet and the faudes::Alphabet.
211Plug-ins introduce specialized sets for their purposes.
212
213*/
214
215/************************************************
216 ************************************************
217 ************************************************/
218
219/** @defgroup GeneratorFunctions General Purpose Functions
220
221This module collects general purpose functions on
222Generator, System, EventSet and Alphabet typed data.
223It includes functions related to regular expressions,
224projection, parallel composition, etc.
225
226*/
227
228
229/************************************************
230 ************************************************
231 ************************************************/
232
233/** @defgroup Tutorials Tutorials
234
235This module collects all tutorials. The tutorials are seen as a pragmatic
236introduction to supplement the doxygen generated html documentaion of
237class and function definitions. Plug-Ins are meant to contribute additional tutorials
238to illustrate their intended usage.
239
240To compile the tutorials call make with target &quot;tutorial&quot;
241in the &quot;libfaudes&quot; directory of the source tree:
242<pre>$ make tutorial
243</pre>
244
245
246*/
247
248/************************************************
249 ************************************************
250 ************************************************/
251
252
253/** @defgroup AllPlugins PlugIns
254
255List of all plug-ins that are installed and enabled
256in this copy of libFAUDES.
257
258To install a plug-in, copy its sources into the plug directory
259of the libfaudes source tree. To enable a plug-in, either edit the
260main Makefile or add its name to the FAUDES_PLUGINS environment variable.
261The <a href="../faudes_algorithm_example.html">example plug-in</a>
262further illustrates the plug-in infrastructure.
263
264For instructions on how to compile libFAUDES, see the
265<a href="../faudes_build.html">build-system</a> documentation.
266
267*/
268
269/************************************************
270 ************************************************
271 ************************************************/
272
273/** @defgroup TokenIO Faudes object serialization.
274
275Objects of a class derived from the universal base faudes::Type
276provide a uniform interface for serialization, which are to be
277implemented for derived classes. This is supported by
278- the faudes::Token class to model atomic data units like integers, sections tags and strings.
279- the faudes::TokenReader class to read a tokenized character stream from file or string
280- the faudes::TokenWriter class to write a tokenized character stream to file or string
281
282A token hast value types attached, e.g., type string, number, and/or tag.
283Tags indicate the beginning or end of a section, must balance, and must be XML compliant.
284The character data inbetween the tags is interpreted as a sequence of strings and numbers,
285to e.g. conveniently represent a list of events, transition or states. While the Token class
286implements reading and writing individual tokens from a C++ stream, the TokenReader and TokenWriter
287classes keep track of nested sections. Thus, opening a file via a TokenReader allows to scan for
288a particular section or to loop over all tokens from a particular section.
289
290Tokens by example
291- <tt>abcd</tt> the string "abcd"
292- <tt>"ab cd"</tt> the same string containing a blank
293- <tt>'ad\"cd';</tt> the same string containing a double quote
294- <tt>abc\\d</tt> the same string containing a backslash
295- <tt>"123"</tt> the string 123
296- <tt>123</tt> the non-negative integer 123
297- <tt>0xFF</tt> the non-negative integer 255 (hexadecimal notation)
298- <tt>1.5</tt> the float number 1.5
299- <tt>&lt;Start&gt;</tt> tag to indicate begin of section Start (so called XML element)
300- <tt>&lt;/Start&gt;</tt> tag to indicate end of section Start (so called XML element)
301- <tt>&lt;Start value="x12"&gt;</tt> begin tag with XML attribute
302
303Faudes serialisation example
304@code
305<Generator name="simple machine">
306
307<Alphabet>
308alpha +C+ beta mue lambda
309</Alphabet>
310
311<States>
312idle busy down
313</States>
314
315<TransRel>
316idle alpha busy
317busy beta idle
318busy mue down
319down lambda idle
320</TransRel>
321
322<InitStates>
323idle
324</InitStates>
325
326<MarkedStates>
327idle
328</MarkedStates>
329
330% this is a comment: it will be ignored by TokenReader
331
332<!-- another comment, will be ignored by TokenReader and other XML parsers -->
333
334</Generator>
335@endcode
336
337<br>
338
339Note that the special characters <tt>&lt;</tt>, <tt>&gt;</tt> and <tt>&amp;</tt> must be
340quoted as entities, i.e., represented as <tt>&amp;xxx;</tt> where the <tt>xxx</tt> refers to the
341character. This style of quoting is also required when the respective character appears within
342a quoted string or a faudes-style comment. This restriction is required for XML compliance.
343
344<br>
345<br>
346
347
348
349<b>Technical Note: alternative file format</b>
350
351libFAUDES token formats are intended to be human editable. However, the
352specific interpretation of the character data between the begin and end elements
353can not be covered a formal XML document model. The design objective here
354was a balance between a formal model and human editable data input.
355
356Since the initial design, however, a number of faudes types where inroduced to
357configure the run-time behaviour of tools like the simulator or hardware access.
358Theese kind of objects are seldomly edited and we feel that a more rigoruos
359XML format is required to make use of professional XML editors/tools.
360Therefore we started in libFAUDES 2.16f to implement an alternative serialization
361format. Recent versions of libFAUDES still read the old format and provide
362the utility <tt>libfaudes/bin/fts2ftx</tt> for file conversion.
363Please let us know if you experience problems with data in the old format.
364
365Typical user data like generators and alphabets by default continue to use
366the original file format for token output. However, for applications that require
367the more rigoruos XML format, the base class Type provides the additional
368interface XWrite().
369
370*/
371
372/************************************************
373 ************************************************
374 ************************************************/
375
376/** @namespace faudes
377
378libFAUDES resides within the namespace faudes. Plug-Ins may use the same namespace.
379
380*/

libFAUDES 2.33k --- 2025.09.16 --- c++ api documentaion by doxygen