use new doxygen command \tparam
[senf.git] / Socket / FileHandle.cc
index 97e554c..4ce3835 100644 (file)
@@ -1,8 +1,8 @@
 // $Id$
 //
 // Copyright (C) 2006
-// Fraunhofer Institute for Open Communication Systems (FOKUS) 
-// Competence Center NETwork research (NET), St. Augustin, GERMANY 
+// 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
 #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)