libassa  3.5.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MaskSet.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //------------------------------------------------------------------------------
3 // MaskSet.h
4 //------------------------------------------------------------------------------
5 // Copyright (c) 1999 by Vladislav Grinchenko
6 //
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Library General Public
9 // License as published by the Free Software Foundation; either
10 // version 2 of the License, or (at your option) any later version.
11 //------------------------------------------------------------------------------
12 #ifndef MASK_SET_H
13 #define MASK_SET_H
14 
15 #include "assa/FdSet.h"
16 
17 namespace ASSA {
18 
24 class MaskSet
25 {
26 public:
29 
32 
35 
36 public:
38  void reset ();
39 
41  void sync ();
42 
44  int max_fd ();
45 
47  void dump ();
48 };
49 
50 inline void
52 sync ()
53 {
54  m_rset.sync ();
55  m_wset.sync ();
56  m_eset.sync ();
57 }
58 
59 
60 inline void
63 {
64  m_rset.reset ();
65  m_wset.reset ();
66  m_eset.reset ();
67 }
68 
69 inline int
72 {
73  return (std::max (m_rset.maxInSet (),
74  std::max (m_wset.maxInSet (),
75  m_eset.maxInSet ())));
76 }
77 
78 inline void
80 dump ()
81 {
82  DL((REACTTRACE,"+---------------------------\n"));
83  DL((REACTTRACE,"| RD FDs set %s\n", m_rset.dump_c_str ().c_str ()));
84  DL((REACTTRACE,"| WR FDs set %s\n", m_wset.dump_c_str ().c_str ()));
85  DL((REACTTRACE,"| EX FDs set %s\n", m_eset.dump_c_str ().c_str ()));
86  DL((REACTTRACE,"+---------------------------\n"));
87 }
88 
89 } // end namespace ASSA
90 
91 #endif /* MASK_SET_H */