Public Member Functions | Static Public Member Functions
CAccess Class Reference

#include <access.h>

List of all members.

Public Member Functions

 CAccess ()
virtual ~CAccess ()

Static Public Member Functions

static bool extractSerializationData (std::vector< unsigned char > &buffer, int dataName, std::vector< unsigned char > &data)
static int getDataLocationAndSize (const std::vector< unsigned char > &buffer, int dataName, int &theSize)
static void insertSerializationData (std::vector< unsigned char > &buffer, int dataName, const std::vector< unsigned char > &data)
static float pop_float (std::vector< unsigned char > &buffer)
static std::vector< float > pop_float (std::vector< unsigned char > &buffer, const unsigned int n)
static int pop_int (std::vector< unsigned char > &buffer)
static void push_float (std::vector< unsigned char > &buffer, const float data)
static void push_float (std::vector< unsigned char > &buffer, const std::vector< float > data)
static void push_int (std::vector< unsigned char > &buffer, const int data)

Detailed Description

This class contains helper functions to insert/extract items to/from scene objects. It assumes that the developer stores data under the DEVELOPER_HEADER in the form: item1ID,item1DataLengthInBytes,item1Data,item2ID,item2DataLengthInBytes,item2Data, etc.

Definition at line 144 of file access.h.


Constructor & Destructor Documentation

Definition at line 13 of file access.cpp.

CAccess::~CAccess ( ) [virtual]

Definition at line 16 of file access.cpp.


Member Function Documentation

bool CAccess::extractSerializationData ( std::vector< unsigned char > &  buffer,
int  dataName,
std::vector< unsigned char > &  data 
) [static]

Extracts the data saved under the dataName item. Note that the data is erased from the input data buffer.

Parameters:
bufferThe buffer from which the data must be extracted.
dataNameThe ID of the data to be extracted (must be in CustomDataHeaders).
dataThe extracted data value.
Returns:
true if the operation was successful, false otherwise.

Definition at line 47 of file access.cpp.

int CAccess::getDataLocationAndSize ( const std::vector< unsigned char > &  buffer,
int  dataName,
int &  theSize 
) [static]

Returns the location and size of the specified field in the custom data.

Parameters:
bufferVector containing the custom data.
dataNameThe ID of the required data (must be in CustomDataHeaders).
theSizeThe size of the specified field.
Returns:
The position (i.e. the index) of the specified data in the buffer.

Definition at line 19 of file access.cpp.

void CAccess::insertSerializationData ( std::vector< unsigned char > &  buffer,
int  dataName,
const std::vector< unsigned char > &  data 
) [static]

Inserts data under the dataName item.

Parameters:
bufferThe buffer in which the data must be inserted.
dataNameThe ID of the data to be inserted (must be in CustomDataHeaders).
dataThe data value.

Definition at line 63 of file access.cpp.

float CAccess::pop_float ( std::vector< unsigned char > &  buffer) [static]

Extract a float from the custom data. Returns 0 if the buffer is smaller than sizeof(float). If the buffer is larger than sizeof(float) only the last sizeof(float) bytes are considered.

Parameters:
bufferThe custom data.
Returns:
The extracted float.

Definition at line 133 of file access.cpp.

std::vector< float > CAccess::pop_float ( std::vector< unsigned char > &  buffer,
const unsigned int  n 
) [static]

Extract a float array from the custom data. Returns 0 if the buffer is smaller than sizeof(float)*N. If the buffer is larger than sizeof(float)*N only the last sizeof(float)*N bytes are considered.

Parameters:
bufferThe custom data.
nNumber of floats to pop.
Returns:
The extracted float.

Definition at line 152 of file access.cpp.

int CAccess::pop_int ( std::vector< unsigned char > &  buffer) [static]

Extract an integer from the custom data. Returns 0 if the buffer is smaller than sizeof(int). If the buffer is larger than sizeof(int) only the last sizeof(int) bytes are considered.

Parameters:
bufferThe custom data.
Returns:
The extracted integer.

Definition at line 114 of file access.cpp.

void CAccess::push_float ( std::vector< unsigned char > &  buffer,
const float  data 
) [static]

Insert a float in the custom data.

Parameters:
bufferThe custom data.
dataThe float to be inserted.

Definition at line 101 of file access.cpp.

void CAccess::push_float ( std::vector< unsigned char > &  buffer,
const std::vector< float >  data 
) [static]

Insert a float array in the custom data.

Parameters:
bufferThe custom data.
dataThe float array to be inserted.

Definition at line 108 of file access.cpp.

void CAccess::push_int ( std::vector< unsigned char > &  buffer,
const int  data 
) [static]

Insert an integer in the custom data.

Parameters:
bufferThe custom data.
dataThe integer to be inserted.

Definition at line 94 of file access.cpp.


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


vrep_ros_plugin
Author(s): Riccardo Spica , Giovanni Claudio
autogenerated on Sat Jun 8 2019 20:22:41