Socket: Move protocol into the socket body (as private base class) and allow non...
[senf.git] / Socket / FileHandle.cci
index 62b9304..4ace14c 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 //
 // Copyright (C) 2006
-// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
-// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
-//     Stefan Bund <stefan.bund@fokus.fraunhofer.de>
+// Fraunhofer Institute for Open Communication Systems (FOKUS) 
+// Competence Center NETwork research (NET), St. Augustin, GERMANY 
+//     Stefan Bund <g0dil@berlios.de>
 //
 // 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
@@ -27,6 +27,7 @@
 //#include "FileHandle.ih"
 
 // Custom includes
+#include "../Utils/senfassert.hh"
 #include <errno.h>
 #include "../Utils/Exception.hh"
 
@@ -67,6 +68,11 @@ prefix_ void senf::FileBody::terminate()
     }
 }
 
+prefix_ senf::FileHandle senf::FileBody::handle()
+{
+    return FileHandle(ptr(this));
+}
+
 prefix_ int senf::FileBody::fd()
     const
 {
@@ -194,16 +200,20 @@ prefix_  senf::FileHandle::FileHandle(std::auto_ptr<FileBody> body)
     : body_(body.release())
 {}
 
+prefix_ senf::FileHandle::FileHandle(FileBody::ptr body)
+    : body_(body)
+{}
+
 prefix_ senf::FileBody & senf::FileHandle::body()
 {
-    BOOST_ASSERT(body_);
+    SENF_ASSERT(body_);
     return *body_;
 }
 
 prefix_ senf::FileBody const & senf::FileHandle::body()
     const
 {
-    BOOST_ASSERT(body_);
+    SENF_ASSERT(body_);
     return *body_;
 }