15 #include "iotcs_virtual_device.h"
16 #include "iotcs_config.h"
17 #include <NamedValue.hpp>
22 #define DEPRECATED(func,msg) func __attribute__ ((deprecated(msg))) = 0
23 #elif defined(_MSC_VER)
24 #define DEPRECATED(func,msg) __declspec(deprecated(msg)) func = 0
26 #pragma message("WARNING: You need to implement DEPRECATED for this compiler")
27 #define DEPRECATED(func) func
57 template <
typename T>
VirtualDevice&
set(
const std::string &attributeName,
const T& value)
throw(std::invalid_argument);
59 #if defined IOTCS_IMPLICIT_EDGE_COMPUTING || defined IOTCS_DOXYGEN
73 template <
typename T>
VirtualDevice&
offer(
const std::string &attributeName,
const T& value)
throw(std::invalid_argument);
102 template <
typename T> T
get(
const std::string &attributeName);
147 DEPRECATED(
virtual void setCallable(
const std::string &actionName,
const Callable *callback),
"This API does not support actions with multiple arguments. Use setOnAction(std::string, iotdcl::ActionCallback)");
149 iotcs_virtual_device_handle handle;
150 std::vector<StorageObject*> eo_list;
virtual void call(VirtualDevice *virtualDevice, const NamedValue &data) const =0
The method called for handling a device model action.
Callback interface for actions in the device model.
Definition: VirtualDevice.hpp:156
VirtualDevice & offer(const std::string &attributeName, const T &value)
Offer to set the value of an attribute.
Represents a set of custom data fields (key/value pair) to be sent to the server. ...
DEPRECATED(virtual void setCallable(const std::string &actionName, const Callable *callback),"This API does not support actions with multiple arguments. Use setOnAction(std::string, iotdcl::ActionCallback)")
Set callback for handling an action.
An Alert to be sent to the server.
virtual Data & createData(const std::string &format)=0
Create a custom iotdcl::Data object for this VirtualDevice.
Definition: NamedValue.hpp:24
virtual ~Callable()
Desctructor.
Definition: VirtualDevice.hpp:172
Definition: VirtualDevice.hpp:38
VirtualDevice & set(const std::string &attributeName, const T &value)
Set the value of an attribute.
A callback interface for receiving notification of an Action.
Definition: AbstractVirtualDevice.hpp:99
virtual Alert & createAlert(const std::string &format)=0
Create an iotdcl::Alert for this VirtualDevice.
virtual void setOnAction(const std::string &actionName, const ActionCallback *callback)=0
Set a callback that is invoked when an action for the given name is received.
AbstractVirtualDevice is a representation of a device model implemented by an endpoint.
Definition: AbstractVirtualDevice.hpp:202
Definition: StorageObject.hpp:158