Open Lighting Architecture  0.9.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
ola::io::BidirectionalFileDescriptor Class Reference

Detailed Description

A file descriptor that supports both read & write.

Inheritance diagram for ola::io::BidirectionalFileDescriptor:
ola::io::ReadFileDescriptor ola::io::WriteFileDescriptor ola::io::ConnectedDescriptor ola::io::UnmanagedFileDescriptor ola::network::UDPSocketInterface ola::io::DeviceDescriptor ola::io::LoopbackDescriptor ola::io::PipeDescriptor ola::io::UnixSocket ola::network::TCPSocket ola::network::UDPSocket ola::testing::MockUDPSocket

Public Member Functions

void SetOnData (ola::Callback0< void > *on_read)
 Set the callback to be run when data is available for reading.
void SetOnWritable (ola::Callback0< void > *on_write)
 Set the callback to be run when the descriptor can be written to.
void PerformRead ()
 Called when there is data available on the descriptor.
void PerformWrite ()
 Called when the descriptor can be written to.
- Public Member Functions inherited from ola::io::ReadFileDescriptor
virtual DescriptorHandle ReadDescriptor () const =0
 Returns the read descriptor for this socket.
bool ValidReadDescriptor () const
 Check if this file descriptor is valid.
- Public Member Functions inherited from ola::io::WriteFileDescriptor
virtual DescriptorHandle WriteDescriptor () const =0
 Returns the write descriptor for this socket.
bool ValidWriteDescriptor () const
 Check if this file descriptor is valid.

Member Function Documentation

void ola::io::BidirectionalFileDescriptor::PerformRead ( )
virtual

Called when there is data available on the descriptor.

This is usually called by the SelectServer.

Implements ola::io::ReadFileDescriptor.

void ola::io::BidirectionalFileDescriptor::PerformWrite ( )
virtual

Called when the descriptor can be written to.

This is usually called by the SelectServer.

Implements ola::io::WriteFileDescriptor.

void ola::io::BidirectionalFileDescriptor::SetOnData ( ola::Callback0< void > *  on_read)
inline

Set the callback to be run when data is available for reading.

Parameters
on_readthe callback to run, ownership of the callback is transferred.
void ola::io::BidirectionalFileDescriptor::SetOnWritable ( ola::Callback0< void > *  on_write)
inline

Set the callback to be run when the descriptor can be written to.

Parameters
on_writethe callback to run, ownership of the callback is transferred.

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