Class CoLaParameterWriter
Defined in File CoLaParameterWriter.h
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 ¶meterSInt(const int8_t sInt)
Add a signed short (8-bit, range [-128, 127]).
- Parameters:
sInt – SInt to add
- Returns:
This builder.
-
CoLaParameterWriter ¶meterUSInt(const uint8_t uSInt)
Add a unsigned short (8-bit, range [0, 255]).
- Parameters:
uSInt – USInt to add.
- Returns:
This builder.
-
CoLaParameterWriter ¶meterInt(const int16_t integer)
Add a signed int (16-bit).
- Parameters:
integer – Int to add.
- Returns:
This builder.
-
CoLaParameterWriter ¶meterUInt(const uint16_t uInt)
Add a unsigned int (16-bit, range [0, 65535]).
- Parameters:
uInt – UInt to add.
- Returns:
This builder.
-
CoLaParameterWriter ¶meterDInt(const int32_t dInt)
Add an signed double int (32-bit).
- Parameters:
dInt – dInt to add.
- Returns:
This builder.
-
CoLaParameterWriter ¶meterUDInt(const uint32_t uDInt)
Add an unsigned double int (32-bit, range [0, 4294967295]).
- Parameters:
uDInt – UDInt to add.
- Returns:
This builder.
-
CoLaParameterWriter ¶meterReal(const float real)
Add a IEEE-754 single precision (32-bit).
- Parameters:
real – Real to add.
- Returns:
This builder.
-
CoLaParameterWriter ¶meterLReal(const double lReal)
Add a IEEE-754 double precision (64-bit).
- Parameters:
lReal – Long real to add.
- Returns:
This builder.
-
CoLaParameterWriter ¶meterBool(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 ¶meterPasswordMD5(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 ¶meterFlexString(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()
-
CoLaParameterWriter(CoLaCommandType::Enum type, const char *name)