Appearance
class flake::Object
#include <Object.h>
Public Functions
| Name | |
|---|---|
| virtual [int] | invoke(std::string command, PropArray & params, [bool] blocking, PropArray & reply) =0 |
| virtual [int] | broadcast([const] std::string command, PropArray & params) =0 |
| virtual [int] | getProperties(PropArray & properties) =0 |
| virtual [int] | setProperties(PropArray & properties) =0 |
| virtual [int] | setProperty([const]Property & property) =0 |
| virtual [void] | getProperty(Property & property) =0 |
| virtual [int] | openProperty([const][uint32_t] propTag, Stream ** stream) =0 |
| virtual [int] | subscribe(std::function< [void]([const]Indication &)> f) =0 |
| virtual [void] | unsubscribe() =0 Unsubscribes from the object, effectively removing ALL subscriptions if there are multiple ones. |
| virtual [int] | sync([unsigned] timeout_ms, [bool] block) =0 |
| virtual [void] | defer() =0 instead of syncing defer the current cache to the next sync |
| virtual [int] | syncDeferred([unsigned] timeout_ms, [bool] block) =0 |
| virtual [bool] | hasDeferred() =0 |
| virtual [void] | clear() =0 |
Protected Functions
| Name | |
|---|---|
| ~Object() =default | |
| virtual ObjectImpl * | impl() =0 |
Friends
| Name | |
|---|---|
| [class] | ConnectionImpl(ConnectionImpl ) |
Detailed Description
cpp
class flake::Object;Document me
Public Functions Documentation
function invoke
cpp
virtual int invoke(
std::string command,
PropArray & params,
bool blocking,
PropArray & reply
) =0Parameters:
- 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(
const std::string command,
PropArray & params
) =0Parameters:
- message 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
) =0Parameters:
- properties
Return:
function setProperties
cpp
virtual int setProperties(
PropArray & properties
) =0Parameters:
- properties
Return:
function setProperty
cpp
virtual int setProperty(
constProperty & property
) =0Parameters:
- property
Return:
document me
function getProperty
cpp
virtual void getProperty(
Property & property
) =0Parameters:
- property
function openProperty
cpp
virtual int openProperty(
constuint32_t propTag,
Stream ** stream
) =0function subscribe
cpp
virtual int subscribe(
std::function< void(constIndication &)> f
) =0Parameters:
- 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() =0Unsubscribes from the object, effectively removing ALL subscriptions if there are multiple ones.
function sync
cpp
virtual int sync(
unsigned timeout_ms,
bool block
) =0Alternative to [beginUpdate()] / [commitUpdate()] all pending properties from all threads are committed at once
function defer
cpp
virtual void defer() =0instead of syncing defer the current cache to the next sync
function syncDeferred
cpp
virtual int syncDeferred(
unsigned timeout_ms,
bool block
) =0function hasDeferred
cpp
virtual bool hasDeferred() =0function clear
cpp
virtual void clear() =0Protected Functions Documentation
function ~Object
cpp
~Object() =defaultfunction impl
cpp
virtual ObjectImpl * impl() =0Friends
friend ConnectionImpl
cpp
friend class ConnectionImpl(
ConnectionImpl
);