Open Lighting Architecture  Latest Git
Public Member Functions | List of all members
ola::io::IOStack Class Reference

Detailed Description

IOStack.

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

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

◆ IOStack()

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

◆ ~IOStack()

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

Clean up

Member Function Documentation

◆ AsIOVec()

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

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.

◆ Dump()

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

Dump this IOStack as a human readable string

◆ MoveToIOQueue()

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

◆ Pop()

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

Remove bytes from the stack

Implements ola::io::IOVecInterface.

◆ Read() [1/2]

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.

◆ Read() [2/2]

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.

◆ Size()

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

Return the amount of data in the buffer

Implements ola::io::OutputBufferInterface.

◆ Write()

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: