Loading...
Searching...
No Matches
MaskSet.h
Go to the documentation of this file.
// -*- c++ -*-
//------------------------------------------------------------------------------
// MaskSet.h
//------------------------------------------------------------------------------
// Copyright (c) 1999 by Vladislav Grinchenko
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//------------------------------------------------------------------------------
#ifndef MASK_SET_H
#define MASK_SET_H
#include "assa/FdSet.h"
namespace ASSA {
class MaskSet
{
public:
FdSet m_rset;
FdSet m_wset;
FdSet m_eset;
public:
void reset ();
void sync ();
int max_fd ();
void dump ();
};
inline void
MaskSet::
sync ()
{
m_rset.sync ();
m_wset.sync ();
m_eset.sync ();
}
inline void
MaskSet::
reset ()
{
m_rset.reset ();
m_wset.reset ();
m_eset.reset ();
}
inline int
MaskSet::
max_fd ()
{
return (std::max (m_rset.maxInSet (),
std::max (m_wset.maxInSet (),
m_eset.maxInSet ())));
}
inline void
MaskSet::
dump ()
{
DL((REACTTRACE,"+---------------------------\n"));
DL((REACTTRACE,"| RD FDs set %s\n", m_rset.dump_c_str ().c_str ()));
DL((REACTTRACE,"| WR FDs set %s\n", m_wset.dump_c_str ().c_str ()));
DL((REACTTRACE,"| EX FDs set %s\n", m_eset.dump_c_str ().c_str ()));
DL((REACTTRACE,"+---------------------------\n"));
}
} // end namespace ASSA
#endif /* MASK_SET_H */
FdSet.h
DL
#define DL(X)
A macro for writing debug message to the Logger.
Definition Logger.h:273
ASSA::FdSet
Class FdSet.
Definition FdSet.h:52
ASSA::FdSet::reset
void reset()
Reset every bit in the set (OFF).
Definition FdSet.cpp:90
ASSA::FdSet::sync
void sync()
Sync internals after used by select(3C)
Definition FdSet.cpp:72
ASSA::FdSet::dump_c_str
std::string dump_c_str()
Return object state dump as an ASCII string.
Definition FdSet.cpp:116
ASSA::FdSet::maxInSet
int maxInSet()
Find out the highest file descriptor in the set.
Definition FdSet.cpp:101
ASSA::MaskSet
Definition MaskSet.h:25
ASSA::MaskSet::m_rset
FdSet m_rset
Read fds set.
Definition MaskSet.h:28
ASSA::MaskSet::sync
void sync()
Resync internals after select() call.
Definition MaskSet.h:52
ASSA::MaskSet::m_eset
FdSet m_eset
Exception fds set.
Definition MaskSet.h:34
ASSA::MaskSet::max_fd
int max_fd()
Return maximum value of the file descriptor in the Set.
Definition MaskSet.h:71
ASSA::MaskSet::reset
void reset()
Clear all bits in all sets.
Definition MaskSet.h:62
ASSA::MaskSet::dump
void dump()
Write current state of MaskSet object to log file.
Definition MaskSet.h:80
ASSA::MaskSet::m_wset
FdSet m_wset
Write fds set.
Definition MaskSet.h:31
ASSA
Definition Acceptor.h:40
ASSA::REACTTRACE
@ REACTTRACE
Extended Reactor/PrioriyQueue messages
Definition LogMask.h:40