Appearance
class flake::Object
#include <Object.h>
Inherits from flake::ConnectedObject, flake::IndicationSink, flake::ConfirmationSink
Public Functions
Name | |
---|---|
virtual int | invoke(string command, PropArray & params, bool blocking, Confirmation ** conf) =0 |
virtual int | broadcast(string message, PropArray & params) =0 |
virtual int | getProperties(PropArray & properties) =0 |
virtual int | setProperties(PropArray & properties, int timeout_ms) =0 |
virtual int | setProperty(const Property & property) =0 |
virtual void | getProperty(Property & property) =0 |
virtual int | subscribe(std::function< void(Indication &)> f) =0 |
virtual void | unsubscribe() =0 Unsubscribes from the object, effectively removing ALL subscriptions if there are multiple ones. |
virtual void | beginUpdate() =0 |
virtual int8_t | commitUpdate(int timeout_ms =0) =0 |
virtual int8_t | commitUpdate(PropArray * result, int timeout_ms =0) =0 |
virtual void | getPendingProperty(Property & property) =0 |
virtual int | getPendingProperties(PropArray & properties) =0 |
Protected Functions
Name | |
---|---|
~Object() =default |
Additional inherited members
Public Functions inherited from flake::ConnectedObject
Name | |
---|---|
virtual addr_t | addr() const =0 |
virtual addr_t | broadcastAddr() const =0 |
virtual void | ref() =0 |
virtual void | unref() =0 |
Protected Functions inherited from flake::ConnectedObject
Name | |
---|---|
~ConnectedObject() =default |
Public Attributes inherited from flake::ConnectedObject
Name | |
---|---|
const addr_t | EMPTY_ADDR |
Public Functions inherited from flake::IndicationSink
Name | |
---|---|
virtual void | onIndication(Indication & indication) =0 |
Protected Functions inherited from flake::IndicationSink
Name | |
---|---|
~IndicationSink() =default |
Public Functions inherited from flake::ConfirmationSink
Name | |
---|---|
virtual void | onConfirmation(Confirmation & confirmation) =0 |
Protected Functions inherited from flake::ConfirmationSink
Name | |
---|---|
~ConfirmationSink() =default |
Detailed Description
cpp
class flake::Object;
Document me
Public Functions Documentation
function invoke
cpp
virtual int invoke(
string command,
PropArray & params,
bool blocking,
Confirmation ** conf
) =0
Parameters:
- command name of the function to invoke
- params the functions parameters as ValueArray
- blocking wait for the return value of the function, can be set to false if the function is "void"
- conf return value of the function
Return:
invokes a function on the object. functions are implementation specific and not pre-defined for any device-class.
function broadcast
cpp
virtual int broadcast(
string message,
PropArray & params
) =0
Parameters:
- command name of the function to invoke
- params the functions parameters as ValueArray
Return:
broadcasts a message to all subscribers. messages are implementation specific and not pre-defined for any device-class.
function getProperties
cpp
virtual int getProperties(
PropArray & properties
) =0
Parameters:
- properties
Return:
function setProperties
cpp
virtual int setProperties(
PropArray & properties,
int timeout_ms
) =0
Parameters:
- properties
- timeout_ms
Return:
function setProperty
cpp
virtual int setProperty(
const Property & property
) =0
Parameters:
- property
Return:
document me
function getProperty
cpp
virtual void getProperty(
Property & property
) =0
Parameters:
- property
function subscribe
cpp
virtual int subscribe(
std::function< void(Indication &)> f
) =0
Parameters:
- f callback that gets called whenever anything in the object changes
Return: E_OK or an Error value, if the object cannot be subscribed for any reason
Call subscribe to get informed, when the object has updates, e.g. changed properties
function unsubscribe
cpp
virtual void unsubscribe() =0
Unsubscribes from the object, effectively removing ALL subscriptions if there are multiple ones.
function beginUpdate
cpp
virtual void beginUpdate() =0
if this is called before a call to setProperty all subsequent calls are queued and only sent, when commitUpdate() is called.
function commitUpdate
cpp
virtual int8_t commitUpdate(
int timeout_ms =0
) =0
Return: E_OK or an error value, if the call couldn't be executed
commits all setProperty calls since the last call of beginUpdate()
function commitUpdate
cpp
virtual int8_t commitUpdate(
PropArray * result,
int timeout_ms =0
) =0
Parameters:
- result Pointer to a ValueArray that will be filled with the properties that have been set
Return: E_OK or an error value, if the call couldn't be executed
commits all setProperty calls since the last call of beginUpdate() with the ValueArray parameter it returns either the new property values or error messages for all properties that couldn't be set
function getPendingProperty
cpp
virtual void getPendingProperty(
Property & property
) =0
Parameters:
- property
function getPendingProperties
cpp
virtual int getPendingProperties(
PropArray & properties
) =0
Parameters:
- properties
Return:
Protected Functions Documentation
function ~Object
cpp
~Object() =default