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

Detailed Description


Inheritance diagram for ola::io::IOStack:
Inheritance graph
Collaboration diagram for ola::io::IOStack:
Collaboration graph

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)
const 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

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

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)

Remove bytes from the stack

Implements ola::io::IOVecInterface.

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

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 

Read up to n bytes into the string output.

Implements ola::io::InputBufferInterface.

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

Return the amount of data in the buffer

Implements ola::io::OutputBufferInterface.

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

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: