glove::comm::CommandInterface Class Reference
#include <CommandInterface.hpp>
List of all members.
|
Public Types |
typedef std::vector
< boost::uint8_t > | result_type |
Public Member Functions |
| CommandInterface () |
virtual | ~CommandInterface () |
virtual void | requestDeviceList (result_type &result)=0 |
virtual void | connect (result_type &result, const int deviceId)=0 |
virtual void | disconnect (result_type &result, const int deviceId)=0 |
virtual void | isConnected (result_type &result, const int deviceId)=0 |
virtual void | numSensors (result_type &result, const int deviceId)=0 |
virtual void | isRightHanded (result_type &result, const int deviceId)=0 |
virtual void | isLeftHanded (result_type &result, const int deviceId)=0 |
virtual void | getValue (result_type &result, const int deviceId, const int sensor)=0 |
virtual void | getValues (result_type &result, const int deviceId)=0 |
virtual void | info (result_type &result, const int deviceId)=0 |
virtual void | version (result_type &result, const int deviceId)=0 |
Static Public Member Functions |
template<typename T > |
static std::vector
< boost::uint8_t > | toByteVector (const T t) |
template<typename T > |
static std::vector
< boost::uint8_t > | toByteVectorN (const std::vector< T > v) |
static std::vector
< boost::uint8_t > | toByteVector (const std::string &str, const int length=-1) |
Detailed Description
This class defines the command interface for remote connections.
- Author:
- Christian Wressnegger
- Date:
- 2009-2010
Member Typedef Documentation
The result type for remote functions.
Constructor & Destructor Documentation
glove::comm::CommandInterface::CommandInterface |
( |
|
) |
|
virtual glove::comm::CommandInterface::~CommandInterface |
( |
|
) |
[virtual] |
Member Function Documentation
virtual void glove::comm::CommandInterface::connect |
( |
result_type & |
result, |
|
|
const int |
deviceId | |
|
) |
| | [pure virtual] |
Connects the device with the given id.
- Parameters:
-
[out] | result | The result blob. |
[in] | deviceId | The device to be addressed. |
virtual void glove::comm::CommandInterface::disconnect |
( |
result_type & |
result, |
|
|
const int |
deviceId | |
|
) |
| | [pure virtual] |
Disconnects the device with the given id.
- Parameters:
-
[out] | result | The result blob. |
[in] | deviceId | The device to be addressed. |
virtual void glove::comm::CommandInterface::getValue |
( |
result_type & |
result, |
|
|
const int |
deviceId, |
|
|
const int |
sensor | |
|
) |
| | [pure virtual] |
Returns the value of the specified sensor of the device with the given id.
- Parameters:
-
[out] | result | The result blob. |
[in] | deviceId | The device to be addressed. |
[in] | sensor | The sensor to be addressed. |
virtual void glove::comm::CommandInterface::getValues |
( |
result_type & |
result, |
|
|
const int |
deviceId | |
|
) |
| | [pure virtual] |
Returns the sensor values of the device with the given id.
- Parameters:
-
[out] | result | The result blob. |
[in] | deviceId | The device to be addressed. |
virtual void glove::comm::CommandInterface::info |
( |
result_type & |
result, |
|
|
const int |
deviceId | |
|
) |
| | [pure virtual] |
Returns human-readable about the device with the given id.
- Parameters:
-
[out] | result | The result blob. |
[in] | deviceId | The device to be addressed. |
virtual void glove::comm::CommandInterface::isConnected |
( |
result_type & |
result, |
|
|
const int |
deviceId | |
|
) |
| | [pure virtual] |
Indicates whether the device with the given id is connected or not.
- Parameters:
-
[out] | result | The result blob. |
[in] | deviceId | The device to be addressed. |
virtual void glove::comm::CommandInterface::isLeftHanded |
( |
result_type & |
result, |
|
|
const int |
deviceId | |
|
) |
| | [pure virtual] |
Indicates if the device with the given id is left handed or not.
- Parameters:
-
[out] | result | The result blob. |
[in] | deviceId | The device to be addressed. |
virtual void glove::comm::CommandInterface::isRightHanded |
( |
result_type & |
result, |
|
|
const int |
deviceId | |
|
) |
| | [pure virtual] |
Indicates if the device with the given id is right handed or not.
- Parameters:
-
[out] | result | The result blob. |
[in] | deviceId | The device to be addressed. |
virtual void glove::comm::CommandInterface::numSensors |
( |
result_type & |
result, |
|
|
const int |
deviceId | |
|
) |
| | [pure virtual] |
Returns the number of sensors the device with the given id has.
- Parameters:
-
[out] | result | The result blob. |
[in] | deviceId | The device to be addressed. |
virtual void glove::comm::CommandInterface::requestDeviceList |
( |
result_type & |
result |
) |
[pure virtual] |
Returns a list of available devices.
- Parameters:
-
[out] | result | The result blob. |
static std::vector<boost::uint8_t> glove::comm::CommandInterface::toByteVector |
( |
const std::string & |
str, |
|
|
const int |
length = -1 | |
|
) |
| | [static] |
Converts the given string to a vector of bytes.
- Parameters:
-
[in] | str | The value to be converted. |
[in] | length | Specifies the number of character to be used out of the given string. If this parameter is < 0 the whole string is used. |
- Returns:
- The converted value as vector of bytes.
template<typename T >
static std::vector<boost::uint8_t> glove::comm::CommandInterface::toByteVector |
( |
const T |
t |
) |
[inline, static] |
Converts the given value of type T to a vector of bytes.
- Template Parameters:
-
| T | A type that is able to be processed by a standard ostringstream. |
- Parameters:
-
[in] | t | The value to be converted. |
- Returns:
- The converted value as vector of bytes.
template<typename T >
static std::vector<boost::uint8_t> glove::comm::CommandInterface::toByteVectorN |
( |
const std::vector< T > |
v |
) |
[inline, static] |
Converts the given vector of value of type T to a vector of bytes.
- Template Parameters:
-
| T | A type that is able to be processed by a standard ostringstream. |
- Parameters:
-
[in] | v | The vector of values to be converted. |
- Returns:
- The converted values as vector of bytes.
virtual void glove::comm::CommandInterface::version |
( |
result_type & |
result, |
|
|
const int |
deviceId | |
|
) |
| | [pure virtual] |
Return the version of the device with the given id.
- Parameters:
-
[out] | result | The result blob. |
[in] | deviceId | The device to be addressed. |
The documentation for this class was generated from the following file: