OpenJAUS Software Development Kit  4.3.1
Public Member Functions | Protected Attributes | Friends | List of all members
openjaus::system::Buffer Class Reference

#include <Buffer.h>

Inherits openjaus::system::Transportable.

Inherited by openjaus::system::Packet, and openjaus::transport::AS5669::JtcpStream.

Public Member Functions

 Buffer ()
 
virtual ~Buffer ()
 
 Buffer (int maxSize)
 
 Buffer (const Buffer &buffer)
 
unsigned char * getPointer () const
 Accessor to get the value of pointer. More...
 
int getMaxSize () const
 Accessor to get the value of maxSize. More...
 
bool setMaxSize (int maxSize)
 Accessor to set value of maxSize. More...
 
unsigned char * getBuffer () const
 Accessor to get the value of buffer. More...
 
int append (Buffer &newBuffer)
 Operation append. More...
 
void free ()
 Operation free. More...
 
void increment (int byteCount)
 Operation increment. More...
 
int remainingBytes () const
 
int containedBytes () const
 
int clear ()
 Operation clear. More...
 
unsigned char * reset ()
 Operation reset. More...
 
int to (Buffer *dst, int byteCount)
 Operation to. More...
 
int from (Buffer *src, int byteCount)
 Operation from. More...
 
int setAllTo (unsigned char newValue)
 Operation setAllTo. More...
 
int set (unsigned char value, int count)
 Operation set. More...
 
virtual int to (Buffer *dst)
 Operation to. More...
 
virtual int from (Buffer *src)
 Operation from. More...
 
virtual int length ()
 Serializes object to internal transport buffer. More...
 
virtual std::string toString () const
 
Bufferoperator= (const Buffer &rhs)
 
bool operator== (const Buffer &other) const
 
template<typename Type >
int peekTemplate (Type &value)
 
int peek (int8_t &value)
 
int peek (int16_t &value)
 
int peek (int32_t &value)
 
int peek (int64_t &value)
 
int peek (uint8_t &value)
 
int peek (uint16_t &value)
 
int peek (uint32_t &value)
 
int peek (uint64_t &value)
 
int peek (float &value)
 
int peek (double &value)
 
int peek (unsigned char *const buffer, int size)
 
template<typename Type >
int unpackTemplate (Type &value)
 
int unpack (int8_t &value)
 
int unpack (int16_t &value)
 
int unpack (int32_t &value)
 
int unpack (int64_t &value)
 
int unpack (uint8_t &value)
 
int unpack (uint16_t &value)
 
int unpack (uint32_t &value)
 
int unpack (uint64_t &value)
 
int unpack (float &value)
 
int unpack (double &value)
 
int unpack (Transportable &value)
 
int unpack (std::string &dst, unsigned long length)
 
int unpack (unsigned char *const buffer, int size)
 
template<typename Type >
int packTemplate (const Type &value)
 
int pack (const int8_t &value)
 
int pack (const int16_t &value)
 
int pack (const int32_t &value)
 
int pack (const int64_t &value)
 
int pack (const uint8_t &value)
 
int pack (const uint16_t &value)
 
int pack (const uint32_t &value)
 
int pack (const uint64_t &value)
 
int pack (const float &value)
 
int pack (const double &value)
 
int pack (Transportable &value)
 
int pack (std::string &source)
 
int pack (std::string &source, unsigned int length)
 
int pack (const unsigned char *const buffer, unsigned int size)
 
std::string toString (int byteCount) const
 
- Public Member Functions inherited from openjaus::system::Transportable
virtual ~Transportable ()
 
 Transportable ()
 

Protected Attributes

unsigned char * pointer
 
int maxSize
 
unsigned char * buffer
 

Friends

OPENJAUS_EXPORT friend std::ostream & operator<< (std::ostream &output, const Buffer &object)
 
OPENJAUS_EXPORT friend std::ostream & operator<< (std::ostream &output, const Buffer *object)
 

Constructor & Destructor Documentation

§ Buffer() [1/3]

openjaus::system::Buffer::Buffer ( )

§ ~Buffer()

openjaus::system::Buffer::~Buffer ( )
virtual

§ Buffer() [2/3]

openjaus::system::Buffer::Buffer ( int  maxSize)

§ Buffer() [3/3]

openjaus::system::Buffer::Buffer ( const Buffer buffer)

Member Function Documentation

§ append()

int openjaus::system::Buffer::append ( Buffer newBuffer)
Parameters
newBuffer

§ clear()

int openjaus::system::Buffer::clear ( )

§ containedBytes()

int openjaus::system::Buffer::containedBytes ( ) const

§ free()

void openjaus::system::Buffer::free ( )

§ from() [1/2]

int openjaus::system::Buffer::from ( Buffer src,
int  byteCount 
)
Parameters
src
byteCount

§ from() [2/2]

int openjaus::system::Buffer::from ( Buffer src)
virtual
Parameters
src

Implements openjaus::system::Transportable.

§ getBuffer()

unsigned char * openjaus::system::Buffer::getBuffer ( ) const

§ getMaxSize()

int openjaus::system::Buffer::getMaxSize ( ) const

§ getPointer()

unsigned char * openjaus::system::Buffer::getPointer ( ) const

§ increment()

void openjaus::system::Buffer::increment ( int  byteCount)
Parameters
byteCount

§ length()

int openjaus::system::Buffer::length ( )
virtual

§ operator=()

Buffer & openjaus::system::Buffer::operator= ( const Buffer rhs)

§ operator==()

bool openjaus::system::Buffer::operator== ( const Buffer other) const

§ pack() [1/14]

int openjaus::system::Buffer::pack ( const int8_t &  value)

§ pack() [2/14]

int openjaus::system::Buffer::pack ( const int16_t &  value)

§ pack() [3/14]

int openjaus::system::Buffer::pack ( const int32_t &  value)

§ pack() [4/14]

int openjaus::system::Buffer::pack ( const int64_t &  value)

§ pack() [5/14]

int openjaus::system::Buffer::pack ( const uint8_t &  value)

§ pack() [6/14]

int openjaus::system::Buffer::pack ( const uint16_t &  value)

§ pack() [7/14]

int openjaus::system::Buffer::pack ( const uint32_t &  value)

§ pack() [8/14]

int openjaus::system::Buffer::pack ( const uint64_t &  value)

§ pack() [9/14]

int openjaus::system::Buffer::pack ( const float &  value)

§ pack() [10/14]

int openjaus::system::Buffer::pack ( const double &  value)

§ pack() [11/14]

int openjaus::system::Buffer::pack ( Transportable value)

§ pack() [12/14]

int openjaus::system::Buffer::pack ( std::string &  source)

§ pack() [13/14]

int openjaus::system::Buffer::pack ( std::string &  source,
unsigned int  length 
)

§ pack() [14/14]

int openjaus::system::Buffer::pack ( const unsigned char *const  buffer,
unsigned int  size 
)

§ packTemplate()

template<typename Type >
int openjaus::system::Buffer::packTemplate ( const Type &  value)

§ peek() [1/11]

int openjaus::system::Buffer::peek ( int8_t &  value)

§ peek() [2/11]

int openjaus::system::Buffer::peek ( int16_t &  value)

§ peek() [3/11]

int openjaus::system::Buffer::peek ( int32_t &  value)

§ peek() [4/11]

int openjaus::system::Buffer::peek ( int64_t &  value)

§ peek() [5/11]

int openjaus::system::Buffer::peek ( uint8_t &  value)

§ peek() [6/11]

int openjaus::system::Buffer::peek ( uint16_t &  value)

§ peek() [7/11]

int openjaus::system::Buffer::peek ( uint32_t &  value)

§ peek() [8/11]

int openjaus::system::Buffer::peek ( uint64_t &  value)

§ peek() [9/11]

int openjaus::system::Buffer::peek ( float &  value)

§ peek() [10/11]

int openjaus::system::Buffer::peek ( double &  value)

§ peek() [11/11]

int openjaus::system::Buffer::peek ( unsigned char *const  buffer,
int  size 
)

§ peekTemplate()

template<typename Type >
int openjaus::system::Buffer::peekTemplate ( Type &  value)

§ remainingBytes()

int openjaus::system::Buffer::remainingBytes ( ) const

§ reset()

unsigned char * openjaus::system::Buffer::reset ( )

§ set()

int openjaus::system::Buffer::set ( unsigned char  value,
int  count 
)
Parameters
value
count

§ setAllTo()

int openjaus::system::Buffer::setAllTo ( unsigned char  newValue)
Parameters
newValue

§ setMaxSize()

bool openjaus::system::Buffer::setMaxSize ( int  maxSize)
Parameters
maxSizeThe value of the new maxSize.

§ to() [1/2]

int openjaus::system::Buffer::to ( Buffer dst,
int  byteCount 
)
Parameters
dst
byteCount

§ to() [2/2]

int openjaus::system::Buffer::to ( Buffer dst)
virtual
Parameters
dst

Implements openjaus::system::Transportable.

§ toString() [1/2]

std::string openjaus::system::Buffer::toString ( ) const
virtual

§ toString() [2/2]

std::string openjaus::system::Buffer::toString ( int  byteCount) const

§ unpack() [1/13]

int openjaus::system::Buffer::unpack ( int8_t &  value)

§ unpack() [2/13]

int openjaus::system::Buffer::unpack ( int16_t &  value)

§ unpack() [3/13]

int openjaus::system::Buffer::unpack ( int32_t &  value)

§ unpack() [4/13]

int openjaus::system::Buffer::unpack ( int64_t &  value)

§ unpack() [5/13]

int openjaus::system::Buffer::unpack ( uint8_t &  value)

§ unpack() [6/13]

int openjaus::system::Buffer::unpack ( uint16_t &  value)

§ unpack() [7/13]

int openjaus::system::Buffer::unpack ( uint32_t &  value)

§ unpack() [8/13]

int openjaus::system::Buffer::unpack ( uint64_t &  value)

§ unpack() [9/13]

int openjaus::system::Buffer::unpack ( float &  value)

§ unpack() [10/13]

int openjaus::system::Buffer::unpack ( double &  value)

§ unpack() [11/13]

int openjaus::system::Buffer::unpack ( Transportable value)

§ unpack() [12/13]

int openjaus::system::Buffer::unpack ( std::string &  dst,
unsigned long  length 
)

§ unpack() [13/13]

int openjaus::system::Buffer::unpack ( unsigned char *const  buffer,
int  size 
)

§ unpackTemplate()

template<typename Type >
int openjaus::system::Buffer::unpackTemplate ( Type &  value)

Friends And Related Function Documentation

§ operator<< [1/2]

OPENJAUS_EXPORT friend std::ostream& operator<< ( std::ostream &  output,
const Buffer object 
)
friend

§ operator<< [2/2]

OPENJAUS_EXPORT friend std::ostream& operator<< ( std::ostream &  output,
const Buffer object 
)
friend

Member Data Documentation

§ buffer

unsigned char* openjaus::system::Buffer::buffer
protected

§ maxSize

int openjaus::system::Buffer::maxSize
protected

§ pointer

unsigned char* openjaus::system::Buffer::pointer
protected

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