11 #include "iotcs_virtual_device.h"
19 #define MUTEX_TYPE Mutex
21 #define MUTEX_TYPE std::mutex
58 template <
typename T>
Data&
set(
const std::string &attributeName,
const T& value)
throw (std::invalid_argument);
69 void submit(
void)
throw (std::invalid_argument);
81 Data(
VirtualDevice* device, iotcs_virtual_device_handle handle,
const std::string &dataName)
throw (std::invalid_argument);
82 static void onErrorCallback(
void* handler, iotcs_virtual_device_error_event *event);
85 iotcs_data_handle handle;
87 static MUTEX_TYPE mapMutex;
88 static std::map<void*, std::pair<VirtualDevice*, ErrorCallback*> > onErrorCallbacks;
virtual void setOnError(ErrorCallback *callback)
Set a callback that is invoked if an error occurs when submit an.
A callback interface for errors in delivery of messages.
Definition: AbstractVirtualDevice.hpp:152
Definition: VirtualDevice.hpp:38
virtual ~Data()
Destructor.
Data & set(const std::string &attributeName, const T &value)
Set the value of a field in the Data.
void submit(void)
Submit the data.