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

Public Member Functions | List of all members
AMPS::MemoryStoreBuffer Class Reference

A Buffer implementation that uses memory for storage. More...

`#include <MemoryStoreBuffer.hpp>`

Inheritance diagram for AMPS::MemoryStoreBuffer:

## Public Member Functions
virtual size_t | getSize () const
| Get the current size of the Buffer in bytes. More...
virtual void | setSize (size_t newSize_)
| Set the size for the buffer. More...
virtual size_t | getPosition () const
| Get the current position in the buffer. More...
virtual void | setPosition (size_t position_)
| Set the buffer postion to a location. More...
virtual void | putByte (char byte_)
| Put a byte into the buffer at the current position and advance. More...
virtual char | getByte ()
| Get the next byte from the buffer and advance. More...
virtual void | putSizet (size_t s_)
| Put a size_t value into the buffer at the current position and advance past it. More...
virtual size_t | getSizet ()
| Get a size_t value at the current buffer position and advance past it. More...
virtual void | putInt32 (amps_int32_t s_)
| Put a 32-bit int value into the buffer and advance past it. More...
virtual amps_int32_t | getInt32 ()
| Get the 32-bit int value at the current buffer position and advance past it. More...
virtual void | putUint32 (amps_uint32_t s_)
| 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 ()
| Get the unsigned 32-bit int value at the current buffer position and advance past it. More...
virtual void | putInt64 (amps_int64_t s_)
| Put an amps_int64_t value into the buffer at the current position and advance past it. More...
virtual amps_int64_t | getInt64 ()
| Get a 64-bit int value at the current buffer position and advance past it. More...
virtual void | putUint64 (amps_uint64_t s_)
| Put an amps_uint64_t value into the buffer at the current position and advance past it. More...
virtual amps_uint64_t | getUint64 ()
| Get an unsigned 64-bit int value at the current buffer position and advance past it. More...
virtual void | putBytes (const char *data_, size_t dataLength_)
| Put the given length of bytes in data into the buffer at the current position and advance past them. More...
virtual void | putBytes (const Buffer::ByteArray &bytes_)
| Put the given bytes into the buffer at the current position and advance past them. More...
virtual Buffer::ByteArray | getBytes (size_t numBytes_)
| Get the given number of bytes from the buffer. More...
virtual void | copyBytes (char *buffer_, size_t numBytes_)
| Copy the given number of bytes from this buffer to the given buffer. More...
virtual void | zero (size_t offset_, size_t length_)
| 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_)
| 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

A Buffer implementation that uses memory for storage.

## Member Function Documentation

## ◆ copyBytes() [1/2]

virtual void AMPS::MemoryStoreBuffer::copyBytes | ( | char * | buffer_,
|  | size_t | numBytes_
| ) |  |
| inline 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.

Implements AMPS::Buffer.

## ◆ copyBytes() [2/2]

virtual void AMPS::MemoryStoreBuffer::copyBytes | ( | size_t | destination_,
|  | size_t | source_,
|  | size_t | number_
| ) |  |
| inline 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

Implements AMPS::Buffer.

## ◆ getByte()

virtual char AMPS::MemoryStoreBuffer::getByte | ( |  | ) |
| inline virtual

Get the next byte from the buffer and advance.

Returns
  The byte at the current position.

Implements AMPS::Buffer.

## ◆ getBytes()

virtual Buffer::ByteArray AMPS::MemoryStoreBuffer::getBytes | ( | size_t | numBytes_ | ) |
| inline 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.

Implements AMPS::Buffer.

## ◆ getInt32()

virtual amps_int32_t AMPS::MemoryStoreBuffer::getInt32 | ( |  | ) |
| inline 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.

Implements AMPS::Buffer.

## ◆ getInt64()

virtual amps_int64_t AMPS::MemoryStoreBuffer::getInt64 | ( |  | ) |
| inline virtual

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

