#include <cxxtools/selectable.h>

Inheritance diagram for cxxtools::Selectable:
cxxtools::IODevice cxxtools::net::TcpServer cxxtools::FileDevice cxxtools::net::TcpSocket

Public Types

enum  State { Disabled = 0, Idle = 1, Busy = 2, Avail = 3 }

Public Member Functions

virtual ~Selectable ()
void setSelector (SelectorBase *parent)
SelectorBaseselector () const
void close ()
 Closes the I/O device.
bool wait (Milliseconds msecs=WaitInfinite)
bool enabled () const
 Test if the I/O device object is enabled.
bool idle () const
bool busy () const
bool avail () const
virtual SelectableImpl & simpl ()=0

Static Public Attributes

static const std::size_t WaitInfinite = Selector::WaitInfinite

Protected Member Functions

 Selectable ()
 Default Constructor.
void setEnabled (bool isEnabled)
 Sets or unsets the device enabled.
void setState (State state)
virtual void onClose ()=0
 Closes the Selector.
virtual bool onWait (Timespan timeout)=0
virtual void onAttach (SelectorBase &)=0
virtual void onDetach (SelectorBase &)=0

Member Enumeration Documentation


Constructor & Destructor Documentation

virtual cxxtools::Selectable::~Selectable ( )


cxxtools::Selectable::Selectable ( )

Default Constructor.

Member Function Documentation

bool cxxtools::Selectable::avail ( ) const
bool cxxtools::Selectable::busy ( ) const
void cxxtools::Selectable::close ( )

Closes the I/O device.

Frees any resources associated with this object, like I/O handles.

bool cxxtools::Selectable::enabled ( ) const

Test if the I/O device object is enabled.

Test if the I/O device object is enabled i.e. open and ready to perform I/O operations

true if the I/O device is usable, false otherwise.
bool cxxtools::Selectable::idle ( ) const
virtual void cxxtools::Selectable::onAttach ( SelectorBase )
protectedpure virtual
virtual void cxxtools::Selectable::onClose ( )
protectedpure virtual
virtual void cxxtools::Selectable::onDetach ( SelectorBase )
protectedpure virtual
virtual bool cxxtools::Selectable::onWait ( Timespan  timeout)
protectedpure virtual
SelectorBase* cxxtools::Selectable::selector ( ) const
void cxxtools::Selectable::setEnabled ( bool  isEnabled)

Sets or unsets the device enabled.

void cxxtools::Selectable::setSelector ( SelectorBase parent)
void cxxtools::Selectable::setState ( State  state)
virtual SelectableImpl& cxxtools::Selectable::simpl ( )
pure virtual
bool cxxtools::Selectable::wait ( Milliseconds  msecs = WaitInfinite)

Member Data Documentation

const std::size_t cxxtools::Selectable::WaitInfinite = Selector::WaitInfinite

The documentation for this class was generated from the following file: