X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FGenericSockAddr.hh;h=8161c80a7b41f2ea7e47aa7c76cdb32867c8efdf;hb=9a988902090d28007578e93bffd809f6bd913155;hp=c05d1587a4cd8f6257d53e5b4d7e731e54be8fdc;hpb=b2d64a4084a053f0887c7845bb81074e0cd3a855;p=senf.git diff --git a/Socket/GenericSockAddr.hh b/Socket/GenericSockAddr.hh index c05d158..8161c80 100644 --- a/Socket/GenericSockAddr.hh +++ b/Socket/GenericSockAddr.hh @@ -1,6 +1,43 @@ // $Id$ // -// Copyright (C) 2006 +// Copyright (C) 2006 +// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) +// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief GenericSockAddr public header */ + +/** \defgroup addr_group Socket Addressing + + To support the core socket functionality we need a collection of classing providing addressing + for the different protocols. + + Every Address Implementation used with the standard policy classes Has to have a set of minimum + members. These members are documented in GenericSockAddr. However, these members are \e neither + abstract \e nor virtual and other address classes do \e not inherit from GenericSockAddr. The + address classes are not usable polymorphically for performance reasons. + + The interface defined above forces the implementation to be directly based on the corresponding + sockaddr data structures provided by the BSD socket API. These structures however are wrapped + into more flexible and more easy to use classes. Using the sockaddr representation increases the + performance since any intermediarre conversions are skipped. + */ #ifndef HH_GenericSockAddr_ #define HH_GenericSockAddr_ 1 @@ -11,23 +48,48 @@ //#include "GenericSockAddr.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -namespace satcom { -namespace lib { +namespace senf { + + /// \addtogroup addr_group + /// @{ + + /** \brief Generic protocol-independant socket address + This address type does not depend on the protocol of the socket. It does nowever not support + any protocol specific API, so access to the address is very limited. + */ class GenericSockAddr { public: - GenericSockAddr(); - - struct sockaddr * sockaddr_p(); - struct sockaddr const * sockaddr_p() const; - unsigned sockaddr_len() const; - + GenericSockAddr(); + + /// \name Generic Address Interface + /// @{ + + struct sockaddr * sockaddr_p(); ///< Return a pointer to sockaddr structure + /**< The exact structure pointed to depends on the address + family. The data pointed to must be \e mutable. The + value must be changeable and any change of the value + through this pointer must be reflected in the visible + address interface. + \returns non-const (!) pointer to sockaddr structure */ + struct sockaddr const * sockaddr_p() const; ///< Return a pointer to sockaddr structure + /**< This member is like sockaddr_p(), however it does not + allow changing the address. + \returns const pointer to sockaddr structure */ + unsigned sockaddr_len() const; ///< Return size of address + /**< This member return the size of the socket address + structure as returned by sockaddr_p() in bytes. + \returns size of respective sockaddr structure in bytes + */ + /// @} + private: - struct ::sockaddr_storage addr_; + struct ::sockaddr_storage addr_; }; -}} + /// @} +} ///////////////////////////////hh.e//////////////////////////////////////// #include "GenericSockAddr.cci" @@ -39,4 +101,8 @@ namespace lib { // Local Variables: // mode: c++ +// fill-column: 100 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" // End: