Skip to content
Snippets Groups Projects
Commit 91b57305 authored by g0dil's avatar g0dil
Browse files

Utils: Revamp documentation overview and add some missing docs

Utils: Rename SafeBool to safe_bool (hmm ...)
parent b320cd8e
No related branches found
No related tags found
No related merge requests found
Showing
with 178 additions and 83 deletions
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <deque> #include <deque>
#include <boost/utility.hpp> #include <boost/utility.hpp>
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
#include "../Utils/SafeBool.hh" #include "../Utils/safe_bool.hh"
#include "../Packets/Packets.hh" #include "../Packets/Packets.hh"
#include "predecl.hh" #include "predecl.hh"
#include "detail/Callback.hh" #include "detail/Callback.hh"
...@@ -334,7 +334,7 @@ namespace connector { ...@@ -334,7 +334,7 @@ namespace connector {
*/ */
class PassiveInput class PassiveInput
: public PassiveConnector, public InputConnector, : public PassiveConnector, public InputConnector,
public SafeBool<PassiveInput> public safe_bool<PassiveInput>
{ {
public: public:
PassiveInput(); PassiveInput();
...@@ -362,7 +362,7 @@ namespace connector { ...@@ -362,7 +362,7 @@ namespace connector {
*/ */
class PassiveOutput class PassiveOutput
: public PassiveConnector, public OutputConnector, : public PassiveConnector, public OutputConnector,
public SafeBool<PassiveOutput> public safe_bool<PassiveOutput>
{ {
public: public:
ActiveInput & peer() const; ActiveInput & peer() const;
...@@ -378,7 +378,7 @@ namespace connector { ...@@ -378,7 +378,7 @@ namespace connector {
*/ */
class ActiveInput class ActiveInput
: public ActiveConnector, public InputConnector, : public ActiveConnector, public InputConnector,
public SafeBool<ActiveInput> public safe_bool<ActiveInput>
{ {
public: public:
PassiveOutput & peer() const; PassiveOutput & peer() const;
...@@ -395,7 +395,7 @@ namespace connector { ...@@ -395,7 +395,7 @@ namespace connector {
*/ */
class ActiveOutput class ActiveOutput
: public ActiveConnector, public OutputConnector, : public ActiveConnector, public OutputConnector,
public SafeBool<ActiveOutput> public safe_bool<ActiveOutput>
{ {
public: public:
PassiveInput & peer() const; PassiveInput & peer() const;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
// Custom includes // Custom includes
#include <deque> #include <deque>
#include "../Utils/SafeBool.hh" #include "../Utils/safe_bool.hh"
#include "../Packets/Packets.hh" #include "../Packets/Packets.hh"
#include "Module.hh" #include "Module.hh"
#include "ActiveFeeder.hh" #include "ActiveFeeder.hh"
...@@ -75,7 +75,7 @@ namespace debug { ...@@ -75,7 +75,7 @@ namespace debug {
*/ */
class ActiveSource class ActiveSource
: public Module, : public Module,
public SafeBool<ActiveSource> public safe_bool<ActiveSource>
{ {
SENF_PPI_MODULE(ActiveSource); SENF_PPI_MODULE(ActiveSource);
...@@ -136,7 +136,7 @@ namespace debug { ...@@ -136,7 +136,7 @@ namespace debug {
*/ */
class ActiveSink class ActiveSink
: public Module, : public Module,
public SafeBool<ActiveSink> public safe_bool<ActiveSink>
{ {
SENF_PPI_MODULE(ActiveSink); SENF_PPI_MODULE(ActiveSink);
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <boost/operators.hpp> #include <boost/operators.hpp>
#include "../Utils/Exception.hh" #include "../Utils/Exception.hh"
#include "../Utils/SafeBool.hh" #include "../Utils/safe_bool.hh"
#include "PacketInterpreter.hh" #include "PacketInterpreter.hh"
//#include "Packet.mpp" //#include "Packet.mpp"
...@@ -135,7 +135,7 @@ namespace senf { ...@@ -135,7 +135,7 @@ namespace senf {
\ref packetparser for a specification of the parser interface \ref packetparser for a specification of the parser interface
*/ */
class Packet class Packet
: public SafeBool<Packet>, : public safe_bool<Packet>,
public boost::equality_comparable<Packet> public boost::equality_comparable<Packet>
{ {
public: public:
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <boost/utility.hpp> #include <boost/utility.hpp>
#include <boost/type_traits.hpp> #include <boost/type_traits.hpp>
#include <boost/iterator/iterator_facade.hpp> #include <boost/iterator/iterator_facade.hpp>
#include "../Utils/SafeBool.hh" #include "../Utils/safe_bool.hh"
#include "PacketTypes.hh" #include "PacketTypes.hh"
//#include "PacketData.mpp" //#include "PacketData.mpp"
...@@ -175,7 +175,7 @@ namespace senf { ...@@ -175,7 +175,7 @@ namespace senf {
: public boost::iterator_facade< safe_data_iterator, : public boost::iterator_facade< safe_data_iterator,
PacketData::value_type, PacketData::value_type,
boost::random_access_traversal_tag >, boost::random_access_traversal_tag >,
public ComparableSafeBool<safe_data_iterator> public comparable_safe_bool<safe_data_iterator>
{ {
public: public:
typedef PacketData::size_type size_type; typedef PacketData::size_type size_type;
......
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
#include <boost/utility/enable_if.hpp> #include <boost/utility/enable_if.hpp>
#include <boost/type_traits.hpp> #include <boost/type_traits.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include "../Utils/SafeBool.hh" #include "../Utils/safe_bool.hh"
#include "PacketTypes.hh" #include "PacketTypes.hh"
#include "PacketData.hh" #include "PacketData.hh"
#include "ParseHelpers.hh" #include "ParseHelpers.hh"
...@@ -468,7 +468,7 @@ namespace senf { ...@@ -468,7 +468,7 @@ namespace senf {
*/ */
template <class Parser> template <class Parser>
class SafePacketParser class SafePacketParser
: public SafeBool< SafePacketParser<Parser> > : public safe_bool< SafePacketParser<Parser> >
{ {
public: public:
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
// Custom includes // Custom includes
#include <memory> // std::auto_ptr #include <memory> // std::auto_ptr
#include "../Utils/SafeBool.hh" #include "../Utils/safe_bool.hh"
//#include "FileHandle.mpp" //#include "FileHandle.mpp"
///////////////////////////////hh.p//////////////////////////////////////// ///////////////////////////////hh.p////////////////////////////////////////
...@@ -100,7 +100,7 @@ namespace senf { ...@@ -100,7 +100,7 @@ namespace senf {
senf::FileBody. senf::FileBody.
*/ */
class FileHandle class FileHandle
: public SafeBool<FileHandle> : public safe_bool<FileHandle>
{ {
public: public:
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#include <boost/array.hpp> #include <boost/array.hpp>
#include <boost/operators.hpp> #include <boost/operators.hpp>
#include "../../../Utils/SafeBool.hh" #include "../../../Utils/safe_bool.hh"
//#include "INet4Address.mpp" //#include "INet4Address.mpp"
///////////////////////////////hh.p//////////////////////////////////////// ///////////////////////////////hh.p////////////////////////////////////////
...@@ -56,7 +56,7 @@ namespace senf { ...@@ -56,7 +56,7 @@ namespace senf {
*/ */
class INet4Address class INet4Address
: public boost::array<boost::uint8_t,4>, : public boost::array<boost::uint8_t,4>,
public ComparableSafeBool<INet4Address> public comparable_safe_bool<INet4Address>
{ {
public: public:
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
...@@ -193,7 +193,7 @@ namespace senf { ...@@ -193,7 +193,7 @@ namespace senf {
*/ */
class INet4Network class INet4Network
: public boost::equality_comparable<INet4Network>, : public boost::equality_comparable<INet4Network>,
public ComparableSafeBool<INet4Network> public comparable_safe_bool<INet4Network>
{ {
public: public:
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#include <boost/array.hpp> #include <boost/array.hpp>
#include <boost/operators.hpp> #include <boost/operators.hpp>
#include "../../../Utils/SafeBool.hh" #include "../../../Utils/safe_bool.hh"
#include "INet4Address.hh" #include "INet4Address.hh"
//#include "INet6Address.mpp" //#include "INet6Address.mpp"
...@@ -97,7 +97,7 @@ namespace senf { ...@@ -97,7 +97,7 @@ namespace senf {
*/ */
class INet6Address class INet6Address
: public boost::array<boost::uint8_t,16>, : public boost::array<boost::uint8_t,16>,
public ComparableSafeBool<INet6Address> public comparable_safe_bool<INet6Address>
{ {
public: public:
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
...@@ -294,7 +294,7 @@ namespace senf { ...@@ -294,7 +294,7 @@ namespace senf {
*/ */
class INet6Network class INet6Network
: public boost::equality_comparable<INet6Network>, : public boost::equality_comparable<INet6Network>,
public ComparableSafeBool<INet6Network> public comparable_safe_bool<INet6Network>
{ {
public: public:
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "../../../Socket/ClientSocketHandle.hh" #include "../../../Socket/ClientSocketHandle.hh"
#include "../../../Socket/CommunicationPolicy.hh" #include "../../../Socket/CommunicationPolicy.hh"
#include "../../../Socket/Protocols/GenericAddressingPolicy.hh" #include "../../../Socket/Protocols/GenericAddressingPolicy.hh"
#include "../../../Utils/safe_bool.hh"
#include "INet4Address.hh" #include "INet4Address.hh"
#include "INet6Address.hh" #include "INet6Address.hh"
...@@ -56,7 +57,7 @@ namespace senf { ...@@ -56,7 +57,7 @@ namespace senf {
*/ */
class INet4SocketAddress class INet4SocketAddress
: public boost::equality_comparable<INet4SocketAddress>, : public boost::equality_comparable<INet4SocketAddress>,
public senf::ComparableSafeBool<INet4SocketAddress> public senf::comparable_safe_bool<INet4SocketAddress>
{ {
public: public:
INet4SocketAddress(); INet4SocketAddress();
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include <boost/array.hpp> #include <boost/array.hpp>
#include <boost/utility.hpp> #include <boost/utility.hpp>
#include <boost/type_traits.hpp> #include <boost/type_traits.hpp>
#include "../../../Utils/SafeBool.hh" #include "../../../Utils/safe_bool.hh"
//#include "MACAddress.mpp" //#include "MACAddress.mpp"
///////////////////////////////hh.p//////////////////////////////////////// ///////////////////////////////hh.p////////////////////////////////////////
...@@ -51,7 +51,7 @@ namespace senf { ...@@ -51,7 +51,7 @@ namespace senf {
*/ */
struct MACAddress struct MACAddress
: public boost::array<boost::uint8_t,6>, : public boost::array<boost::uint8_t,6>,
public ComparableSafeBool<MACAddress> public comparable_safe_bool<MACAddress>
{ {
static MACAddress const Broadcast; ///< The broadcast address static MACAddress const Broadcast; ///< The broadcast address
static MACAddress const None; ///< The empty (0) address static MACAddress const None; ///< The empty (0) address
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <string> #include <string>
#include <boost/operators.hpp> #include <boost/operators.hpp>
#include <boost/filesystem/path.hpp> #include <boost/filesystem/path.hpp>
#include "../../../Utils/SafeBool.hh" #include "../../../Utils/safe_bool.hh"
//#include "UNAddress.mpp" //#include "UNAddress.mpp"
///////////////////////////////hh.p//////////////////////////////////////// ///////////////////////////////hh.p////////////////////////////////////////
...@@ -42,7 +42,7 @@ namespace senf { ...@@ -42,7 +42,7 @@ namespace senf {
*/ */
class UNAddress class UNAddress
: public boost::filesystem::path, : public boost::filesystem::path,
public ComparableSafeBool<UNAddress> public comparable_safe_bool<UNAddress>
{ {
public: public:
UNAddress(); ///< Construct an empty address UNAddress(); ///< Construct an empty address
......
...@@ -28,8 +28,7 @@ ...@@ -28,8 +28,7 @@
#include <stdio.h> #include <stdio.h>
#include <boost/operators.hpp> #include <boost/operators.hpp>
#include <boost/filesystem/path.hpp> #include <boost/filesystem/path.hpp>
#include "../../../Utils/SafeBool.hh"
//#include "UNAddressing.mpp"
#define prefix_ #define prefix_
///////////////////////////////cc.p//////////////////////////////////////// ///////////////////////////////cc.p////////////////////////////////////////
prefix_ senf::UNSocketAddress::UNSocketAddress(boost::filesystem::path p) prefix_ senf::UNSocketAddress::UNSocketAddress(boost::filesystem::path p)
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "../../../Socket/ClientSocketHandle.hh" #include "../../../Socket/ClientSocketHandle.hh"
#include "../../../Socket/CommunicationPolicy.hh" #include "../../../Socket/CommunicationPolicy.hh"
#include "../../../Socket/Protocols/GenericAddressingPolicy.hh" #include "../../../Socket/Protocols/GenericAddressingPolicy.hh"
#include "../../../Utils/safe_bool.hh"
#include "UNAddress.hh" #include "UNAddress.hh"
//#include "UNAddressing.mpp" //#include "UNAddressing.mpp"
...@@ -51,7 +52,7 @@ namespace senf { ...@@ -51,7 +52,7 @@ namespace senf {
\ingroup addr_group \ingroup addr_group
*/ */
class UNSocketAddress class UNSocketAddress
: public ComparableSafeBool<UNSocketAddress> : public comparable_safe_bool<UNSocketAddress>
{ {
public: public:
......
...@@ -39,45 +39,43 @@ namespace senf { ...@@ -39,45 +39,43 @@ namespace senf {
/** \brief Exception handling standard UNIX errors (errno) /** \brief Exception handling standard UNIX errors (errno)
This exception is thrown to signal generic errno failures. This exception is thrown to signal generic \c errno failures. In addition to the \c errno
number (the code()), this class manages optional origin information. This parameter should
be provided to further describe, in what context the exception was created.
\todo make where and err accessors and make the member variables private This exception should not be used directly. Instead the derived class ErrnoException should
be thrown via one of the senf::throwErrno() helpers.
\idea Add a template class derived from SystemException which takes the error number as a \see ErrnoException
numeric argument. This allows catching specific errno conditions: ErrnoException<EPIPE> etc.
\idea Add a generic error thrower which takes the origin string and errno value as an
argument and will throw a corresponding template class instance. This would just be a big
switch statement containing all possible errno values, probably created using some macro
meta-programming.
*/ */
class SystemException : public std::exception class SystemException : public std::exception
{ {
public: public:
SystemException(); ///< SystemException without error location infor SystemException(); ///< SystemException without error location infor
/**< The error code is taken from the current value of the /**< The error code is taken from the current value of the
global 'errno' variable */ global \c errno variable */
explicit SystemException(int code); ///< SystemException without error location info explicit SystemException(int code); ///< SystemException without error location info
/**< \param[in] code error number (the errno value) */ /**< \param[in] code error number (the \c errno value) */
explicit SystemException(char const * where); ///< SystemException with error location info explicit SystemException(char const * where); ///< SystemException with error location info
/**< The error code is taken from the current value of the /**< The error code is taken from the current value of the
global 'errno' variable global \c errno variable
\param[in] where description of error origin */ \param[in] where description of error origin */
SystemException(char const * where, int code); ///< SystemException with error location info SystemException(char const * where, int code); ///< SystemException with error location info
/**< \param[in] where description of error origin /**< \param[in] where description of error origin
\param[in] code error number (the errno value) */ \param[in] code error number (the \c errno value) */
virtual char const * what() const throw(); ///< Return verbose error description virtual char const * what() const throw(); ///< Return verbose error description
char const * where() const; ///< Error origin char const * where() const; ///< Error origin
int code() const; ///< Error code (errno number) int code() const; ///< Error code (\c errno number)
char const * description() const; ///< Error description (strerror() value) char const * description() const; ///< Error description (strerror() value)
bool anyOf(int c0, int c1=0, int c2=0, int c3=0, int c4=0, int c5=0, bool anyOf(int c0, int c1=0, int c2=0, int c3=0, int c4=0, int c5=0,
int c6=0, int c7=0, int c8=0, int c9=0); int c6=0, int c7=0, int c8=0, int c9=0);
///< \c true, if code() is one of \a c0 ... \a c9
virtual ~SystemException() throw(); virtual ~SystemException() throw();
...@@ -85,23 +83,54 @@ namespace senf { ...@@ -85,23 +83,54 @@ namespace senf {
void init(); void init();
char const * const where_; char const * const where_;
int const code_; int const code_; // This must be const to make the derived ErrnoException
// class a valid derived class.
std::string buffer_; std::string buffer_;
}; };
/** \brief Error specific system exception
This template restricts the generic SystemException to a specific, compile-time constant
error number \p Code. This allows a specific \c errno number to be cached explicitly.
This exception is normally thrown via one of the senf::throwErrno() helpers. These helpers
take the numeric \c errno value (either from the \c errno variable or from their
argument) and will throw the corresponding ErrnoException:
\code
if ((fd = ::open(filename, O_RDWR)) < 0)
senf::throwErrno("open()");
\endcode
*/
template <int Code> template <int Code>
class ErrnoException : public SystemException class ErrnoException : public SystemException
{ {
public: public:
static int const fixed_code = Code; static int const fixed_code = Code;
ErrnoException(); ErrnoException(); ///< ErrnoException without error location information
explicit ErrnoException(char const * where); explicit ErrnoException(char const * where);
///< ErrnoException with error location information
}; };
/** \brief Throw ErrnoException based on current \c errno value
\related ErrnoException
*/
void throwErrno(); void throwErrno();
/** \brief Throw ErrnoException based on current \c errno value (with location info)
\related ErrnoException
*/
void throwErrno(char const * where); void throwErrno(char const * where);
/** \brief Throw ErrnoException based on given \c errno value
\related ErrnoException
*/
void throwErrno(int code); void throwErrno(int code);
/** \brief Throw ErrnoException based on given \c errno value (with location info)
\related ErrnoException
*/
void throwErrno(char const * where, int code); void throwErrno(char const * where, int code);
enum NoThrow_t { nothrow }; enum NoThrow_t { nothrow };
......
...@@ -34,7 +34,17 @@ ...@@ -34,7 +34,17 @@
namespace senf { namespace senf {
/** \brief /** \brief Calculate TCP/IP 16bit checksum value
This class allows calculation of the 16bit checksum value as defined in the TCP/IP v4
RFC's. This checksum is \e not a CRC.
To calculate the checksum, you create an instance of IpChecksum. You then repeatedly call
the feed() members to pass data in. After all data has been processed, the sum() member will
return the calculated checksum.
The mathematical properties of the checksum allow to skip any \e even number of zero bytes
without changing the checksum value.
*/ */
class IpChecksum class IpChecksum
{ {
...@@ -51,12 +61,13 @@ namespace senf { ...@@ -51,12 +61,13 @@ namespace senf {
///@} ///@}
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
void feed(boost::uint8_t byte); void feed(boost::uint8_t byte); ///< Feed single byte
template <class InputIterator> template <class InputIterator>
void feed(InputIterator b, InputIterator e); void feed(InputIterator b, InputIterator e);
///< Feed range of bytes
boost::uint16_t sum() const; boost::uint16_t sum() const; ///< Calculate checksum
protected: protected:
......
...@@ -2,46 +2,79 @@ namespace senf { ...@@ -2,46 +2,79 @@ namespace senf {
/** \mainpage The SENF Utilities Library /** \mainpage The SENF Utilities Library
The Utilities Library is a collection of independent utilities. We have The Utilities Library is a collection of independent utilities.
<dl>
<dt>SystemException</dt><dd>standard exception for system errors (errno)</dd> \section basic_helpers C++ Language helpers and simple library extensions
<dt>\ref process</dt><dd>Some simple process management and daemon helpers<?dd> <table class="listing">
<tr><td>\ref membind</td><td>a simple <a
href="http://www.boost.org/libs/bind/bind.html">Boost.Bind</a> extension</td></tr>
<dt>\ref membind</dt><dd>a simple <a <tr><td>\ref senfmpl</td><td>Some simple tools which help to solve common meta-programming
href="http://www.boost.org/libs/bind/bind.html">Boost.Bind</a> extension</dd> tasks</td></tr>
<dt>intrusive_refcount</dt><dd>mixin to simplify writing classes for use with <a <tr><td>\ref senfpp</td><td>Extensions to the Boost.Preprocessor library</td></tr>
href="http://www.boost.org/libs/smart_ptr/intrusive_ptr.html">boost::intrusive_ptr</a></dd> </table>
<dt>SafeBool</dt><dd>a mixin class to provide a really safe replacement for <tt>operator
bool</tt></dd> \section basic_mixins Basic mixin classes
<table class="listing">
<tr><td>\ref intrusive_refcount</td><td>mixin to simplify writing classes for use with <a
href="http://www.boost.org/libs/smart_ptr/intrusive_ptr.html">boost::intrusive_ptr</a></td></tr>
<tr><td>\ref safe_bool</td><td>a mixin class to provide a really safe replacement for
<tt>operator bool</tt>
<dt>pool_alloc_mixin</dt><dd>mixin to provide pool allocation to a class</dd> <tr><td>\ref singleton</td><td>mixin to make a class a singleton</td></tr>
</table>
\section memory_management Memory Management
<table class="listing">
<tr><td>\ref SENF_SCOPED_BUFFER</td><td>a portable way to efficiently allocate temporary
buffers</td></tr>
<tr><td>\ref pool_alloc_mixin</td><td>mixin to provide pool allocation to a class</td></tr>
<dt>\ref singleton</dt><dd>mixin to make a class a singleton</dd> <tr><td>\ref contiguous_storage_iterator</td><td>traits class to check iterator type for raw
pointer accessibility</td></tr>
</table>
<dt>prettyName()</dt><dd>an interface to the C++ demangler of g++ to get formated type names
from typeinfo objects</dd>
<dt>\ref SENF_SCOPED_BUFFER</dt><dd>a portable way to efficiently allocate temporary \section typeinfo C++ Type interface
buffers</dd>
<dt>\ref contiguous_storage_iterator</dt><dd>traits class to check iterator type for raw pointer <table class="listing">
accessibility</dd> <tr><td>\ref prettyName()</td><td>an interface to the C++ demangler of g++ to get formated type
names from typeinfo objects</td></tr>
<dt>\ref TypeIdValue</dt><dd>class wrapping a typeid in a way that it can be used like any other <tr><td>\ref TypeIdValue</td><td>class wrapping a typeid in a way that it can be used like any
value type, e.g. as the key in a map.</dd> other value type, e.g. as the key in a map.</td></tr>
</table>
<dt>\ref hexdump<dt><dd>a simple but usefull function to write binary data in in hexadecimal
format.</dd>
<dt>\ref senfmpl</dt><dd>Some simple tools which help to solve common meta-programming \section miscstuff Miscellaneous
tasks</dd>
<table class="listing">
<tr><td>\ref SystemException</td><td>standard exception for system errors (errno)</td></tr>
<tr><td>\ref process</td><td>Some simple process management and daemon helpers</td></tr>
<tr><td>\ref hexdump</td><td>a simple but usefull function to write binary data in in
hexadecimal format.</td></tr>
<tr><td>\ref IpChecksum</td><td>calculating the 16 bit checksum used in the IP
specification</td></tr>
</table>
\section compatibility Compatibility
</dl> <table class="listing">
<tr><td>\ref auto_unit_test.hh</td><td>Boost auto unit test compatibility across Boost versions
1.33 and 1.34</td></tr>
</table>
*/ */
} }
...@@ -53,6 +86,5 @@ namespace senf { ...@@ -53,6 +86,5 @@ namespace senf {
// c-file-style: "senf" // c-file-style: "senf"
// indent-tabs-mode: nil // indent-tabs-mode: nil
// ispell-local-dictionary: "american" // ispell-local-dictionary: "american"
// mode: flyspell
// mode: auto-fill // mode: auto-fill
// End: // End:
...@@ -21,7 +21,15 @@ ...@@ -21,7 +21,15 @@
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file /** \file
\brief auto_unit_test public header */ \brief Boost.Test auto unit test compatibility across Boost V 1.33 and 1.34
This header file will allows to consistently use the Boost Version 1.33 syntax for defining auto
unit tests. If the available Boost version is 1.34, this file will automatically take care of
any necessary workarounds.
So, instead of <tt>#include <boost/test/auto_unit_test.hpp></tt>, you should always write
<tt>#include "../Utils/auto_unit_test.hh"<tt> (with possibliy adjusted path).
*/
#ifndef HH_auto_unit_test_ #ifndef HH_auto_unit_test_
#define HH_auto_unit_test_ 1 #define HH_auto_unit_test_ 1
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
namespace senf { namespace senf {
namespace mpl { namespace mpl {
/** \defgroup senfmpl Low-level template meta programming helpers /** \defgroup senfmpl Template meta programming helpers
*/ */
/** \brief Marker class for empty default values etc. /** \brief Marker class for empty default values etc.
......
...@@ -34,8 +34,21 @@ ...@@ -34,8 +34,21 @@
//#include "preprocessor.mpp" //#include "preprocessor.mpp"
///////////////////////////////hh.p//////////////////////////////////////// ///////////////////////////////hh.p////////////////////////////////////////
/** \defgroup senfpp Preprocessor meta programming macros
preprocessor.hh provides some additional helper macros based on the Boost.Preprocessor library.
*/
///\{
///\ingroup senfpp
/** \brief Return last element of a sequence
\hideinitializer
*/
#define SENF_PP_SEQ_BACK(seq) BOOST_PP_SEQ_ELEM(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)),seq) #define SENF_PP_SEQ_BACK(seq) BOOST_PP_SEQ_ELEM(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)),seq)
///\}
///////////////////////////////hh.e//////////////////////////////////////// ///////////////////////////////hh.e////////////////////////////////////////
//#include "preprocessor.cci" //#include "preprocessor.cci"
//#include "preprocessor.ct" //#include "preprocessor.ct"
......
// $Id$ // $Id$
// //
// Copyright (C) 2007 // Copyright (C) 2007
...@@ -21,29 +22,29 @@ ...@@ -21,29 +22,29 @@
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file /** \file
\brief SafeBool inline non-template implementation */ \brief safe_bool inline non-template implementation */
// Custom includes // Custom includes
#define prefix_ inline #define prefix_ inline
///////////////////////////////cci.p/////////////////////////////////////// ///////////////////////////////cci.p///////////////////////////////////////
prefix_ void senf::SafeBoolBase::this_type_does_not_support_comparisons() prefix_ void senf::safe_bool_base::this_type_does_not_support_comparisons()
const const
{} {}
prefix_ senf::SafeBoolBase::SafeBoolBase() prefix_ senf::safe_bool_base::safe_bool_base()
{} {}
prefix_ senf::SafeBoolBase::SafeBoolBase(const SafeBoolBase&) prefix_ senf::safe_bool_base::safe_bool_base(const safe_bool_base&)
{} {}
prefix_ senf::SafeBoolBase& senf::SafeBoolBase::operator=(const SafeBoolBase&) prefix_ senf::safe_bool_base& senf::safe_bool_base::operator=(const safe_bool_base&)
{ {
return *this; return *this;
} }
prefix_ senf::SafeBoolBase::~SafeBoolBase() prefix_ senf::safe_bool_base::~safe_bool_base()
{} {}
///////////////////////////////cci.e/////////////////////////////////////// ///////////////////////////////cci.e///////////////////////////////////////
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment