X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FProtocols%2FINet%2FINet4Address.hh;h=f40b6dc840244e26fbd88645d038af49fc41917c;hb=ced8f321adf904c31149162de5f6258c971c7466;hp=f0755556f882731a9a5d85effef34880573eed4c;hpb=fb08e3defcfb7cd8851ede0fab6cad424d168485;p=senf.git
diff --git a/Socket/Protocols/INet/INet4Address.hh b/Socket/Protocols/INet/INet4Address.hh
index f075555..f40b6dc 100644
--- a/Socket/Protocols/INet/INet4Address.hh
+++ b/Socket/Protocols/INet/INet4Address.hh
@@ -1,3 +1,5 @@
+// $Id$
+//
// Copyright (C) 2007
// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
@@ -42,7 +44,14 @@ namespace senf {
INet4Address represents a simple IP address. It is modelled as a fixed-size
container/sequence of 4 bytes.
+ \implementation We awkwardly need to use static named constructors (from_ members)
+ instead of ordinarily overloaded constructors for one simple reason: char *
+ doubles as string literal and as arbitrary data iterator. The iterator constructor can
+ therefore not be distinguished from initialization with a string literal. Therefore we
+ need to disambiguate using the named constructors.
+
\todo Add additional classes for CIDR addresses and networks and network math.
+ \ingroup addr_group
*/
class INet4Address
: public boost::array,
@@ -50,6 +59,9 @@ namespace senf {
{
public:
+ ///////////////////////////////////////////////////////////////////////////
+ // Types
+
typedef uint32_t address_type; ///< Address representation as number in host byte order
typedef uint32_t inaddr_type; ///< Legacy address representation in network byte order
typedef boost::function Callback;
@@ -61,8 +73,12 @@ namespace senf {
enum NoInit_t { noinit };
+ ///////////////////////////////////////////////////////////////////////////
+ ///\name Structors and default members
+ ///@{
+
INet4Address(); ///< Construct an empty address
- INet4Address(NoInit_t); ///< Construct uninitialized (!) address
+ explicit INet4Address(NoInit_t); ///< Construct uninitialized (!) address
explicit INet4Address(address_type value);
///< Construct an address constant
@@ -104,6 +120,11 @@ namespace senf {
code to convert a network byte order address in an
integer number into an INet4Address. */
+ ///@}
+ ///////////////////////////////////////////////////////////////////////////
+ ///\name Accessors
+ ///@{
+
bool local() const; ///< \c true, if address is locally administered
/**< This call checks, if the address is within one of the
IANA private ranges. */
@@ -125,6 +146,8 @@ namespace senf {
host byte order. This representation allows simple
network math operations. */
+ ////@}
+
struct SyntaxException : public std::exception
{ virtual char const * what() const throw() { return "invalid INet4 address syntax"; } };