Returns
  The amps_int64_t value.

Implements AMPS::Buffer.

## ◆ getPosition()

virtual size_t AMPS::MemoryStoreBuffer::getPosition | ( |  | ) | const
| inline virtual

Get the current position in the buffer.

Returns
  The position in the buffer.

Implements AMPS::Buffer.

## ◆ getSize()

virtual size_t AMPS::MemoryStoreBuffer::getSize | ( |  | ) | const
| inline virtual

Get the current size of the Buffer in bytes.

Returns
  The size in bytes.

Implements AMPS::Buffer.

## ◆ getSizet()

virtual size_t AMPS::MemoryStoreBuffer::getSizet | ( |  | ) |
| inline virtual

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

Returns
  The size_t value.

Implements AMPS::Buffer.

## ◆ getUint32()

virtual amps_uint32_t AMPS::MemoryStoreBuffer::getUint32 | ( |  | ) |
| inline virtual

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

Returns
  The unsigned 32-bit int value.

Implements AMPS::Buffer.

## ◆ getUint64()

virtual amps_uint64_t AMPS::MemoryStoreBuffer::getUint64 | ( |  | ) |
| inline virtual

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

Returns
  The amps_uint64_t value.

Implements AMPS::Buffer.

## ◆ putByte()

virtual void AMPS::MemoryStoreBuffer::putByte | ( | char | byte_ | ) |
| inline virtual

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

Parameters

  byte_ | The byte to put in the buffer.

Implements AMPS::Buffer.

## ◆ putBytes() [1/2]

virtual void AMPS::MemoryStoreBuffer::putBytes | ( | const Buffer::ByteArray & | bytes_ | ) |
| inline 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.

Implements AMPS::Buffer.

## ◆ putBytes() [2/2]

virtual void AMPS::MemoryStoreBuffer::putBytes | ( | const char * | data_,
|  | size_t | dataLength_
| ) |  |
| inline 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.

Implements AMPS::Buffer.

## ◆ putInt32()

virtual void AMPS::MemoryStoreBuffer::putInt32 | ( | amps_int32_t | i_ | ) |
| inline virtual

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

Parameters

  i_ | The 32-bit int value.

Implements AMPS::Buffer.

## ◆ putInt64()

virtual void AMPS::MemoryStoreBuffer::putInt64 | ( | amps_int64_t | i_ | ) |
| inline 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.

Implements AMPS::Buffer.

## ◆ putSizet()

virtual void AMPS::MemoryStoreBuffer::putSizet | ( | size_t | s_ | ) |
| inline virtual

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

Parameters

  s_ | The size_t value.

Implements AMPS::Buffer.

## ◆ putUint32()

virtual void AMPS::MemoryStoreBuffer::putUint32 | ( | amps_uint32_t | i_ | ) |
| inline 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.

Implements AMPS::Buffer.

## ◆ putUint64()

virtual void AMPS::MemoryStoreBuffer::putUint64 | ( | amps_uint64_t | ui_ | ) |
| inline 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.

Implements AMPS::Buffer.

## ◆ setPosition()

virtual void AMPS::MemoryStoreBuffer::setPosition | ( | size_t | position_ | ) |
| inline virtual

Set the buffer postion to a location.

Parameters

  position_ | The new buffer position.

Implements AMPS::Buffer.

## ◆ setSize()

virtual void AMPS::MemoryStoreBuffer::setSize | ( | size_t | newSize_ | ) |
| inline virtual

Set the size for the buffer.

Parameters

  newSize_ | The new size in bytes for the buffer.

Implements AMPS::Buffer.

Reimplemented in AMPS::MMapStoreBuffer.

## ◆ zero()

virtual void AMPS::MemoryStoreBuffer::zero | ( | size_t | offset_,
|  | size_t | length_
| ) |  |
| inline 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.

Implements AMPS::Buffer.

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

- include/amps/MemoryStoreBuffer.hpp