UA Server SDK C++ Bundle  1.4.1.271
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RingBuffer Class Reference

RingBuffer. More...

#include <uamonitoreditem.h>

Public Member Functions

 RingBuffer (OpcUa_UInt32 uSize)
 construction More...
 
 ~RingBuffer ()
 destruction
 
void changeSize (OpcUa_UInt32 newSize)
 Change size of the buffer. More...
 
OpcUa_Void * at (OpcUa_UInt32 index)
 Get element at logical index. More...
 
OpcUa_UInt32 getSize ()
 Get size of the buffer. More...
 
OpcUa_UInt32 getCount ()
 Get number of data pieces in the buffer. More...
 
OpcUa_Void * push (OpcUa_Void *pData)
 Push data to the buffer. More...
 
OpcUa_Void * pushOverwrite (OpcUa_Void *pData)
 Push data to the buffer. More...
 
OpcUa_Void * pop ()
 Pop the data from the buffer. More...
 

Detailed Description

RingBuffer.

Implements a ring buffer. It is not possible to create plane copies of this class. It is not possible to use the default constructor.

Constructor & Destructor Documentation

RingBuffer::RingBuffer ( OpcUa_UInt32  uSize)

construction

Parameters
uSizethe size of the buffer

Member Function Documentation

OpcUa_Void * RingBuffer::at ( OpcUa_UInt32  index)

Get element at logical index.

Parameters
indexThe logical index of the element to return.
Returns
Data at index or NULL if no data exists at this index.
void RingBuffer::changeSize ( OpcUa_UInt32  newSize)

Change size of the buffer.

Parameters
newSizethe new size the buffer will get.
OpcUa_UInt32 RingBuffer::getCount ( )

Get number of data pieces in the buffer.

Returns
the count of data pieces
OpcUa_UInt32 RingBuffer::getSize ( )

Get size of the buffer.

Returns
the size of the buffer
OpcUa_Void * RingBuffer::pop ( )

Pop the data from the buffer.

OpcUa_Void * RingBuffer::push ( OpcUa_Void *  pData)

Push data to the buffer.

Adds the data and returns the oldest data if the buffer is full.

Parameters
pDataData to push into the buffer.
OpcUa_Void * RingBuffer::pushOverwrite ( OpcUa_Void *  pData)

Push data to the buffer.

Adds the data and returns the newest data before add if the buffer is full.

Parameters
pDataData to push into the buffer.

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