libassa
3.5.0
|
00001 // -*- c++ -*- 00002 //------------------------------------------------------------------------------ 00003 // MaskSet.h 00004 //------------------------------------------------------------------------------ 00005 // Copyright (c) 1999 by Vladislav Grinchenko 00006 // 00007 // This library is free software; you can redistribute it and/or 00008 // modify it under the terms of the GNU Library General Public 00009 // License as published by the Free Software Foundation; either 00010 // version 2 of the License, or (at your option) any later version. 00011 //------------------------------------------------------------------------------ 00012 #ifndef MASK_SET_H 00013 #define MASK_SET_H 00014 00015 #include "assa/FdSet.h" 00016 00017 namespace ASSA { 00018 00024 class MaskSet 00025 { 00026 public: 00028 FdSet m_rset; 00029 00031 FdSet m_wset; 00032 00034 FdSet m_eset; 00035 00036 public: 00038 void reset (); 00039 00041 void sync (); 00042 00044 int max_fd (); 00045 00047 void dump (); 00048 }; 00049 00050 inline void 00051 MaskSet:: 00052 sync () 00053 { 00054 m_rset.sync (); 00055 m_wset.sync (); 00056 m_eset.sync (); 00057 } 00058 00059 00060 inline void 00061 MaskSet:: 00062 reset () 00063 { 00064 m_rset.reset (); 00065 m_wset.reset (); 00066 m_eset.reset (); 00067 } 00068 00069 inline int 00070 MaskSet:: 00071 max_fd () 00072 { 00073 return (std::max (m_rset.maxInSet (), 00074 std::max (m_wset.maxInSet (), 00075 m_eset.maxInSet ()))); 00076 } 00077 00078 inline void 00079 MaskSet:: 00080 dump () 00081 { 00082 DL((REACTTRACE,"+---------------------------\n")); 00083 DL((REACTTRACE,"| RD FDs set %s\n", m_rset.dump_c_str ().c_str ())); 00084 DL((REACTTRACE,"| WR FDs set %s\n", m_wset.dump_c_str ().c_str ())); 00085 DL((REACTTRACE,"| EX FDs set %s\n", m_eset.dump_c_str ().c_str ())); 00086 DL((REACTTRACE,"+---------------------------\n")); 00087 } 00088 00089 } // end namespace ASSA 00090 00091 #endif /* MASK_SET_H */