Public Member Functions | Private Member Functions | Private Attributes | List of all members
visionary::CoLaParameterReader Class Reference

Class for reading data from a CoLaCommand. More...

#include <CoLaParameterReader.h>

Public Member Functions

 CoLaParameterReader (CoLaCommand command)
 
bool readBool ()
 Read a boolean and advance the position by 1 byte. Throws an std::out_of_range exception if CoLaCommand is invalid More...
 
int32_t readDInt ()
 Read a signed double int (32 bit) and advances position by 4 bytes. Throws an std::out_of_range exception if CoLaCommand is invalid More...
 
std::string readFixedString (uint16_t len)
 Read a string (with a known and fixed length), and advance position according to string size. Throws an std::out_of_range exception if CoLaCommand is invalid More...
 
std::string readFlexString ()
 Read a flex string, and advance position according to string size. Throws an std::out_of_range exception if CoLaCommand is invalid More...
 
int16_t readInt ()
 Read a signed int (16 bit, range [-32768, 32767]) and advances position by 2 bytes. Throws an std::out_of_range exception if CoLaCommand is invalid More...
 
double readLReal ()
 Read a IEEE-754 double precision (64 bit) and advances position by 8 bytes. Throws an std::out_of_range exception if CoLaCommand is invalid More...
 
float readReal ()
 Read a IEEE-754 single precision (32 bit) and advances position by 4 bytes. Throws an std::out_of_range exception if CoLaCommand is invalid More...
 
int8_t readSInt ()
 Read a signed short int (8 bit, range [-128, 127]) and advances position by 1 byte. Throws an std::out_of_range exception if CoLaCommand is invalid More...
 
uint32_t readUDInt ()
 Read a unsigned int (32 bit) and advances position by 4 bytes. Throws an std::out_of_range exception if CoLaCommand is invalid More...
 
uint16_t readUInt ()
 Read a unsigned int (16 bit, range [0, 65535]) and advances position by 2 bytes. Throws an std::out_of_range exception if CoLaCommand is invalid More...
 
uint8_t readUSInt ()
 Read a unsigned short int (8 bit, range [0, 255]) and advances position by 1 byte. Throws an std::out_of_range exception if CoLaCommand is invalid More...
 
void rewind ()
 Rewind the position to the first parameter. More...
 
 ~CoLaParameterReader ()
 

Private Member Functions

void checkSize (size_t pos, size_t size)
 

Private Attributes

CoLaCommand m_command
 
size_t m_currentPosition
 

Detailed Description

Class for reading data from a CoLaCommand.

Definition at line 17 of file CoLaParameterReader.h.

Constructor & Destructor Documentation

◆ CoLaParameterReader()

visionary::CoLaParameterReader::CoLaParameterReader ( CoLaCommand  command)

Definition at line 12 of file CoLaParameterReader.cpp.

◆ ~CoLaParameterReader()

visionary::CoLaParameterReader::~CoLaParameterReader ( )
default

Member Function Documentation

◆ checkSize()

void visionary::CoLaParameterReader::checkSize ( size_t  pos,
size_t  size 
)
private

Definition at line 19 of file CoLaParameterReader.cpp.

◆ readBool()

bool visionary::CoLaParameterReader::readBool ( )

Read a boolean and advance the position by 1 byte. Throws an std::out_of_range exception if CoLaCommand is invalid

Definition at line 94 of file CoLaParameterReader.cpp.

◆ readDInt()

int32_t visionary::CoLaParameterReader::readDInt ( )

Read a signed double int (32 bit) and advances position by 4 bytes. Throws an std::out_of_range exception if CoLaCommand is invalid

Definition at line 62 of file CoLaParameterReader.cpp.

◆ readFixedString()

std::string visionary::CoLaParameterReader::readFixedString ( uint16_t  len)

Read a string (with a known and fixed length), and advance position according to string size. Throws an std::out_of_range exception if CoLaCommand is invalid

Definition at line 106 of file CoLaParameterReader.cpp.

◆ readFlexString()

std::string visionary::CoLaParameterReader::readFlexString ( )

Read a flex string, and advance position according to string size. Throws an std::out_of_range exception if CoLaCommand is invalid

Definition at line 99 of file CoLaParameterReader.cpp.

◆ readInt()

int16_t visionary::CoLaParameterReader::readInt ( )

Read a signed int (16 bit, range [-32768, 32767]) and advances position by 2 bytes. Throws an std::out_of_range exception if CoLaCommand is invalid

Definition at line 46 of file CoLaParameterReader.cpp.

◆ readLReal()

double visionary::CoLaParameterReader::readLReal ( )

Read a IEEE-754 double precision (64 bit) and advances position by 8 bytes. Throws an std::out_of_range exception if CoLaCommand is invalid

Definition at line 86 of file CoLaParameterReader.cpp.

◆ readReal()

float visionary::CoLaParameterReader::readReal ( )

Read a IEEE-754 single precision (32 bit) and advances position by 4 bytes. Throws an std::out_of_range exception if CoLaCommand is invalid

Definition at line 78 of file CoLaParameterReader.cpp.

◆ readSInt()

int8_t visionary::CoLaParameterReader::readSInt ( )

Read a signed short int (8 bit, range [-128, 127]) and advances position by 1 byte. Throws an std::out_of_range exception if CoLaCommand is invalid

Definition at line 32 of file CoLaParameterReader.cpp.

◆ readUDInt()

uint32_t visionary::CoLaParameterReader::readUDInt ( )

Read a unsigned int (32 bit) and advances position by 4 bytes. Throws an std::out_of_range exception if CoLaCommand is invalid

Definition at line 70 of file CoLaParameterReader.cpp.

◆ readUInt()

uint16_t visionary::CoLaParameterReader::readUInt ( )

Read a unsigned int (16 bit, range [0, 65535]) and advances position by 2 bytes. Throws an std::out_of_range exception if CoLaCommand is invalid

Definition at line 54 of file CoLaParameterReader.cpp.

◆ readUSInt()

uint8_t visionary::CoLaParameterReader::readUSInt ( )

Read a unsigned short int (8 bit, range [0, 255]) and advances position by 1 byte. Throws an std::out_of_range exception if CoLaCommand is invalid

Definition at line 39 of file CoLaParameterReader.cpp.

◆ rewind()

void visionary::CoLaParameterReader::rewind ( )

Rewind the position to the first parameter.

Definition at line 27 of file CoLaParameterReader.cpp.

Member Data Documentation

◆ m_command

CoLaCommand visionary::CoLaParameterReader::m_command
private

Definition at line 21 of file CoLaParameterReader.h.

◆ m_currentPosition

size_t visionary::CoLaParameterReader::m_currentPosition
private

Definition at line 22 of file CoLaParameterReader.h.


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


sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 04:38:18