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

Detailed Description

IOStack.

Inheritance diagram for ola::io::IOStack:
ola::io::IOVecInterface ola::io::InputBufferInterface ola::io::OutputBufferInterface

Public Member Functions

 IOStack ()
 IOStack (class MemoryBlockPool *block_pool)
 ~IOStack ()
unsigned int Size () const
bool Empty () const
void Write (const uint8_t *data, unsigned int length)
unsigned int Read (uint8_t *data, unsigned int length)
unsigned int Read (std::string *output, unsigned int length)
struct IOVecAsIOVec (int *io_count) const
void Pop (unsigned int n)
void MoveToIOQueue (class IOQueue *queue)
void Purge ()
void Dump (std::ostream *output)

Additional Inherited Members

- Static Public Member Functions inherited from ola::io::IOVecInterface
static void FreeIOVec (const struct IOVec *iov)

Constructor & Destructor Documentation

ola::io::IOStack::IOStack ( )
ola::io::IOStack::~IOStack ( )

Clean up

Member Function Documentation

struct IOVec * ola::io::IOStack::AsIOVec ( int *  iocnt) const
readvirtual

Return this IOStack as an array of IOVec structures. Note: The IOVec array points at internal memory structures. This array is invalidated when any non-const methods are called (Append, Pop etc.)

Is the IOStack is empty, this will return NULL and set iocnt to 0.

Use FreeIOVec() to release the IOVec array.

Implements ola::io::IOVecInterface.

void ola::io::IOStack::Dump ( std::ostream *  output)

Dump this IOStack as a human readable string

void ola::io::IOStack::MoveToIOQueue ( class IOQueue queue)

Append the memory blocks in this stack to the IOQueue. This transfers ownership of the MemoryBlocks to the queue, so the IOQueue and IOStack should have the same MemoryBlockPool (or at the very least, the same implementation).

void ola::io::IOStack::Pop ( unsigned int  bytes_to_remove)
virtual

Remove bytes from the stack

Implements ola::io::IOVecInterface.

unsigned int ola::io::IOStack::Read ( uint8_t *  data,
unsigned int  length 
)
virtual

Read up to n bytes into the memory location data and shrink the IOQueue by the amount read.

Implements ola::io::InputBufferInterface.

unsigned int ola::io::IOStack::Read ( std::string *  output,
unsigned int  length 
)
virtual

Read up to n bytes into the string output.

Implements ola::io::InputBufferInterface.

unsigned int ola::io::IOStack::Size ( ) const
virtual

Return the amount of data in the buffer

Implements ola::io::OutputBufferInterface.

void ola::io::IOStack::Write ( const uint8_t *  data,
unsigned int  length 
)
virtual

Append (length) bytes of data to the front of the buffer.

Implements ola::io::OutputBufferInterface.


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