Robox Library for Cpp: BCC/31 module 1.0.0
RLibCpp BCC/31 protocol implementation
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
Variable::Data Class Reference

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 DatapData
 

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.
 
Dataoperator= (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.
 

Detailed Description

Class to handle variable data values.

Member Typedef Documentation

◆ pData

typedef Data* pData

Constructor & Destructor Documentation

◆ Data() [1/2]

Data ( )

Default constructor.

◆ Data() [2/2]

Data ( const Data & src)

Copy constructor.

Parameters
srcThe source value

◆ ~Data()

~Data ( )

Virtual destructor.

Member Function Documentation

◆ fromDouble()

static Data fromDouble ( double value)
static

Factory method to get an object from a Types::dtDouble.

Parameters
valueThe value to set
Returns
The created object object

◆ fromI16()

static Data fromI16 ( int16_t value)
static

Factory method to get an object from a Types::dtI16.

Parameters
valueThe value to set
Returns
The created object object

◆ fromI32()

static Data fromI32 ( int32_t value)
static

Factory method to get an object from a Types::dtI32.

Parameters
valueThe value to set
Returns
The created object object

◆ fromI64()

static Data fromI64 ( int64_t value)
static

Factory method to get an object from a Types::dtI64.

Parameters
valueThe value to set
Returns
The created object object

◆ fromI8()

static Data fromI8 ( int8_t value)
static

Factory method to get an object from a Types::dtI8.

Parameters
valueThe value to set
Returns

The data value

The created object object

◆ fromSingle()

static Data fromSingle ( float value)
static

Factory method to get an object from a Types::dtSingle.

Parameters
valueThe value to set
Returns
The created object object

◆ fromString()

static Data fromString ( const String & value)
static

Factory method to get an object from a Types::dtString.

Parameters
valueThe value to set
Returns
The created object object

◆ fromU16()

static Data fromU16 ( uint16_t value)
static

Factory method to get an object from a Types::dtU16.

Parameters
valueThe value to set
Returns
The created object object

◆ fromU32()

static Data fromU32 ( uint32_t value)
static

Factory method to get an object from a Types::dtU32.

Parameters
valueThe value to set
Returns
The created object object

◆ fromU64()

static Data fromU64 ( uint64_t value)
static

Factory method to get an object from a Types::dtU64.

Parameters
valueThe value to set
Returns
The created object object

◆ fromU8()

static Data fromU8 ( uint8_t value)
static

Factory method to get an object from a Types::dtU8.

Parameters
valueThe value to set
Returns

The data value

The created object object

◆ getBoolean()

bool getBoolean ( )

Get the value as Types::dtBool.

Returns
The data value

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

◆ getDouble()

double getDouble ( )

Get the value as Types::dtUDouble.

Returns
The data value

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

◆ getI16()

int16_t getI16 ( )

Get the value as Types::dtI16.

Returns
The data value

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

◆ getI32()

int32_t getI32 ( )

Get the value as Types::dtI32.

Returns
The data value

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

◆ getI64()

int64_t getI64 ( )

Get the value as Types::dtI64.

Returns
The data value

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

◆ getI8()

int8_t getI8 ( )

Get the value as Types::dtI8.

Returns
The data value

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

◆ getSingle()

float getSingle ( )

Get the value as Types::dtSingle.

Returns
The data value

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

◆ getString()

String getString ( )

Get the value as Types::dtString.

Returns
The data value

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

◆ getU16()

uint16_t getU16 ( )

Get the value as Types::dtU16.

Returns
The data value

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

◆ getU32()

uint32_t getU32 ( )

Get the value as Types::dtU32.

Returns
The data value

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

◆ getU64()

uint64_t getU64 ( )

Get the value as Types::dtU64.

Returns
The data value

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

◆ getU8()

uint8_t getU8 ( )

Get the value as Types::dtU8.

Returns
The data value

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

◆ operator=()

Data & operator= ( const Data & src)

Assignmend operator.

Parameters
srcThe source value
Returns
A reference to this object

◆ setBoolean()

void setBoolean ( bool value)

Sets the value to the specified one and type to Types::dtBool.

Parameters
valueThe value to set

◆ setDouble()

void setDouble ( double value)

Sets the value to the specified one and type to Types::dtDouble.

Parameters
valueThe value to set

◆ setI16()

void setI16 ( int16_t value)

Sets the value to the specified one and type to Types::dtI16.

Parameters
valueThe value to set

◆ setI32()

void setI32 ( int32_t value)

Sets the value to the specified one and type to Types::dtI32.

Parameters
valueThe value to set

◆ setI64()

void setI64 ( int64_t value)

Sets the value to the specified one and type to Types::dtI64.

Parameters
valueThe value to set

◆ setI8()

void setI8 ( int8_t value)

Sets the value to the specified one and type to Types::dtI8.

Parameters
valueThe value to set

◆ setSingle()

void setSingle ( float value)

Sets the value to the specified one and type to Types::dtSingle.

Parameters
valueThe value to set

◆ setString()

void setString ( const String & value)

Sets the value to the specified one and type to Types::dtString.

Parameters
valueThe value to set

◆ setU16()

void setU16 ( uint16_t value)

Sets the value to the specified one and type to Types::dtU16.

Parameters
valueThe value to set

◆ setU32()

void setU32 ( uint32_t value)

Sets the value to the specified one and type to Types::dtU32.

Parameters
valueThe value to set

◆ setU64()

void setU64 ( uint64_t value)

Sets the value to the specified one and type to Types::dtU64.

Parameters
valueThe value to set

◆ setU8()

void setU8 ( uint8_t value)

Sets the value to the specified one and type to Types::dtU8.

Parameters
valueThe value to set

◆ type()

Variable::Data::Types type ( ) const

Get the data type.

Returns
The parameter value