Class CoLaParameterWriter

Class Documentation

class CoLaParameterWriter

Builder for constructing CoLaCommands.

Public Functions

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

Construct a new CoLaParameterWriter.

Parameters:
  • type – Type of command.

  • command – The command, e.g. for methods this should be the “communication name” from the CID.

~CoLaParameterWriter()
CoLaParameterWriter &parameterSInt(const int8_t sInt)

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

Parameters:

sInt – SInt to add

Returns:

This builder.

CoLaParameterWriter &parameterUSInt(const uint8_t uSInt)

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

Parameters:

uSInt – USInt to add.

Returns:

This builder.

CoLaParameterWriter &parameterInt(const int16_t integer)

Add a signed int (16-bit).

Parameters:

integer – Int to add.

Returns:

This builder.

CoLaParameterWriter &parameterUInt(const uint16_t uInt)

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

Parameters:

uInt – UInt to add.

Returns:

This builder.

CoLaParameterWriter &parameterDInt(const int32_t dInt)

Add an signed double int (32-bit).

Parameters:

dInt – dInt to add.

Returns:

This builder.

CoLaParameterWriter &parameterUDInt(const uint32_t uDInt)

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

Parameters:

uDInt – UDInt to add.

Returns:

This builder.

CoLaParameterWriter &parameterReal(const float real)

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

Parameters:

real – Real to add.

Returns:

This builder.

CoLaParameterWriter &parameterLReal(const double lReal)

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

Parameters:

lReal – Long real to add.

Returns:

This builder.

CoLaParameterWriter &parameterBool(const bool boolean)

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

Parameters:

boolean – Boolean to add.

Returns:

This builder.

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

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

Parameters:

str – String to hash and add as parameter.

Returns:

This builder.

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

Add a string as a flex string.

Parameters:

string – String to add.

Returns:

This builder.

CoLaParameterWriter &operator<<(const char *str)

Add a string parameter, must be null-terminated.

Parameters:

str – String to add.

Returns:

This builder.

CoLaParameterWriter &operator<<(const int8_t sInt)

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

Parameters:

sInt – SInt to add

Returns:

This builder.

CoLaParameterWriter &operator<<(const uint8_t uSInt)

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

Parameters:

uSInt – USInt to add.

Returns:

This builder.

CoLaParameterWriter &operator<<(const int16_t integer)

Add a signed int (16-bit).

Parameters:

integer – Int to add.

Returns:

This builder.

CoLaParameterWriter &operator<<(const uint16_t uInt)

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

Parameters:

uInt – UInt to add.

Returns:

This builder.

CoLaParameterWriter &operator<<(const int32_t dInt)

Add an signed double int (32-bit).

Parameters:

dInt – dInt to add.

Returns:

This builder.

CoLaParameterWriter &operator<<(const uint32_t uDInt)

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

Parameters:

uDInt – UDInt to add.

Returns:

This builder.

CoLaParameterWriter &operator<<(const float real)

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

Parameters:

real – Real to add.

Returns:

This builder.

CoLaParameterWriter &operator<<(const double lReal)

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

Parameters:

lReal – Long real to add.

Returns:

This builder.

CoLaParameterWriter &operator<<(const bool boolean)

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

Parameters:

boolean – Boolean to add.

Returns:

This builder.

const CoLaCommand build()