AMPS C/C++ Client Class Reference AMPS C/C++ Client Version 5.3.5.6

Public Member Functions | List of all members
AMPS::Buffer Class Referenceabstract

Abstract base class for implementing a buffer to be used by a StoreImpl for storage of publish messages for possible replay to AMPS. More...

`#include <Buffer.hpp>`

Inheritance diagram for AMPS::Buffer:

## Public Member Functions
virtual size_t | getSize () const =0
| Get the current size of the Buffer in bytes. More...
virtual void | setSize (size_t newSize_)=0
| Set the size for the buffer. More...
virtual size_t | getPosition () const =0
| Get the current position in the buffer. More...
virtual void | setPosition (size_t position_)=0
| Set the buffer postion to a location. More...
virtual void | putByte (char byte_)=0
| Put a byte into the buffer at the current position and advance. More...
virtual char | getByte ()=0
| Get the next byte from the buffer and advance. More...
virtual void | putUint32 (amps_uint32_t i_)=0
| Put an unsigned 32-bit int value into the buffer at the current position and advance past the end of it. More...
virtual amps_uint32_t | getUint32 ()=0
| Get the unsigned 32-bit int value at the current buffer position and advance past it. More...
virtual void | putInt32 (amps_int32_t i_)=0
| Put a 32-bit int value into the buffer and advance past it. More...
virtual amps_int32_t | getInt32 ()=0
| Get the 32-bit int value at the current buffer position and advance past it. More...
virtual void | putSizet (size_t s_)=0
| Put a size_t value into the buffer at the current position and advance past it. More...
virtual size_t | getSizet ()=0
| Get a size_t value at the current buffer position and advance past it. More...
virtual void | putUint64 (amps_uint64_t ui_)=0
| Put an amps_uint64_t value into the buffer at the current position and advance past it. More...
virtual amps_uint64_t | getUint64 ()=0
| Get an unsigned 64-bit int value at the current buffer position and advance past it. More...
virtual void | putInt64 (amps_int64_t i_)=0
| Put an amps_int64_t value into the buffer at the current position and advance past it. More...
virtual amps_int64_t | getInt64 ()=0
| Get a 64-bit int value at the current buffer position and advance past it. More...
virtual void | putBytes (const char *data_, size_t dataLength_)=0
| Put the given length of bytes in data into the buffer at the current position and advance past them. More...
virtual void | putBytes (const ByteArray &bytes_)=0
| Put the given bytes into the buffer at the current position and advance past them. More...
virtual ByteArray | getBytes (size_t numBytes_)=0
| Get the given number of bytes from the buffer. More...
virtual void | copyBytes (char *buffer_, size_t numBytes_)=0
| Copy the given number of bytes from this buffer to the given buffer. More...
virtual void | zero (size_t offset_, size_t length_)=0
| Set the given number of bytes in the buffer to zero starting at the given position. More...
virtual void | copyBytes (size_t destination_, size_t source_, size_t number_)=0
| Move the given number of bytes at the given location to the new location Buffer should do this in the most optimal fashion. More...

## Detailed Description

Abstract base class for implementing a buffer to be used by a StoreImpl for storage of publish messages for possible replay to AMPS.

## Member Function Documentation

## ◆ copyBytes() [1/2]

virtual void AMPS::Buffer::copyBytes | ( | char * | buffer_,
|  | size_t | numBytes_
| ) |  |
| pure virtual

Copy the given number of bytes from this buffer to the given buffer.

Parameters

  buffer_ | The destination for the copied bytes.
  numBytes_ | The number of bytes to get from the buffer.

Implemented in AMPS::MemoryStoreBuffer.

## ◆ copyBytes() [2/2]

virtual void AMPS::Buffer::copyBytes | ( | size_t | destination_,
|  | size_t | source_,
|  | size_t | number_
| ) |  |
| pure virtual

Move the given number of bytes at the given location to the new location Buffer should do this in the most optimal fashion.

Parameters

  destination_ | The destination offset to copy the bytes to
  source_ | The source offset in the buffer to copy from
  number_ | The number of bytes to move

Implemented in AMPS::MemoryStoreBuffer.

## ◆ getByte()

virtual char AMPS::Buffer::getByte | ( |  | ) |
| pure virtual

Get the next byte from the buffer and advance.

Returns
  The byte at the current position.

Implemented in AMPS::MemoryStoreBuffer.

## ◆ getBytes()

virtual ByteArray AMPS::Buffer::getBytes | ( | size_t | numBytes_ | ) |
| pure virtual

Get the given number of bytes from the buffer.

Parameters

  numBytes_ | The number of bytes to get from the buffer.

Returns
  The bytes from the buffer.

Implemented in AMPS::MemoryStoreBuffer.

## ◆ getInt32()

virtual amps_int32_t AMPS::Buffer::getInt32 | ( |  | ) |
| pure virtual

Get the 32-bit int value at the current buffer position and advance past it.

Returns
  The 32-bit int value at the current position.

Implemented in AMPS::MemoryStoreBuffer.

## ◆ getInt64()

virtual amps_int64_t AMPS::Buffer::getInt64 | ( |  | ) |
| pure virtual

Get a 64-bit int value at the current buffer position and advance past it.

