Packets: Add StringParser ostream operation
[senf.git] / Socket / SocketHandle.hh
index d1b4250..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 {
 
@@ -127,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
@@ -140,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
@@ -180,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 */