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

Builder for constructing CoLaCommands. More...

#include <CoLaParameterWriter.h>

Public Member Functions

const CoLaCommand build ()
 
 CoLaParameterWriter (CoLaCommandType::Enum type, const char *name)
 Construct a new CoLaParameterWriter. More...
 
CoLaParameterWriteroperator<< (const bool boolean)
 Add a boolean as a byte, with 0 representing false, and 1 representing true. More...
 
CoLaParameterWriteroperator<< (const char *str)
 Add a string parameter, must be null-terminated. More...
 
CoLaParameterWriteroperator<< (const double lReal)
 Add a IEEE-754 double precision (64-bit). More...
 
CoLaParameterWriteroperator<< (const float real)
 Add a IEEE-754 single precision (32-bit). More...
 
CoLaParameterWriteroperator<< (const int16_t integer)
 Add a signed int (16-bit). More...
 
CoLaParameterWriteroperator<< (const int32_t dInt)
 Add an signed double int (32-bit). More...
 
CoLaParameterWriteroperator<< (const int8_t sInt)
 Add a signed short (8-bit, range [-128, 127]). More...
 
CoLaParameterWriteroperator<< (const uint16_t uInt)
 Add a unsigned int (16-bit, range [0, 65535]). More...
 
CoLaParameterWriteroperator<< (const uint32_t uDInt)
 Add an unsigned double int (32-bit, range [0, 4294967295]). More...
 
CoLaParameterWriteroperator<< (const uint8_t uSInt)
 Add a unsigned short (8-bit, range [0, 255]). More...
 
CoLaParameterWriterparameterBool (const bool boolean)
 Add a boolean as a byte, with 0 representing false, and 1 representing true. More...
 
CoLaParameterWriterparameterDInt (const int32_t dInt)
 Add an signed double int (32-bit). More...
 
CoLaParameterWriterparameterFlexString (const std::string &str)
 Add a string as a flex string. More...
 
CoLaParameterWriterparameterInt (const int16_t integer)
 Add a signed int (16-bit). More...
 
CoLaParameterWriterparameterLReal (const double lReal)
 Add a IEEE-754 double precision (64-bit). More...
 
CoLaParameterWriterparameterPasswordMD5 (const std::string &str)
 Add the given password as a UDInt, using MD5 hashing. More...
 
CoLaParameterWriterparameterReal (const float real)
 Add a IEEE-754 single precision (32-bit). More...
 
CoLaParameterWriterparameterSInt (const int8_t sInt)
 Add a signed short (8-bit, range [-128, 127]). More...
 
CoLaParameterWriterparameterUDInt (const uint32_t uDInt)
 Add an unsigned double int (32-bit, range [0, 4294967295]). More...
 
CoLaParameterWriterparameterUInt (const uint16_t uInt)
 Add a unsigned int (16-bit, range [0, 65535]). More...
 
CoLaParameterWriterparameterUSInt (const uint8_t uSInt)
 Add a unsigned short (8-bit, range [0, 255]). More...
 
 ~CoLaParameterWriter ()
 

Private Member Functions

void writeHeader (CoLaCommandType::Enum type, const char *name)
 

Private Attributes

std::vector< uint8_t > m_buffer
 
const char * m_name
 
CoLaCommandType::Enum m_type
 

Detailed Description

Builder for constructing CoLaCommands.

Definition at line 19 of file CoLaParameterWriter.h.

Constructor & Destructor Documentation

◆ CoLaParameterWriter()

visionary::CoLaParameterWriter::CoLaParameterWriter ( CoLaCommandType::Enum  type,
const char *  name 
)

Construct a new CoLaParameterWriter.

Parameters
typeType of command.
nameThe command, e.g. for methods this should be the "communication name" from the CID.

Definition at line 17 of file CoLaParameterWriter.cpp.

◆ ~CoLaParameterWriter()

visionary::CoLaParameterWriter::~CoLaParameterWriter ( )
default

Member Function Documentation

◆ build()

const CoLaCommand visionary::CoLaParameterWriter::build ( )

Definition at line 181 of file CoLaParameterWriter.cpp.

◆ operator<<() [1/10]

CoLaParameterWriter & visionary::CoLaParameterWriter::operator<< ( const bool  boolean)

Add a boolean as a byte, with 0 representing false, and 1 representing true.

Parameters
booleanBoolean to add.
Returns
This builder.

Definition at line 176 of file CoLaParameterWriter.cpp.

◆ operator<<() [2/10]

CoLaParameterWriter & visionary::CoLaParameterWriter::operator<< ( const char *  str)

Add a string parameter, must be null-terminated.

Parameters
strString to add.
Returns
This builder.

Definition at line 130 of file CoLaParameterWriter.cpp.

◆ operator<<() [3/10]

CoLaParameterWriter & visionary::CoLaParameterWriter::operator<< ( const double  lReal)

Add a IEEE-754 double precision (64-bit).

Parameters
lRealLong real to add.
Returns
This builder.

Definition at line 171 of file CoLaParameterWriter.cpp.

◆ operator<<() [4/10]

CoLaParameterWriter & visionary::CoLaParameterWriter::operator<< ( const float  real)

Add a IEEE-754 single precision (32-bit).

Parameters
realReal to add.
Returns
This builder.

Definition at line 166 of file CoLaParameterWriter.cpp.

◆ operator<<() [5/10]

CoLaParameterWriter & visionary::CoLaParameterWriter::operator<< ( const int16_t  integer)

Add a signed int (16-bit).

Parameters
integerInt to add.
Returns
This builder.

Definition at line 146 of file CoLaParameterWriter.cpp.

◆ operator<<() [6/10]

CoLaParameterWriter & visionary::CoLaParameterWriter::operator<< ( const int32_t  dInt)

