ESA JPIP server  0.1
net::PollTable Class Reference

This class allows to perfom polls easily over a vector of descriptors. More...

#include <poll_table.h>

Collaboration diagram for net::PollTable:

Public Member Functions

 PollTable ()
 
void Add (int fd, int mask)
 Adds a new file descriptor and mask to the vector. More...
 
int Poll (int timeout=-1)
 Peforms a poll over all the descriptors using the associated masks. More...
 
int GetSize () const
 Returns the size of the internal vector. More...
 
void Remove (int fd)
 Removes an item of the internal vector giving its file descriptor. More...
 
void RemoveAt (int n)
 Remove an item of the internal vector giving its index position. More...
 
PollFDoperator[] (int n)
 Indexing operator. More...
 
virtual ~PollTable ()
 

Private Attributes

vector< PollFDfds
 Vector with the file descriptors and masks for polling. More...
 

Detailed Description

This class allows to perfom polls easily over a vector of descriptors.

It uses an internal STL vector of PollFD objects to handle dinamically the file descriptors and masks.

See Also
PollFD

Constructor & Destructor Documentation

net::PollTable::PollTable ( )
inline
virtual net::PollTable::~PollTable ( )
inlinevirtual

Member Function Documentation

void net::PollTable::Add ( int  fd,
int  mask 
)
inline

Adds a new file descriptor and mask to the vector.

Parameters
fdFile descriptor.
maskPolling mask.

Here is the caller graph for this function:

int net::PollTable::GetSize ( ) const
inline

Returns the size of the internal vector.

Here is the caller graph for this function:

PollFD& net::PollTable::operator[] ( int  n)
inline

Indexing operator.

int net::PollTable::Poll ( int  timeout = -1)
inline

Peforms a poll over all the descriptors using the associated masks.

Parameters
timeoutTime out of the poll (infinite by default).
Returns
The value given by the kernel function poll.

Here is the caller graph for this function:

void net::PollTable::Remove ( int  fd)
inline

Removes an item of the internal vector giving its file descriptor.

Parameters
fdFile descriptor to remove.

Here is the caller graph for this function:

void net::PollTable::RemoveAt ( int  n)
inline

Remove an item of the internal vector giving its index position.

Parameters
nPosition of the item to remove.

Here is the caller graph for this function:

Member Data Documentation

vector<PollFD> net::PollTable::fds
private

Vector with the file descriptors and masks for polling.


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