Robox Library for Cpp: BCC/31 module 1.0.0
RLibCpp BCC/31 protocol implementation
|
Class to handle variable data values. More...
#include <variable.h>
Classes | |
class | PtrVector |
Class to handle with lists of Data pointers. More... | |
class | Vector |
Class to handle with lists of Data. More... | |
Public Types | |
typedef Data * | pData |
Public Member Functions | |
Data () | |
Default constructor. | |
Data (const Data &src) | |
Copy constructor. | |
~Data () | |
Virtual destructor. | |
Message::DataTypes | type () const |
Get the data type. | |
bool | getBoolean () |
Get the value as Types::dtBool. | |
void | setBoolean (bool value) |
Sets the value to the specified one and type to Types::dtBool. | |
uint8_t | getU8 () |
Get the value as Types::dtU8. | |
void | setU8 (uint8_t value) |
Sets the value to the specified one and type to Types::dtU8. | |
int8_t | getI8 () |
Get the value as Types::dtI8. | |
void | setI8 (int8_t value) |
Sets the value to the specified one and type to Types::dtI8. | |
uint16_t | getU16 () |
Get the value as Types::dtU16. | |
void | setU16 (uint16_t value) |
Sets the value to the specified one and type to Types::dtU16. | |
int16_t | getI16 () |
Get the value as Types::dtI16. | |
void | setI16 (int16_t value) |
Sets the value to the specified one and type to Types::dtI16. | |
uint32_t | getU32 () |
Get the value as Types::dtU32. | |
void | setU32 (uint32_t value) |
Sets the value to the specified one and type to Types::dtU32. | |
int32_t | getI32 () |
Get the value as Types::dtI32. | |
void | setI32 (int32_t value) |
Sets the value to the specified one and type to Types::dtI32. | |
uint64_t | getU64 () |
Get the value as Types::dtU64. | |
void | setU64 (uint64_t value) |
Sets the value to the specified one and type to Types::dtU64. | |
int64_t | getI64 () |
Get the value as Types::dtI64. | |
void | setI64 (int64_t value) |
Sets the value to the specified one and type to Types::dtI64. | |
float | getSingle () |
Get the value as Types::dtSingle. | |
void | setSingle (float value) |
Sets the value to the specified one and type to Types::dtSingle. | |
double | getDouble () |
Get the value as Types::dtUDouble. | |
void | setDouble (double value) |
Sets the value to the specified one and type to Types::dtDouble. | |
String | getString () |
Get the value as Types::dtString. | |
void | setString (const String &value) |
Sets the value to the specified one and type to Types::dtString. | |
Data & | operator= (const Data &src) |
Assignmend operator. | |
Static Public Member Functions | |
static Data | fromU8 (uint8_t value) |
Factory method to get an object from a Types::dtU8. | |
static Data | fromI8 (int8_t value) |
Factory method to get an object from a Types::dtI8. | |
static Data | fromU16 (uint16_t value) |
Factory method to get an object from a Types::dtU16. | |
static Data | fromI16 (int16_t value) |
Factory method to get an object from a Types::dtI16. | |
static Data | fromU32 (uint32_t value) |
Factory method to get an object from a Types::dtU32. | |
static Data | fromI32 (int32_t value) |
Factory method to get an object from a Types::dtI32. | |
static Data | fromU64 (uint64_t value) |
Factory method to get an object from a Types::dtU64. | |
static Data | fromI64 (int64_t value) |
Factory method to get an object from a Types::dtI64. | |
static Data | fromSingle (float value) |
Factory method to get an object from a Types::dtSingle. | |
static Data | fromDouble (double value) |
Factory method to get an object from a Types::dtDouble. | |
static Data | fromString (const String &value) |
Factory method to get an object from a Types::dtString. | |
Class to handle variable data values.
Data | ( | ) |
Default constructor.
~Data | ( | ) |
Virtual destructor.
|
static |
Factory method to get an object from a Types::dtDouble.
value | The value to set |
|
static |
Factory method to get an object from a Types::dtI16.
value | The value to set |
|
static |
Factory method to get an object from a Types::dtI32.
value | The value to set |
|
static |
Factory method to get an object from a Types::dtI64.
value | The value to set |
|
static |
Factory method to get an object from a Types::dtI8.
value | The value to set |
The data value
The created object object
|
static |
Factory method to get an object from a Types::dtSingle.
value | The value to set |
|
static |
Factory method to get an object from a Types::dtString.
value | The value to set |
|
static |
Factory method to get an object from a Types::dtU16.
value | The value to set |
|
static |
Factory method to get an object from a Types::dtU32.
value | The value to set |
|
static |
Factory method to get an object from a Types::dtU64.
value | The value to set |
|
static |
Factory method to get an object from a Types::dtU8.
value | The value to set |
The data value
The created object object
bool getBoolean | ( | ) |
Get the value as Types::dtBool.
No check is provided about the data type consistency. Is up to you to check if the stored data type using the porper method type(). Getting value for improper data type as undefined behaviour
double getDouble | ( | ) |
Get the value as Types::dtUDouble.
No check is provided about the data type consistency. Is up to you to check if the stored data type using the porper method type(). Getting value for improper data type as undefined behaviour
int16_t getI16 | ( | ) |
Get the value as Types::dtI16.
No check is provided about the data type consistency. Is up to you to check if the stored data type using the porper method type(). Getting value for improper data type as undefined behaviour
int32_t getI32 | ( | ) |
Get the value as Types::dtI32.
No check is provided about the data type consistency. Is up to you to check if the stored data type using the porper method type(). Getting value for improper data type as undefined behaviour
int64_t getI64 | ( | ) |
Get the value as Types::dtI64.
No check is provided about the data type consistency. Is up to you to check if the stored data type using the porper method type(). Getting value for improper data type as undefined behaviour
int8_t getI8 | ( | ) |
Get the value as Types::dtI8.
No check is provided about the data type consistency. Is up to you to check if the stored data type using the porper method type(). Getting value for improper data type as undefined behaviour
float getSingle | ( | ) |
Get the value as Types::dtSingle.
No check is provided about the data type consistency. Is up to you to check if the stored data type using the porper method type(). Getting value for improper data type as undefined behaviour
String getString | ( | ) |
Get the value as Types::dtString.
No check is provided about the data type consistency. Is up to you to check if the stored data type using the porper method type(). Getting value for improper data type as undefined behaviour
uint16_t getU16 | ( | ) |
Get the value as Types::dtU16.
No check is provided about the data type consistency. Is up to you to check if the stored data type using the porper method type(). Getting value for improper data type as undefined behaviour
uint32_t getU32 | ( | ) |
Get the value as Types::dtU32.
No check is provided about the data type consistency. Is up to you to check if the stored data type using the porper method type(). Getting value for improper data type as undefined behaviour
uint64_t getU64 | ( | ) |
Get the value as Types::dtU64.
No check is provided about the data type consistency. Is up to you to check if the stored data type using the porper method type(). Getting value for improper data type as undefined behaviour
uint8_t getU8 | ( | ) |
Get the value as Types::dtU8.
No check is provided about the data type consistency. Is up to you to check if the stored data type using the porper method type(). Getting value for improper data type as undefined behaviour
Assignmend operator.
src | The source value |
void setBoolean | ( | bool | value | ) |
Sets the value to the specified one and type to Types::dtBool.
value | The value to set |
void setDouble | ( | double | value | ) |
Sets the value to the specified one and type to Types::dtDouble.
value | The value to set |
void setI16 | ( | int16_t | value | ) |
Sets the value to the specified one and type to Types::dtI16.
value | The value to set |
void setI32 | ( | int32_t | value | ) |
Sets the value to the specified one and type to Types::dtI32.
value | The value to set |
void setI64 | ( | int64_t | value | ) |
Sets the value to the specified one and type to Types::dtI64.
value | The value to set |
void setI8 | ( | int8_t | value | ) |
Sets the value to the specified one and type to Types::dtI8.
value | The value to set |
void setSingle | ( | float | value | ) |
Sets the value to the specified one and type to Types::dtSingle.
value | The value to set |
void setString | ( | const String & | value | ) |
Sets the value to the specified one and type to Types::dtString.
value | The value to set |
void setU16 | ( | uint16_t | value | ) |
Sets the value to the specified one and type to Types::dtU16.
value | The value to set |
void setU32 | ( | uint32_t | value | ) |
Sets the value to the specified one and type to Types::dtU32.
value | The value to set |
void setU64 | ( | uint64_t | value | ) |
Sets the value to the specified one and type to Types::dtU64.
value | The value to set |
void setU8 | ( | uint8_t | value | ) |
Sets the value to the specified one and type to Types::dtU8.
value | The value to set |
Variable::Data::Types type | ( | ) | const |
Get the data type.