Some URL fixes
[senf.git] / doclib / Mainpage.dox
1 // $Id$
2 //
3 // Copyright (C) 2007
4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 //     Stefan Bund <g0dil@berlios.de>
7 //
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
23 /** \mainpage SENF: The Simple and Extensible Network Framework
24
25     The SENF Simple and Extensible Network Framework aims to be a complete set of libraries to
26     facilitate the development of network applications focusing on network protocols on the layers
27     below the application layer. However, the framework includes many general purpose utilities and
28     will be expedient to use well beyond its primary objective.
29
30     \section Goals
31
32     The main goals of this library are (in no particular order):
33
34     \li modular framework design
35     \li utilizing the power of modern C++
36     \li very low overhead for frequently called members
37     \li extensible design
38     \li concise interface
39
40     \section start Getting started
41
42     To get started using this library, begin by checking out the code from the <a
43     href="http://developer.berlios.de/svn/?group_id=7489">BerliOS SVN repository</a>. You may find
44     help on using the library at '\ref senf_usage'. If you are interested in SENF, feel free to
45     subscribe to the <a href="http://developer.berlios.de/mail/?group_id=7489">SENF mailing
46     lists</a>. If you want to contribute, read the docs and \e please adhere to the \ref
47     senf_conventions.
48
49     \see \ref senf_usage\n
50          <a href="../../Examples/doc/html/index.html">Examples</a>
51
52     \section senfutil_overview Building Projects using SENF
53
54     When building projects using %senf, SENFSCons has a very simple helper module
55     \ref senf_senfutil "senfutil.py" to make the building of libraries utilizing %senf simpler.
56
57     \see \ref senf_senfutil
58 */
59
60 /** \page senf_senfutil SENF SCons build utility (senfutil.py)
61
62     \autotoc
63
64     \c senfutil helps setting up projects which utilize SENF. It will configure all necessary
65     compiler and linker options and additionally sets up some useful defaults and utilities.
66
67     \c senfutil really serves three roles
68
69     \li detect SENF and configure the build accordingly
70     \li make some SCons extensions used within SENF available to other projects
71     \li set default compilation options in the same way, they are set when compiling SENF proper.
72
73     The last two points are of course optional.
74
75     \section senfutil_tutorial Tutorial
76
77     To utilize \c senfutil you need to do two things:
78     \li Update your \c SConstruct file
79     \li add a bootstrap \c senfutil.py to \c site_scons
80
81     Lets start with the \c SConstruct file
82     \code
83     import senfutil
84
85     env = Environment()
86     senfutil.SetupForSENF(env)
87     senfutil.DefaultOptions(env)
88
89     env.SetDefault(
90         PROJECTNAME      = 'Example project',
91         PROJECTEMAIL     = 'developer@domain.com',
92         DOCLINKS         = [ ('Homepage', 'http://www.domain.com') ]
93     )
94
95     sources, tests = senfutil.Glob(env, exclude=['main.cc'])
96
97     objects = env.Object(sources)
98     example = env.Program('example', objects + ['main.cc'])
99     test    = env.BoostUnitTest('test', objects + tests)
100
101     env.Default(example)
102
103     senfutil.Doxygen(env)
104
105     senfutil.CleanGlob('all', [ '*~', '#*#' ])
106     \endcode
107
108     This simple sample already enables a lot of functionality:
109     \li support for different \e SENF flavors (debug/normal/final)
110     \li support for different \e build flavors (debug/normal/final)
111     \li sensible default compile options for the different flavors
112     \li support for extended command-line variables
113     \li building documentation with an auto-generated Doxyfile
114     \li running unit-tests
115     \li cleaning backup and temporary files
116
117     Here a very quick rundown of the important scons commands:
118     \li Build default target:
119         <pre>
120         $ scons
121         </pre>
122     \li Build documentation and unit-tests:
123         <pre>
124         $ scons doc test
125         </pre>
126     \li clean up everything
127         <pre>
128         $ scons -c all
129         </pre>
130     \li Pass custom options on the command-line
131         <pre>
132         $ scons CXXFLAGS+=-Wextra
133         </pre>
134
135     Since \c senfutil.py is not on the standard \c python or \c SCons path, some extra steps are
136     needed to find it.
137     \li Either add the possible directories to <tt>sys.path</tt> before importing \c senfutil:
138         \code
139         import sys
140         sys.path.extend(('/usr/local/lib/senf/site_scons', '/usr/lib/senf/site_scons'))
141         import senfutil
142         \endcode
143     \li Alternatively, install the following utility script as <tt>site_scons/senfutil.py</tt> into
144         your project. This script will search for <tt>site_scons/senfutil.py</tt> in a list of
145         directories and then load the real \c senfutil.py on top of itself. The directories searched
146         include: the current directory and all parents, subdirectories named <tt>senf/</tt>,
147         <tt>Senf/</tt> or <tt>SENF/</tt> thereof, and <tt>/usr/local/lib/senf/</tt> and
148         <tt>/usr/lib/senf/</tt>
149         \include senfutil.py
150
151     \section senfutil_features
152
153     The \c senfutil utility for SCons helps setting up a project to compile against SENF:
154
155     \li \c senfutil adds all necessary libraries to link against
156     \li \c senfutil will set necessary compile options.
157     \li \c senfutil supports normal, debug and final project build options
158     \li \c senfutil adds support for Boost unit tests
159     \li \c senfutil implements a very simple to use enhanced doxygen build with SENF symbol
160         cross-reference
161     \li \c senfutil allows specifying variables on the scons command line
162     \li \c senfutil supports more readable compile-time SENF loglevel configuration
163
164     Using the utility is quite simple
165
166     \code
167     import sys
168     sys.path.extend(('senf/site_scons','/usr/lib/senf/site_scons'))
169     import glob, senfutil
170
171     env = Environment()
172     senfutil.SetupForSENF(env)
173     # senfutil.DefaultOptions(env)
174
175     # Set or change SCons environment variables with env.Append, env.Replace or env.SetDefault
176     env.Append(
177         CXXFLAGS         = [ '-Wall', '-Woverloaded-virtual' ],
178         CXXFLAGS_final   = [ '-O2' ],
179         CXXFLAGS_normal  = [ '-O0', '-g' ],
180         CXXFLAGS_debug   = [ '$CXXFLAGS_normal' ],
181
182         LINKFLAGS_normal = [ '-Wl,-S' ],
183
184         LOGLEVELS_debug  = [ 'senf::log::Debug||VERBOSE' ],
185
186         PROJECTNAME      = 'Example project',
187         PROJECTEMAIL     = 'developer@domain.com',
188         DOCLINKS         = [ ('Homepage', 'http://www.domain.com') ]
189     )
190
191     # Create a list of sources and tests. Sources are all *.cc files, test are *.test.cc
192     sources, tests = senfutil.Glob(env, exclude=['main.cc'] )
193
194     # Build objects from sources
195     objects = env.Object(sources)
196
197     # Build main binary
198     env.Default( env.Program( target='example', source=objects + ['main.cc'] ) )
199
200     # Build a boost unit-test from additional test sources
201     env.BoostUnitTest( 'test', source=objects + tests)
202
203     # Build a documentation, autogenerates a Doxyfile
204     senfutil.Doxygen(env)
205     \endcode
206
207     This example builds a simple binary from a number of source files (all '.cc' files). It links
208     against the SENF library and automatically sets all the correct compiler options using
209     <tt>senfutil.SetupForSENF( env )</tt>.
210
211     This script automatically uses a SENF installation either symlinked or imported into the current
212     project in directory 'senf' or, if this directory does not exist, a globally installed SENF.
213
214     \section senf_senfutil_options Build options
215
216     \c senfutil supports the <tt>debug=1</tt> or <tt>final=1</tt> build options. These parameters
217     select one of the build configurations 'debug', 'normal' or 'final'. The following variables are
218     supported each with separate values for all three configurations:
219
220     \li \c CXXFLAGS
221     \li \c CPPDEFINES
222     \li \c LINKFLAGS
223     \li \c LOGLEVELS
224
225     \c senfutil will detect the type of SENF library used (final or not) and set the correct compile
226     options.
227
228     \section senf_senfutil_loglevels Specifying compile-time loglevels
229
230     To simplify specifying the compile-time loglevel configuration, the build variable \c LOGLEVELS
231     (and it's build configuration specific variants) may be set. This variable will be parsed and
232     converted into the correct \c SENF_LOG_CONF definition. The \c LOGLEVELS Syntax is
233
234     \par "" \e optional_stream \c | \e optional_area | \e level
235
236     where \e optional_stream and \e optional_area are optional fully scoped C++ names (e.g. \c
237     senf::log::Debug) and \e level is the loglevel. There must be \e no whitespace in a single
238     specification, multiple specifications are either specified using an array or separated with
239     whitespace.
240
241     \section senf_senfutil_default Default options
242
243     In the example above, all compile options are set manually. To specify the default customary
244     compile options for SENF programs, \c senfutil.DefaultOptions(env) is provided. This function is
245     identical to:
246
247     \code
248     senfutil.DefaultOptions(env) =>
249         env.Append(
250             CXXFLAGS         = [ '-Wall', '-Woverloaded-virtual' ],
251             CXXFLAGS_final   = [ '-O2' ],
252             CXXFLAGS_normal  = [ '-O0', '-g' ],
253             CXXFLAGS_debug   = [ '$CXXFLAGS_normal' ],
254
255             LINKFLAGS_normal = [ '-Wl,-S' ],
256         )
257     \endcode
258
259     Thus above example can be simplified to
260     \code
261     import sys
262     sys.path.extend(('senf/site_scons','/usr/lib/senf/site_scons'))
263     import glob, senfutil
264
265     env = Environment()
266     senfutil.SetupForSENF(env)
267     senfutil.DefaultOptions(env)
268
269     env.Append( LOGLEVELS_debug  = [ 'senf::log::Debug||VERBOSE' ],
270                 PROJECTNAME      = 'Example project',
271                 PROJECTEMAIL     = 'developer@domain.com',
272                 DOCLINKS         = [ ('Homepage', 'http://www.domain.com') ] )
273
274     sources, tests = senfutil.Glob(env, exclude=['main.cc'] )
275
276     objects = env.Object(sources)
277     env.Default( env.Program( target='example', source=objects + ['main.cc'] ) )
278     env.BoostUnitTest( 'test', source=objects + tests)
279     senfutil.Doxygen(env)
280     \endcode
281
282     \section senf_senfutil_tests Building unit tests
283
284     Building unit tests mostly follows a standard pattern
285
286     \code
287     # Generate list of sources and tests (sources=*.cc, tests=*.test.cc)
288     extra_sources  = ['main.cc']
289     sources, tests = senfutil.Glob(env, exclude=extra_sources)
290
291     # Build object files needed for both main target and unit tests
292     objects = env.Object(sources)
293
294     # Build main target, e.g. a Binary with additional sources which are not part of the unit test
295     env.Program('example', objects+extra_sources)
296
297     # Build unit tests including additional test sources
298     env.BoostUnitTest('test', objects+tests)
299     \endcode
300
301     It is important to exclude the \c main function from the unit-test build since the boost unit
302     test library provides it's own.
303
304     \section senf_senfutil_doxygen Building documentation
305
306     Documentation is built using the \c senfutil.Doxygen utility
307
308     \code
309     env.Append( PROJECTNAME  = "Example project",
310                 PROJECTEMAIL = "coder@example.com",
311                 COPYRIGHT    = "The Master Coders",
312                 DOCLINKS     = [ ('Homeage', 'http://www.example.com') ],
313                 REVISION     = 'r'+os.popen('svnversion').read().strip().lower() )
314
315     senfutil.Doxygen(env)
316     \endcode
317
318     The \c senfutil.Doxygen utility autogenerates a \c Doxyfile.
319
320     The utility will search for a SENF documentation in the \c senfdoc and \c %senf subdirectories
321     as well as via the senfutil module directory and some other standard locations. If SENF
322     documentation is found, the SENF tagfiles will automatically be added. Links will be resolved
323     to the documentation found.
324
325     \c senfutil.Doxygen takes some additional optional keyword arguments:
326     \li \c doxyheader: Path of an alternative HTML header
327     \li \c doxyfooter: Path of an alternative HTML footer
328     \li \c doxycss: Path on an alternative CSS file
329     \li \c mydoxyfile: If set to \c True, don't generate or clean the \c Doxyfile\
330     \li \c senfdoc_path: List of additional directories to search for SENF documentation
331
332     \section senf_senfutil_arguments 'scons' Command line arguments
333
334     \c senfutil automatically parses SCons command line arguments into the SCons build
335     environment. This allows specifying any parameter on the command line:
336     <pre>
337     $ scons CXX=myg++ CXXFLAGS+=-mtune=geode
338     </pre>
339     You may either set variables unconditionally using '=' or append values to the end of a list
340     using '+='.
341  */
342
343 /** \page senf_usage Using the SENF framework
344
345     The SENF Framework is a collection of loosely coupled modules. The libraries are heavily object
346     oriented and template based. For compatibility reasons, the libraries are therefore built
347     together with every project making use of the framework.
348
349     When starting a new project based on the SENF framework, it is advisable, to make use of the
350     SENFSCons build environment and use SVN to manage the code repository. This is the
351     configuration, described in this documentation.
352
353     \see \ref senf_build \n
354          \ref senf_setup \n
355          \ref senf_components \n
356          \ref senf_overview
357
358     \section senf_preliminaries Preliminaries
359
360     Before starting the development, make sure to fulfill the following requirements:
361
362     \li GNU g++, version at least 3.4
363     \li The Boost libraries (http://www.boost.org)
364     \li The SCons build tool (http://www.scons.org)
365
366     If you want to build the documentation, you additionally need
367
368     \li Doxygen (http://www.doxygen.org)
369     \li The \c dia diagram editor (http://www.gnome.org/projects/dia/)
370     \li HTML \c tidy (http://tidy.sourceforge.net/)
371     \li The \c xsltproc XSLT processor (http://xmlsoft.org/XSLT/xsltproc2.html)
372     \li The \c graphviz library (http://www.graphviz.org)
373
374     The library is only tested with gcc-3.4 and 4.0 on Linux. On other POSIX platforms with a BSD
375     Socket API, the library should be usable, possibly with some tweaking (except for the Scheduler,
376     which relies on \c epoll)
377
378     \section senf_compiler_options Compiler and Linker Options
379
380     If SENF is compiled in debug mode (SENF_DEBUG is defined), exception messages will automatically
381     include a stack backtrace. For this to work, you need to add the -rdynamic option to all link
382     commands. This feature depends on gcc and the GNU-libc.
383
384     It is <B>very important</B> that both the SENF library and the application using it are compiled
385     \e both either with or without this compiler switch (-DSENF_DEBUG). Otherwise, the compiler will
386     emit error messages which might be hard to debug.
387  */
388
389 /** \page senf_build Building the SENF framework
390
391     This procedure will test building the complete framework including the unit tests and the
392     Sniffer test application. This build is \e not needed to use the framework since every project
393     will include the full SENF source code itself (via Subversion).
394
395     After you have successfully built the library tests, you can continue to setup your own project
396     using SENF.
397
398     \see \ref senf_setup \n
399          \ref senf_components \n
400          \ref senf_overview
401
402     \section senf_checkout Getting the code
403
404     To access the code, check out the code from the BerliOS repository. Change to your development
405     directory and use the following subversion command
406
407     <pre>
408     $ svn checkout http://svn.berlios.de/svnroot/repos/senf/trunk senf
409     </pre>
410
411     This will create a new directory \c senf within the current directory. For further documentation
412     on the use of Subversion, see the \c svn man-page or the subversion homepage at
413     http://subversion.tigris.org. A very good introduction and reference to subversion is available
414     at http://svnbook.red-bean.com.
415
416     \section senf_compile Building
417
418     To build the library, execute all unit tests and build the Sniffer test application, use
419
420     <pre>
421     $ scons
422     $ scons all_tests
423     </pre>
424
425     in the \c %senf directory. This assumes, that you want to build the library with your default
426     gcc and requires the boost libraries to be available in the system include paths. If this is
427     not the case, you can take a look at <tt>SConfig.template</tt> file. Copy this file to
428     <tt>SConfig</tt> and comment out all the variables you don't want to change (The \e values in
429     the template file are just arbitrary examples).
430  */
431
432 /** \page senf_setup Setting up a new project using SENF
433
434     The most simple way to use SENF for now is to checkout the svn repository and build SENF
435     yourselves. After you have built SENF, reference your SENF build directory from your build
436     environment. The most flexible way to do this, is to use a symbolic link to your SENF build.
437
438     Here an example \c SConstruct file for a project using SENF. This script expects SENF to be
439     found in the <tt>%senf</tt> sub-directory of the directory, where the \c SConstruct file is
440     found. This may either be a SENF checkout (if managing your project via subversion, you can use
441     <tt>svn:externals</tt> for this) or a symbolic link to your SENF checkout.
442
443     \code
444     import glob
445
446     env = Environment(
447
448         LIBS     = [ 'senf', 'boost_regex', 'boost_iostreams' ],
449         CXXFLAGS = [ '-Wall', '-Woverloaded-virtual', '-Wno-long-long' ],
450
451     )
452
453     env.Program(
454         target = 'mytarget',
455         source = glob.glob('*.cc'),
456     );
457     \endcode
458
459     When building against a self-built SENF which will probably be in debug mode, the '-DSENF_DEBUG'
460     option must be added to the compile command.
461
462     \see \ref senf_components \n
463          \ref senf_overview
464  */
465
466 /** \page senf_components The SENF modules
467
468     The framework is made up of several modular components. When using the library, it is possible
469     to selectively choose to use only a subset of the implemented modules.
470
471     \see \ref senf_overview
472
473     \section libPPI libPPI: Packet Processing Infrastructure
474
475     The Packet Processing Infrastructure implements a modular framework for implementing packet
476     oriented network applications. The library provides a large set of pre-defined modules as well
477     as the necessary helpers to implement application specific processing modules.
478
479     \see <a href="../../senf/PPI/doc/html/index.html">libPPI API reference</a>
480
481     \section libSocket libSocket: C++ abstraction of the BSD socket API
482
483     This library provides a high performance and object oriented abstraction of the standard socket
484     API. It utilizes a flexible and extensible policy based design. The library provides predefined
485     types for the important socket types (UDP and TCP sockets etc) including raw and packet sockets.
486
487     \see <a href="../../senf/Socket/doc/html/index.html">libSocket API reference</a>
488
489     \section libPackets libPackets: Network packet manipulation
490
491     This library provides a very flexible infrastructure to parse, create and otherwise manipulate
492     packetized network data. Included is a library of several protocol parsers covering the basic
493     IPv4 and IPv6 network protocols down to the Ethernet layer.
494
495     \see <a href="../../senf/Packets/doc/html/index.html">libPackets API reference</a>
496
497     \section libScheduler libScheduler: Asynchronous event handling
498
499     The scheduler library provides an object oriented interface to the standard UNIX \c select type
500     event dispatcher. It is based on the high performance \c epoll system call. It provides support
501     for read/write events as well as simple timer based events.
502
503     \see <a href="../../senf/Scheduler/doc/html/index.html">libScheduler API reference</a>
504
505     \section libUtils libUtils: Collection of arbitrary utilities
506
507     This library is used be most all of the other modules for miscellaneous tools and utilities. We
508     have
509
510     \li Simple functions to manage daemon processes
511     \li Standard exception classes
512     \li senf::intrusive_refcount to simplify the implementation of classes usable with
513         boost::intrusive_ptr
514     \li boost::bind extensions
515     \li An interface to the \c g++ de-mangler integrated with type_info
516     \li Typedefs and rudimentary methods to simplify handling high-resolution time values
517
518     \see <a href="../../senf/Utils/doc/html/index.html">libUtils API reference</a>
519
520     \section senfscons SENFSCons, the SENF build environment
521
522     SENF relies on SCons (http://www.scons.org) to build. To further simplify the common tasks, SENF
523     includes a library of custom routines and builders comprising a very concise build
524     environment. Included are a number of templates to help bootstrapping a new project or
525     component.
526
527     \see <a href="../../senfscons/doc/html/index.html">SENFSCons reference</a>
528  */
529
530 /** \page senf_overview Introduction to the framework
531
532     The SENF framework is relatively complex and makes use of advanced features of the C++
533     language. To make the most efficient use of the framework, you should have at least a basic
534     understanding of C++ templates and the standard library concepts.
535
536     The library implementation at places makes heavy use of advanced template techniques and relies
537     on some very advanced template libraries from Boost. The aim was however for the \e external
538     interface of the library to be as simple as possible without sacrificing important functionality
539     or adversely impacting the runtime performance.
540
541     As already mentioned several times, the library relies on Boost (http://www.boost.org) as a
542     generic library of high quality reusable C++ components. It also makes frequent use of the
543     standard library. It is designed, to integrate well into both libraries and to use the same
544     concepts and ideas.
545
546     \section senf_startup Getting starting developing with SENF
547
548     To introduce the framework and it's general structure, a simple example application is provided
549     in the SENF repository in the \c %Sniffer module. Peruse this example to get a first look at how
550     to make use of SENF.
551
552     When building a network Application with SENF, you will use several modules:
553
554     \li Use the <a href="../../senf/Socket/doc/html/index.html">Socket library</a> for network
555         communication needs. This library includes support for raw and packet sockets to allow low
556         level network access.
557     \li Use the <a href="../../senf/Scheduler/doc/html/index.html">Scheduler library</a> to
558         coordinate the asynchronous event processing. This drastically reduces the number of threads
559         needed in your application and will greatly enhance the overall responsiveness.
560     \li To interpret low level network packets, use the <a
561         href="../../senf/Packets/doc/html/index.html">Packets library</a>. This library will provide
562         efficient and convenient access to all protocol fields. It supports parsing as well as
563         modifying and creating packets. It has default support for the most important Internet
564         protocols and is highly extensible with new protocols.
565     \li Go over the <a href="../../senf/Utils/doc/html/index.html">Utils library</a>. It contains
566         small
567         helpers to simplify tasks like daemonization, exception handling, debugging and so on.
568
569     The simplest way to get started is: copy the Sniffer application and start to modify it.
570
571     \see <a href="../../Examples/doc/html/index.html">Examples</a> \n
572          \ref senf_components \n
573          \ref senf_setup
574
575     \section senf_conventions Coding Conventions
576
577     Here we have laid down the coding conventions used throughout the SENF framework. Please ad here
578     to these conventions when changing or adding code. If you use emacs, you can use the C++ IDE for
579     emacs from http://g0dil.de which greatly simplifies following these conventions.
580
581     \subsection senf_conventions_file_naming File Naming
582
583     Files should be named according to the main class they define. A single header file should
584     define only one main class. Exceptions to this rule are OK.
585
586     \par Rationale:
587         This simplifies finding the implementation/header for a given class and also reduces the
588         size of each single file.
589
590     The implementation is divided into a number of different files:
591
592     <table class="glossary"> <tr><td>\c .h</td><td>C public header</td></tr>
593
594     <tr><td>\c .hh</td><td>C++ public header</td></tr>
595
596     <tr><td>\c .ih</td><td>C++ internal header used only by the implementation. This header will
597     probably be included indirectly by the public header but is not meant to be perused by the
598     library user</td></tr>
599
600     <tr><td>\c .c</td><td>C implementation</td></tr>
601
602     <tr><td>\c .cc</td><td>C++ implementation of non-inline non-template functions and
603     members</td></tr>
604
605     <tr><td>\c .ct</td><td>C++ implementation of non-inline template functions and members</td></tr>
606
607     <tr><td>\c .cci</td><td>C++ implementation of inline non-template functions and
608     members</td></tr>
609
610     <tr><td>\c .cti</td><td>C++ implementation of inline template functions and members</td></tr>
611
612     <tr><td>\c .mpp</td><td>Special include file used for external iteration by the
613     Boost.Preprocessor library</td></tr> </table>
614
615     \par Rationale:
616         There are two part's to this: First, separating the implementation of inlines and templates
617         out of the header file makes the header file much easier to read. This is important, since
618         the header file will be used as a reference by the developers.
619     \par
620         Separating inline from non-inline members is used together with the \c prefix_ convention
621         below to ensure the correct placement of inline vs non-inline members in the source
622         code. The C++ language requires, that inline members must be included into \e every
623         compilation unit, non-inline members however must be included \e only in one compilation
624         unit. Placing the inline members into a separate file allows to automate this: Simply moving
625         an implementation from one of the inline files into one of the non-inline files will change
626         the type of implementation accordingly.
627
628     \subsection senf_conventions_type_naming Type Naming
629
630     SENF prefers the use of the CapitalziedLettersToSeparateWords convention for class names. In
631     this case, class names must start with a capital letter. There are some exceptions to this rule:
632     Types which define new basic data types to be used like other built-in types may be named using
633     lowercase letters plus underscores. Also, if a type or class is directly related to some other
634     library (STL or Boost) which uses the underscore convention, it might be more sensible to follow
635     this convention. This is open to debate.
636
637     \par Rationale:
638         Naming types with capital letters nicely gives a visual clue, that a symbol is a type
639         name. This can also be used by the editor to highlight type names correctly. Additionally,
640         this convention is compact and does not add additional or repeated overhead.
641
642     \subsection senf_conventions_impl Implementation
643
644     Only in very few places, SENF allows the use of inline implementations (not to be confused with
645     inline functions). An \e implementation is inline, if it is written directly into the class
646     definition in the header file. Again there are exceptions to this rule but they are very few:
647     \li When defining simple exception classes, the 'what()' member may be defined inline if it
648         returns a string constant.
649     \li It may be OK to use inline implementations for one-line implementations in internal
650         headers.
651     \li The Packet library allows inline implementations for the definition of parsers since doing
652         so outside the declaration just gets to verbose and parsers definitions are quite length but
653         very simple and straight forward.
654
655     \par Rationale:
656         Implementing members inline inside the class declaration makes the declaration much harder
657         to read. Since the declaration in the header file will be used as a reference by the
658         developer, the header files should be as readable as possible.
659
660     Every function or method implementation in one of the implementation files must \e always be
661     prefixed with \c prefix_. This symbol is defined at the beginning of the file and undefined at
662     the end. The symbol must be defined to be \c inline in the \c .cti and \c .cci files and must be
663     defined empty in the \c .cc and \c .ct files.
664
665     \par Rationale:
666         Together with splitting inlines and non-inlines into separate files, this allows to
667         automatically include the inline definitions at the right places. See above.
668
669     Private data members are named with a trailing underscore character.
670
671     \par Rationale:
672         This helps distinguishing local variables from parameter names. The trailing underscore
673         does not interfere with other naming conventions and is allowed by the standard (underscore
674         at the beginning of the name are problematic since some classes of names beginning with an
675         underscore are reserved for the standard library implementation)
676  */
677
678 \f
679 // :vim:textwidth=100
680 // Local Variables:
681 // mode: c++
682 // fill-column: 100
683 // c-file-style: "senf"
684 // indent-tabs-mode: nil
685 // ispell-local-dictionary: "american"
686 // compile-command: "scons doc"
687 // mode: flyspell
688 // mode: auto-fill
689 // End: