Open Lighting Architecture  Latest Git
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Protected Member Functions | List of all members
ola::io::LoopbackDescriptor Class Reference

Detailed Description

A loopback descriptor.

Everything written is available for reading.

Inheritance diagram for ola::io::LoopbackDescriptor:
Inheritance graph
[legend]
Collaboration diagram for ola::io::LoopbackDescriptor:
Collaboration graph
[legend]

Public Member Functions

bool Init ()
 Setup this loopback descriptor. More...
 
DescriptorHandle ReadDescriptor () const
 Returns the read descriptor for this socket. More...
 
DescriptorHandle WriteDescriptor () const
 Returns the write descriptor for this socket. More...
 
bool Close ()
 Close the loopback descriptor. More...
 
bool CloseClient ()
 Close the write portion of the loopback descriptor. More...
 
- Public Member Functions inherited from ola::io::ConnectedDescriptor
virtual ssize_t Send (const uint8_t *buffer, unsigned int size)
 Write a buffer to the descriptor. More...
 
virtual ssize_t Send (IOQueue *data)
 Write data from an IOQueue to a descriptor. More...
 
virtual int Receive (uint8_t *buffer, unsigned int size, unsigned int &data_read)
 Read data from this descriptor. More...
 
virtual bool SetReadNonBlocking ()
 Enable on non-blocking reads.. More...
 
int DataRemaining () const
 Find out how much data is left to read. More...
 
bool IsClosed () const
 Check if the descriptor is closed.
 
void SetOnClose (OnCloseCallback *on_close)
 Set the callback to be run when the descriptor is closed. More...
 
OnCloseCallbackTransferOnClose ()
 Take ownership of the on_close callback. More...
 
- Public Member Functions inherited from ola::io::BidirectionalFileDescriptor
void SetOnData (ola::Callback0< void > *on_read)
 Set the callback to be run when data is available for reading. More...
 
void SetOnWritable (ola::Callback0< void > *on_write)
 Set the callback to be run when the descriptor can be written to. More...
 
void PerformRead ()
 Called when there is data available on the descriptor. More...
 
void PerformWrite ()
 Called when the descriptor can be written to. More...
 
- Public Member Functions inherited from ola::io::ReadFileDescriptor
bool ValidReadDescriptor () const
 Check if this file descriptor is valid. More...
 
- Public Member Functions inherited from ola::io::WriteFileDescriptor
bool ValidWriteDescriptor () const
 Check if this file descriptor is valid. More...
 

Protected Member Functions

bool IsSocket () const
 
- Protected Member Functions inherited from ola::io::ConnectedDescriptor
bool SetNoSigPipe (DescriptorHandle fd)
 Disable SIGPIPE for this descriptor.
 

Additional Inherited Members

- Public Types inherited from ola::io::ConnectedDescriptor
typedef
ola::SingleUseCallback0< void > 
OnCloseCallback
 
- Static Public Member Functions inherited from ola::io::ConnectedDescriptor
static bool SetNonBlocking (DescriptorHandle fd)
 Set a DescriptorHandle to non-blocking mode.
 

Member Function Documentation

bool ola::io::LoopbackDescriptor::Close ( )
virtual

Close the loopback descriptor.

Returns
true if close succeeded, false otherwise

Implements ola::io::ConnectedDescriptor.

bool ola::io::LoopbackDescriptor::CloseClient ( )

Close the write portion of the loopback descriptor.

Returns
true if close succeeded, false otherwise
bool ola::io::LoopbackDescriptor::Init ( )

Setup this loopback descriptor.

Returns
true if initialization succeeded, false if it failed.
DescriptorHandle ola::io::LoopbackDescriptor::ReadDescriptor ( ) const
inlinevirtual

Returns the read descriptor for this socket.

Returns
the DescriptorHandle for this descriptor.

Implements ola::io::ReadFileDescriptor.

DescriptorHandle ola::io::LoopbackDescriptor::WriteDescriptor ( ) const
inlinevirtual

Returns the write descriptor for this socket.

Returns
the DescriptorHandle for this descriptor.

Implements ola::io::WriteFileDescriptor.


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