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

Detailed Description

IOQueue.

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

Public Member Functions

 IOQueue ()
 IOQueue.
 
 IOQueue (class MemoryBlockPool *block_pool)
 
 ~IOQueue ()
 
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)
 
unsigned int Peek (uint8_t *data, unsigned int length) const
 
const struct IOVecAsIOVec (int *io_count) const
 
void Pop (unsigned int n)
 
void AppendBlock (class MemoryBlock *block)
 
void AppendMove (IOQueue *other)
 Move the contents of one IOQueue to another. More...
 
void Clear ()
 
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

◆ ~IOQueue()

ola::io::IOQueue::~IOQueue ( )

Clean up

Member Function Documentation

◆ AppendBlock()

void ola::io::IOQueue::AppendBlock ( class MemoryBlock block)

Append an MemoryBlock to this queue. This may leave a hole in the last block before this method was called, but that's unavoidable without copying (which we don't want to do).

◆ AppendMove()

void ola::io::IOQueue::AppendMove ( IOQueue other)

Move the contents of one IOQueue to another.

Parameters
otherThe IOQueue with the data to append to this IOQueue.

◆ AsIOVec()

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

Return this IOQueue 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 IOQueue is empty, this will return NULL and set iocnt to 0.

Use FreeIOVec() to release the IOVec array.

Implements ola::io::IOVecInterface.

◆ Clear()

void ola::io::IOQueue::Clear ( )

Remove all data from the IOQueue.

◆ Dump()

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

Dump this IOQueue as a human readable string

◆ Peek()

unsigned int ola::io::IOQueue::Peek ( uint8_t *  data,
unsigned int  n 
) const

Copy the first n bytes into the region pointed to by data

◆ Pop()

void ola::io::IOQueue::Pop ( unsigned int  n)
virtual

Remove the first n bytes from the buffer

Implements ola::io::IOVecInterface.

◆ Read() [1/2]

unsigned int ola::io::IOQueue::Read ( uint8_t *  data,
unsigned int  n 
)
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::IOQueue::Read ( std::string *  output,
unsigned int  n 
)
virtual

Read up to n bytes into the string output.

Implements ola::io::InputBufferInterface.

◆ Size()

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

Return the amount of data in the buffer

Implements ola::io::OutputBufferInterface.

◆ Write()

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

Append (length) bytes of data to the buffer

Implements ola::io::OutputBufferInterface.


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