Returns
  The amps_int64_t value.

Implemented in AMPS::MemoryStoreBuffer.

## ◆ getPosition()

virtual size_t AMPS::Buffer::getPosition | ( |  | ) | const
| pure virtual

Get the current position in the buffer.

Returns
  The position in the buffer.

Implemented in AMPS::MemoryStoreBuffer.

## ◆ getSize()

virtual size_t AMPS::Buffer::getSize | ( |  | ) | const
| pure virtual

Get the current size of the Buffer in bytes.

Returns
  The size in bytes.

Implemented in AMPS::MemoryStoreBuffer.

## ◆ getSizet()

virtual size_t AMPS::Buffer::getSizet | ( |  | ) |
| pure virtual

Get a size_t value at the current buffer position and advance past it.

Returns
  The size_t value.

Implemented in AMPS::MemoryStoreBuffer.

## ◆ getUint32()

virtual amps_uint32_t AMPS::Buffer::getUint32 | ( |  | ) |
| pure virtual

Get the unsigned 32-bit int value at the current buffer position and advance past it.

Returns
  The unsigned 32-bit int value.

Implemented in AMPS::MemoryStoreBuffer.

## ◆ getUint64()

virtual amps_uint64_t AMPS::Buffer::getUint64 | ( |  | ) |
| pure virtual

Get an unsigned 64-bit int value at the current buffer position and advance past it.

Returns
  The amps_uint64_t value.

Implemented in AMPS::MemoryStoreBuffer.

## ◆ putByte()

virtual void AMPS::Buffer::putByte | ( | char | byte_ | ) |
| pure virtual

Put a byte into the buffer at the current position and advance.

Parameters

  byte_ | The byte to put in the buffer.

Implemented in AMPS::MemoryStoreBuffer.

## ◆ putBytes() [1/2]

virtual void AMPS::Buffer::putBytes | ( | const ByteArray & | bytes_ | ) |
| pure virtual

Put the given bytes into the buffer at the current position and advance past them.

Parameters

  bytes_ | The bytes to write into the buffer.

Implemented in AMPS::MemoryStoreBuffer.

## ◆ putBytes() [2/2]

virtual void AMPS::Buffer::putBytes | ( | const char * | data_,
|  | size_t | dataLength_
| ) |  |
| pure virtual

Put the given length of bytes in data into the buffer at the current position and advance past them.

Parameters

  data_ | A pointer to the beginning of the bytes to write.
  dataLength_ | The number of bytes from data_ to write.

Implemented in AMPS::MemoryStoreBuffer.

## ◆ putInt32()

virtual void AMPS::Buffer::putInt32 | ( | amps_int32_t | i_ | ) |
| pure virtual

Put a 32-bit int value into the buffer and advance past it.

Parameters

  i_ | The 32-bit int value.

Implemented in AMPS::MemoryStoreBuffer.

## ◆ putInt64()

virtual void AMPS::Buffer::putInt64 | ( | amps_int64_t | i_ | ) |
| pure virtual

Put an amps_int64_t value into the buffer at the current position and advance past it.

Parameters

  i_ | The amps_int64_t value.

Implemented in AMPS::MemoryStoreBuffer.

## ◆ putSizet()

virtual void AMPS::Buffer::putSizet | ( | size_t | s_ | ) |
| pure virtual

Put a size_t value into the buffer at the current position and advance past it.

Parameters

  s_ | The size_t value.

Implemented in AMPS::MemoryStoreBuffer.

## ◆ putUint32()

virtual void AMPS::Buffer::putUint32 | ( | amps_uint32_t | i_ | ) |
| pure virtual

Put an unsigned 32-bit int value into the buffer at the current position and advance past the end of it.

Parameters

  i_ | The unsigned 32-bit int value to write to the buffer.

Implemented in AMPS::MemoryStoreBuffer.

## ◆ putUint64()

virtual void AMPS::Buffer::putUint64 | ( | amps_uint64_t | ui_ | ) |
| pure virtual

Put an amps_uint64_t value into the buffer at the current position and advance past it.

Parameters

  ui_ | The amps_uint64_t value.

Implemented in AMPS::MemoryStoreBuffer.

## ◆ setPosition()

virtual void AMPS::Buffer::setPosition | ( | size_t | position_ | ) |
| pure virtual

Set the buffer postion to a location.

Parameters

  position_ | The new buffer position.

Implemented in AMPS::MemoryStoreBuffer.

## ◆ setSize()

virtual void AMPS::Buffer::setSize | ( | size_t | newSize_ | ) |
| pure virtual

Set the size for the buffer.

Parameters

  newSize_ | The new size in bytes for the buffer.

Implemented in AMPS::MMapStoreBuffer, and AMPS::MemoryStoreBuffer.

## ◆ zero()

virtual void AMPS::Buffer::zero | ( | size_t | offset_,
|  | size_t | length_
| ) |  |
| pure virtual

Set the given number of bytes in the buffer to zero starting at the given position.

Parameters

  offset_ | The position at which to start setting bytes to 0.
  length_ | The number of bytes to set to zero.

Implemented in AMPS::MemoryStoreBuffer.

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

- include/amps/Buffer.hpp