Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Xfc::G::PollFD Class Reference

A C++ wrapper for the GPollFD. More...

#include <xfc/glib/main.hh>

List of all members.

Public Member Functions

Accessors
Methods

Detailed Description

A C++ wrapper for the GPollFD.

PollFD is used to hold information about a file descriptor being watched (polled) for a particular context or event source.


Constructor & Destructor Documentation

Xfc::G::PollFD::PollFD ( int  fd  ) 

Constructs a new PollFD object for the file descriptor fd;.

Parameters:
fd The file descriptor to poll.

Xfc::G::PollFD::PollFD ( int  fd,
IOConditionField  events 
)

Constructs a new PollFD object that polls the specified events for the file descriptor fd;.

Parameters:
fd The file descriptor to poll.
events A bitwise combination of flags from G::IOCondition, specifying which events to poll for.
Typically for reading from a file descriptor you would use G::IO_IN | G::IO_HUP | G::IO_ERR, and for writing you would use G::IO_OUT | G::IO_ERR.

Xfc::G::PollFD::PollFD ( int  fd  ) 

Constructs a new PollFD object for the file descriptor fd;.

Parameters:
fd The file descriptor to poll.

Xfc::G::PollFD::PollFD ( int  fd,
IOConditionField  events 
)

Constructs a new PollFD object that polls the specified events for the file descriptor fd;.

Parameters:
fd The file descriptor to poll.
events A bitwise combination of flags from G::IOCondition, specifying which events to poll for.
Typically for reading from a file descriptor you would use G::IO_IN | G::IO_HUP | G::IO_ERR, and for writing you would use G::IO_OUT | G::IO_ERR.


Member Function Documentation

int Xfc::G::PollFD::fd (  )  const

Gets the file descriptor being polled.

Returns:
The file descriptor.

IOConditionField Xfc::G::PollFD::events (  )  const

Gets the events that should be polled for.

Returns:
A bitwise combination of flags from G::IOCondition.

IOConditionField Xfc::G::PollFD::revents (  )  const

Gets the bitwise combination of flags returned from poll() that indicate which events occurred.

Returns:
A bitwise combination of flags from G::IOCondition.

void Xfc::G::PollFD::set_fd ( int  fd  ) 

Sets the file descriptor to poll.

Parameters:
fd The file descriptor.

void Xfc::G::PollFD::set_events ( IOConditionField  events  ) 

Sets the events that should be polled for.

Parameters:
events A bitwise combination of flags from G::IOCondition.
Typically for reading from a file descriptor you would use G::IO_IN | G::IO_HUP | G::IO_ERR, and for writing you would use G::IO_OUT | G::IO_ERR.

void Xfc::G::PollFD::set ( int  fd,
IOConditionField  events 
)

Sets the file descriptor to poll and the events to poll for;.

Parameters:
fd The file descriptor to poll.
events A bitwise combination of flags from G::IOCondition, specifying which events to poll for.
Typically for reading from a file descriptor you would use G::IO_IN | G::IO_HUP | G::IO_ERR, and for writing you would use G::IO_OUT | G::IO_ERR.


The documentation for this class was generated from the following file: Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC 4.3