use new doxygen command \tparam
[senf.git] / Socket / FileHandle.cc
index 7aa9e24..4ce3835 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
 #define prefix_
 ///////////////////////////////cc.p////////////////////////////////////////
 
+///////////////////////////////////////////////////////////////////////////
+// senf::FileBody
+
+prefix_ void senf::FileBody::close()
+{
+    if (!valid())
+        throwErrno(EBADF);
+    v_close();
+    fd_ = -1;
+}
+
+prefix_ void senf::FileBody::terminate()
+{
+    if (valid()) {
+        v_terminate();
+        fd_ = -1;
+    }
+}
+
+prefix_ void senf::FileBody::destroyClose()
+{
+    if (valid())
+        try {
+            close();
+        }
+        catch (...) {
+            terminate();
+        }
+}
+
 prefix_ void senf::FileBody::v_close()
 {
     if (::close(fd_) != 0)