00001 #ifndef FileDescHolder_H 00002 #define FileDescHolder_H 00003 00004 #include "FileDescPool.h" 00005 00006 BOREALIS_NAMESPACE_BEGIN; 00007 00008 // For the entire time this object is instantiated, it holds a lock 00009 // on the specified mutex. 00010 class FileDescHolder 00011 { 00012 public: 00013 FileDescHolder(FileDescPool & poolToDrawFrom, bool blockToAcquire) 00014 throw (std::exception); 00015 00016 virtual ~FileDescHolder(); 00017 00018 int getFD(); 00019 private: 00020 FileDescPool & _pool; 00021 int _fd; 00022 }; 00023 00024 BOREALIS_NAMESPACE_END; 00025 00026 #endif