Add documentation on private data member naming convention
[senf.git] / Socket / Protocols / UN / UNAddress.hh
1 // Copyright (C) 2007 
2 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
3 // Kompetenzzentrum NETwork research (NET)
4 //     David Wagner <david.wagner@fokus.fraunhofer.de>
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the
18 // Free Software Foundation, Inc.,
19 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20
21 /** \file
22     \brief UNAddress public header */
23
24 #ifndef HH_UNAddress_
25 #define HH_UNAddress_ 1
26
27 // Custom includes
28 #include <string>
29 #include <boost/operators.hpp>
30 #include "../../../Utils/safe_bool.hh"
31
32 //#include "UNAddress.mpp"
33 ///////////////////////////////hh.p////////////////////////////////////////
34 namespace senf {
35     /** \brief Unix domain address
36         
37         UNAddress represents a simple unix domain address which is given by a path to a socket. 
38         It is modelled as a boost::filesystem::path.
39
40         \ingroup addr_group
41       */
42     class UNAddress 
43         : public comparable_safe_bool<UNAddress>
44     {   
45     public: 
46         UNAddress(); ///< Construct an empty address
47         explicit UNAddress(std::string);///< Construct an address constant from given path
48         static UNAddress fromString(std::string & s); ///< Convert string to address by interpreting the string as path
49         UNAddress clone(); ///< Clone object 
50         std::string pathString() const; ///< Return the path of the address as string
51
52         /** \brief Base-class for UNAddress exceptions */
53         struct AddressException : public std::exception {}; 
54
55     private:
56         std::string path;
57     };
58
59 std::ostream & operator<<(std::ostream & os, UNAddress const & addr);
60 }
61
62 ///////////////////////////////hh.e////////////////////////////////////////
63 //#include "UNAddress.cci"
64 //#include "UNAddress.ct"
65 //#include "UNAddress.cti"
66 #endif
67
68 \f
69 // Local Variables:
70 // mode: c++
71 // fill-column: 100
72 // comment-column: 40
73 // c-file-style: "senf"
74 // indent-tabs-mode: nil
75 // ispell-local-dictionary: "american"
76 // compile-command: "scons -u test"
77 // End: