4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
6 // Stefan Bund <stefan.bund@fokus.fraunhofer.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #ifndef IH_FileHandle_
24 #define IH_FileHandle_ 1
27 #include <boost/intrusive_ptr.hpp>
28 #include "Utils/intrusive_refcount.hh"
30 ///////////////////////////////ih.p////////////////////////////////////////
38 : public satcom::lib::intrusive_refcount
41 ///////////////////////////////////////////////////////////////////////////
44 typedef boost::intrusive_ptr<FileBody> ptr;
46 ///////////////////////////////////////////////////////////////////////////
47 ///\name Structors and default members
50 explicit FileBody(int fd=-1);
54 // no conversion constructors
57 ///////////////////////////////////////////////////////////////////////////
65 bool readable() const;
66 void waitReadable() const;
67 bool writeable() const;
68 void waitWriteable() const;
70 bool blocking() const;
71 void blocking(bool status);
77 ///////////////////////////////////////////////////////////////////////////
78 // Virtual interface for subclasses to override
80 virtual void v_close();
81 virtual void v_terminate();
82 virtual bool v_eof() const;
83 virtual bool v_valid() const;
89 bool pollCheck(int fd, bool incoming, bool block=false) const;
96 ///////////////////////////////ih.e////////////////////////////////////////
102 // c-file-style: "satcom"