Add an signed double int (32-bit).

Parameters
dIntdInt to add.
Returns
This builder.

Definition at line 156 of file CoLaParameterWriter.cpp.

◆ operator<<() [7/10]

CoLaParameterWriter & visionary::CoLaParameterWriter::operator<< ( const int8_t  sInt)

Add a signed short (8-bit, range [-128, 127]).

Parameters
sIntSInt to add
Returns
This builder.

Definition at line 136 of file CoLaParameterWriter.cpp.

◆ operator<<() [8/10]

CoLaParameterWriter & visionary::CoLaParameterWriter::operator<< ( const uint16_t  uInt)

Add a unsigned int (16-bit, range [0, 65535]).

Parameters
uIntUInt to add.
Returns
This builder.

Definition at line 151 of file CoLaParameterWriter.cpp.

◆ operator<<() [9/10]

CoLaParameterWriter & visionary::CoLaParameterWriter::operator<< ( const uint32_t  uDInt)

Add an unsigned double int (32-bit, range [0, 4294967295]).

Parameters
uDIntUDInt to add.
Returns
This builder.

Definition at line 161 of file CoLaParameterWriter.cpp.

◆ operator<<() [10/10]

CoLaParameterWriter & visionary::CoLaParameterWriter::operator<< ( const uint8_t  uSInt)

Add a unsigned short (8-bit, range [0, 255]).

Parameters
uSIntUSInt to add.
Returns
This builder.

Definition at line 141 of file CoLaParameterWriter.cpp.

◆ parameterBool()

CoLaParameterWriter & visionary::CoLaParameterWriter::parameterBool ( const bool  boolean)

Add a boolean as a byte, with 0 representing false, and 1 representing true.

Parameters
booleanBoolean to add.
Returns
This builder.

Definition at line 90 of file CoLaParameterWriter.cpp.

◆ parameterDInt()

CoLaParameterWriter & visionary::CoLaParameterWriter::parameterDInt ( const int32_t  dInt)

Add an signed double int (32-bit).

Parameters
dIntdInt to add.
Returns
This builder.

Definition at line 54 of file CoLaParameterWriter.cpp.

◆ parameterFlexString()

CoLaParameterWriter & visionary::CoLaParameterWriter::parameterFlexString ( const std::string &  str)

Add a string as a flex string.

Parameters
strString to add.
Returns
This builder.

Definition at line 115 of file CoLaParameterWriter.cpp.

◆ parameterInt()

CoLaParameterWriter & visionary::CoLaParameterWriter::parameterInt ( const int16_t  integer)

Add a signed int (16-bit).

Parameters
integerInt to add.
Returns
This builder.

Definition at line 36 of file CoLaParameterWriter.cpp.

◆ parameterLReal()

CoLaParameterWriter & visionary::CoLaParameterWriter::parameterLReal ( const double  lReal)

Add a IEEE-754 double precision (64-bit).

Parameters
lRealLong real to add.
Returns
This builder.

Definition at line 81 of file CoLaParameterWriter.cpp.

◆ parameterPasswordMD5()

CoLaParameterWriter & visionary::CoLaParameterWriter::parameterPasswordMD5 ( const std::string &  str)

Add the given password as a UDInt, using MD5 hashing.

Parameters
strString to hash and add as parameter.
Returns
This builder.

Definition at line 96 of file CoLaParameterWriter.cpp.

◆ parameterReal()

CoLaParameterWriter & visionary::CoLaParameterWriter::parameterReal ( const float  real)

Add a IEEE-754 single precision (32-bit).

Parameters
realReal to add.
Returns
This builder.

Definition at line 72 of file CoLaParameterWriter.cpp.

◆ parameterSInt()

CoLaParameterWriter & visionary::CoLaParameterWriter::parameterSInt ( const int8_t  sInt)

Add a signed short (8-bit, range [-128, 127]).

Parameters
sIntSInt to add
Returns
This builder.

Definition at line 24 of file CoLaParameterWriter.cpp.

◆ parameterUDInt()

CoLaParameterWriter & visionary::CoLaParameterWriter::parameterUDInt ( const uint32_t  uDInt)

Add an unsigned double int (32-bit, range [0, 4294967295]).

Parameters
uDIntUDInt to add.
Returns
This builder.

Definition at line 63 of file CoLaParameterWriter.cpp.

◆ parameterUInt()

CoLaParameterWriter & visionary::CoLaParameterWriter::parameterUInt ( const uint16_t  uInt)

Add a unsigned int (16-bit, range [0, 65535]).

Parameters
uIntUInt to add.
Returns
This builder.

Definition at line 45 of file CoLaParameterWriter.cpp.

◆ parameterUSInt()

CoLaParameterWriter & visionary::CoLaParameterWriter::parameterUSInt ( const uint8_t  uSInt)

Add a unsigned short (8-bit, range [0, 255]).

Parameters
uSIntUSInt to add.
Returns
This builder.

Definition at line 30 of file CoLaParameterWriter.cpp.

◆ writeHeader()

void visionary::CoLaParameterWriter::writeHeader ( CoLaCommandType::Enum  type,
const char *  name 
)
private

Definition at line 189 of file CoLaParameterWriter.cpp.

Member Data Documentation

◆ m_buffer

std::vector<uint8_t> visionary::CoLaParameterWriter::m_buffer
private

Definition at line 24 of file CoLaParameterWriter.h.

◆ m_name

const char* visionary::CoLaParameterWriter::m_name
private

Definition at line 23 of file CoLaParameterWriter.h.

◆ m_type

CoLaCommandType::Enum visionary::CoLaParameterWriter::m_type
private

Definition at line 22 of file CoLaParameterWriter.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