From d6f755a69a3e2a5e3be93ba2272280d4481d3ebd Mon Sep 17 00:00:00 2001 From: g0dil <g0dil@wiback.org> Date: Mon, 3 Nov 2008 14:17:08 +0000 Subject: [PATCH] More documentation --- Packets/Packet.hh | 4 +++- Packets/PacketImpl.hh | 16 ++++++++++++++++ Utils/Logger/SyslogTarget.hh | 11 +++++++++++ senf.dict | 5 +++++ 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/Packets/Packet.hh b/Packets/Packet.hh index 124e8bd73..bb2ac904c 100644 --- a/Packets/Packet.hh +++ b/Packets/Packet.hh @@ -339,7 +339,8 @@ namespace senf { If an annotation is \e not a POD type (more specifically, if it's constructor or destructor is not - trivial), the \a Annotation type \e must inherit from + trivial including base classes and members), the \a + Annotation type \e must inherit from senf::ComplexAnnotation. Failing to follow this rule will result in undefined behavior and will probably lead to a program crash. @@ -349,6 +350,7 @@ namespace senf { std::string value; }; \endcode + (This type is not POD since \c std::string is not POD) \implementation The annotation system is implemented quite efficiently since annotations are stored diff --git a/Packets/PacketImpl.hh b/Packets/PacketImpl.hh index 92738a462..4aa2d8c1f 100644 --- a/Packets/PacketImpl.hh +++ b/Packets/PacketImpl.hh @@ -40,6 +40,22 @@ namespace senf { + /** \brief Marker base-class for complex annotations + + This class is used as a base class to mark an annotation type as complex. A complex + annotation will have it's constructor/destructor called. Non-complex annotations will not + have their constructor called, they will be zero initialized. The destructor of non-complex + annotations is never called. + + An annotation must be marked as complex if it is not <a + href="http://en.wikipedia.org/wiki/Plain_Old_Data_Structures">POD</a>. Simplified, an + annotation must be marked as ComplexAnnotation, if + + \li it has a (user defined) constructor or destructor + \li it has any data members which have (user defined) constructors or destructors + + \see \ref packet_usage_annotation + */ struct ComplexAnnotation {}; namespace detail { diff --git a/Utils/Logger/SyslogTarget.hh b/Utils/Logger/SyslogTarget.hh index 70cf4e322..3de11ec78 100644 --- a/Utils/Logger/SyslogTarget.hh +++ b/Utils/Logger/SyslogTarget.hh @@ -50,6 +50,17 @@ namespace log { The default facility is <tt>LOG_USER</tt>. + The SENF log levels are mapped to syslog levels in the following way: + + <table class="senf fixedcolumn"> + <tr><td>senf::log::VERBOSE</td> <td>\c LOG_DEBUG</td></tr> + <tr><td>senf::log::NOTICE</td> <td>\c LOG_INFO</td></tr> + <tr><td>senf::log::MESSAGE</td> <td>\c LOG_NOTICE</td></tr> + <tr><td>senf::log::IMPORTANT</td> <td>\c LOG_WARNING</td></tr> + <tr><td>senf::log::CRITICAL</td> <td>\c LOG_CRIT</td></tr> + <tr><td>senf::log::FATAL</td> <td>\c LOG_EMERG</td></tr> + </table> + \ingroup targets */ class SyslogTarget diff --git a/senf.dict b/senf.dict index b34ca6968..807bc7fba 100644 --- a/senf.dict +++ b/senf.dict @@ -30,6 +30,7 @@ ArrayParser async attr Augustin +AUTHPRIV autoadd autoparse autoThrottling @@ -88,6 +89,7 @@ CPPPATH createAfter createBefore cref +CRON ct cti CXXFLAGS @@ -289,6 +291,7 @@ ListPolicy localAddr localhost loopback +LPR mac MACAddress MACAddressParser @@ -551,6 +554,8 @@ svnbook svnroot SyntaxErrorException SyntaxException +syslog +SyslogTarget SystemException TapSocketHandle td -- GitLab