PPI: Missing commit
[senf.git] / Socket / SocketHandle.hh
index 68cce02..36cac8c 100644 (file)
     \brief SocketHandle public header
  */
 
-#ifndef HH_SocketHandle_
-#define HH_SocketHandle_ 1
+#ifndef HH_SENF_Socket_SocketHandle_
+#define HH_SENF_Socket_SocketHandle_ 1
+
+//#include "SocketHandle.mpp"
+#include "SocketHandle.ih"
 
 // Custom includes
 #include <memory> // std::auto_ptr
 #include "FileHandle.hh"
 #include "SocketPolicy.hh"
 
-//#include "SocketHandle.mpp"
-#include "SocketHandle.ih"
 ///////////////////////////////hh.p////////////////////////////////////////
-#include "SocketHandle.ih"
 
 namespace senf {
 
@@ -44,20 +44,22 @@ namespace senf {
 
     /** \brief basic SocketHandle supporting protocol and policy abstraction
 
-        The senf::SocketHandle class introduces the two abstraction layers of the socket
+        The %senf::SocketHandle class introduces the two abstraction layers of the socket
         library. senf::SocketHandle does \e not provide socket functions it only provides the
         infrastructure necessary to support both, the protocol and the policy interface.
 
-        senf::SocketHandle takes the socket policy as a template argument. senf::SocketHandle also
+        %SocketHandle takes the socket policy as a template argument. %SocketHandle also
         introduces the protocol class. However, the class has no public constructors (see the
         derived classes senf::ProtocolClientSocketHandle and senf::ProtocolServerSocketHandle).
 
-        The most important functionality provided by senf::SocketHandle is the conversion
+        The most important functionality provided by %SocketHandle is the conversion
         constructor. This allows to implicitly convert between compatible socket handle types as
         specified by the socket policy. The conversion constructor is defined in such a way, that
         only valid conversions are possible (see the implementation source for a more complete
         discussion).
 
+        \tparam SPolicy socket policy
+
         \note This class is \e not meant to be used as a base-class outside the library
         implementation; The protected interface is for internal use only.
 
@@ -125,7 +127,7 @@ namespace senf {
 
                                              \param map string to string mapping to be filled with
                                                  state information
-                                             \param lod level of detail requested. The
+                                             \param lod level of %detail requested. The
                                                  interpretation of this value is protocol specific
 
                                              \implementation This member will be re-implemented in
@@ -138,13 +140,23 @@ namespace senf {
                                         /**< Formats the complete state map value and returns it as
                                              a single multi-line string.
 
-                                             \param lod level of detail requested. The
+                                             \param lod level of %detail requested. The
                                                 interpretation of this value is protocol specific
                                              
                                              \implementation This member will be re-implemented in
                                                  every derived class. See the state()
                                                  documentation. */
 
+        template <class Facet>
+        Facet & facet();                ///< Access a protocol facet
+                                        /**< This member will try to access the given protocol facet
+                                             of the socket. If \a Facet is a valid facet of the
+                                             protocol, it is returned, otherwise \c std::bad_cast
+                                             will be thrown.
+                                             \throws std::bad_cast if \a Facet is not a protocol
+                                                 facet of this socket
+                                             \returns the \a Facet protocol facet of this socket */
+
     protected:
         explicit SocketHandle(std::auto_ptr<SocketBody> body);
                                         ///< Initialize SocketHandle providing the protocol
@@ -178,7 +190,7 @@ namespace senf {
                                         /**< This member replaces the corresponding FileHandle
                                              member and returns an appropriately cast body
                                              reference */
-        SocketProtocol const & protocol() const;
+        SocketProtocol & protocol() const;
                                         ///< Access protocol class
 
         void assign(FileHandle other);  /**< \internal */