ros2_control - rolling
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
hardware_interface::HandleDataType Class Reference

Public Types

enum  Value : int8_t { UNKNOWN = -1 , DOUBLE , BOOL }
 

Public Member Functions

constexpr HandleDataType (Value value)
 
 HandleDataType (const std::string &data_type)
 
 operator Value () const
 
 operator bool () const =delete
 
constexpr bool operator== (HandleDataType other) const
 
constexpr bool operator!= (HandleDataType other) const
 
constexpr bool operator== (Value other) const
 
constexpr bool operator!= (Value other) const
 
std::string to_string () const
 
bool is_castable_to_double () const
 Check if the HandleDataType can be casted to double.
 
double cast_to_double (const HANDLE_DATATYPE &value) const
 Cast the given value to double.
 
HandleDataType from_string (const std::string &data_type)
 

Member Function Documentation

◆ cast_to_double()

double hardware_interface::HandleDataType::cast_to_double ( const HANDLE_DATATYPE value) const
inline

Cast the given value to double.

Parameters
valueThe value to be casted.
Returns
The casted value.
Exceptions
std::runtime_errorif the HandleDataType cannot be casted to double.
Note
Once we add support for more data types, this function should be updated

◆ is_castable_to_double()

bool hardware_interface::HandleDataType::is_castable_to_double ( ) const
inline

Check if the HandleDataType can be casted to double.

Returns
True if the HandleDataType can be casted to double, false otherwise.
Note
Once we add support for more data types, this function should be updated

The documentation for this class was generated from the following file: