CPP Device Virtualization API Reference for Oracle Internet of Things Cloud Service Client Software Library. Release 21.1.1.0.0-3. E92477-09
|
Public Member Functions | |
virtual | ~Alert () |
Destructor. | |
template<typename T > | |
Alert & | set (const std::string &attributeName, const T &value) throw (std::invalid_argument) |
Set the value of a field in the. More... | |
void | raise (void) throw (std::invalid_argument) |
Send the alert. More... | |
virtual void | setOnError (ErrorCallback *callback) |
Set a callback that is invoked if an error occurs when raising an. More... | |
Protected Member Functions | |
Alert (VirtualDevice *device, iotcs_virtual_device_handle handler, const std::string &alertName) throw (std::invalid_argument) | |
Static Protected Member Functions | |
static void | onErrorCallback (void *handler, iotcs_virtual_device_error_event *event) |
void iotdcl::Alert::raise | ( | void | ) | ||
throw | ( | std::invalid_argument | |||
) |
Send the alert.
The event time is set when this method is called.
The onError handler of the parent virtual device will be called if there is error sending the alert ***exception is thrown.
All fields defined in the format that are
must be set before calling raise(). If raise() is called before setting all
fields, an std::invalid_argument.
std::invalid_argument |
Alert& iotdcl::Alert::set | ( | const std::string & | attributeName, |
const T & | value | ||
) | |||
throw | ( | std::invalid_argument | |
) |
Set the value of a field in the.
. The fields are determined by the format given when the Alert is created. The value is validated according to the constraints in the format. If the value is not valid, an IllegalArgumentException is raised.
All fields defined in the format that are
must be set before calling raise().
<T> | the type of the value. |
attributeName | the name of a field from the alert format |
value | the value to set |
std::invalid_argument | if the value is not valid, or attributeName is NULL |
|
virtual |
Set a callback that is invoked if an error occurs when raising an.
.
callback | a callback to invoke when there is an error setting a value, if NULL, the existing callback will be removed |