00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
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 }
00090
00091 #endif