X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FProtocols%2FUN%2FUNAddressing.hh;h=c3d56bb14b1909b2cff24dc70878a910baf08032;hb=c7a635681a11cfa870626e3a5af8de150a6dc826;hp=1116d1b655a0c9946a05c2bb19a3abb07f45c933;hpb=01affde68cb93a334a2e6daabd2010b9a14b4553;p=senf.git diff --git a/Socket/Protocols/UN/UNAddressing.hh b/Socket/Protocols/UN/UNAddressing.hh index 1116d1b..c3d56bb 100644 --- a/Socket/Protocols/UN/UNAddressing.hh +++ b/Socket/Protocols/UN/UNAddressing.hh @@ -1,7 +1,9 @@ -// Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum NETwork research (NET) -// David Wagner +// $Id$ +// +// Copyright (C) 2007 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// David Wagner // // 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 @@ -29,19 +31,14 @@ #include #include #include -#include -#include -#include "boost/filesystem/path.hpp" -#include "../../../Socket/SocketPolicy.hh" -#include "../../../Socket/ClientSocketHandle.hh" -#include "../../../Socket/CommunicationPolicy.hh" #include "../../../Socket/Protocols/GenericAddressingPolicy.hh" #include "../../../Utils/safe_bool.hh" -#include "UNAddress.hh" //#include "UNAddressing.mpp" ///////////////////////////////hh.p//////////////////////////////////////// + namespace senf { + /** \brief Unix domain socket address UNSocketAddress wraps the standard sockaddr_un datatype. It provides simple accessor methods @@ -55,22 +52,28 @@ namespace senf { : public comparable_safe_bool { public: - - //UNSocketAddress(); - explicit UNSocketAddress(boost::filesystem::path p); + UNSocketAddress(); + explicit UNSocketAddress(std::string const & path); ///< Construct an address constant from given path - static UNSocketAddress from_string(std::string const s); ///< Create UNSocketAddress from string - static UNSocketAddress from_path(boost::filesystem::path const p); ///< Create UNSocketAddress from path - std::string path() const ; ///< Return path as string - struct sockaddr_un sockaddr(); + + bool operator==(UNSocketAddress const & other) const; + ///< Compare UNSocketAddress for equality + + std::string path() const ; ///< Return path as string + + bool boolean_test() const; ///< \c true, if address is not empty + + void clear(); ///< Clear address + struct sockaddr * sockaddr_p() ; struct sockaddr const * sockaddr_p() const; unsigned sockaddr_len() const; + private: - struct sockaddr_un sockAddr; + struct sockaddr_un addr_; }; - /** \brief Write path os + /** \brief Write path to os \related UNSocketAddress */ @@ -82,7 +85,7 @@ namespace senf { /** \brief Addressing policy supporting unix domain addressing \par Address Type: - UNAddress + UNSocketAddress This addressing policy implements addressing using unix domain addresses. @@ -102,7 +105,10 @@ namespace senf { using GenericAddressingPolicy::connect; using GenericAddressingPolicy::bind; }; + + ///@} } + ///////////////////////////////hh.e//////////////////////////////////////// //#include "UNAddressing.cci" //#include "UNAddressing.ct"