Appearance
class flake::ObjectImpl
#include </Users/ios_developer/workspace/coldwave-os/build/_deps/flake-src/ObjectImpl.h>
Inherits from flake::ConnectedObjectImpl, flake::Object, flake::PropArray, AtomicRef, flake::ConnectedObject, flake::IndicationSink, flake::ConfirmationSink, flake::Serializable
Public Functions
Name | |
---|---|
ObjectImpl() | |
ObjectImpl(Service * srv) | |
Connection * | connection() |
const char * | getObjectType() |
bool | isInitialized() |
virtual TagArray | defaultPropset() |
virtual int | subscribe(std::function< void(Indication &)> f) override |
virtual void | unsubscribe() override Unsubscribes from the object, effectively removing ALL subscriptions if there are multiple ones. |
virtual int | invoke(string command, PropArray & params, bool blocking, Confirmation ** conf) override |
virtual int | broadcast(const string message, PropArray & params) override |
virtual int | setProperty(const Property & property) override |
virtual void | getProperty(Property & property) override |
virtual int | getProperties(PropArray & properties) override |
virtual int | setProperties(PropArray & properties, int timeout_ms =FLAKE_DEFAULT_TIMEOUT_MS) override |
int | setPropertiesEx(PropArray & properties, bool dontBlock =false, int timeout_ms =FLAKE_DEFAULT_TIMEOUT_MS) |
virtual void | beginUpdate() override |
virtual int8_t | commitUpdate(int timeout_ms =0) override |
virtual int8_t | commitUpdate(PropArray * result, int timeout_ms =0) override |
virtual void | getPendingProperty(Property & property) override |
virtual int | getPendingProperties(PropArray & properties) override |
virtual void | ref() override |
virtual void | unref() override |
Protected Functions
Name | |
---|---|
ObjectImpl(ConnectionImpl * conn) | |
virtual | ~ObjectImpl() |
virtual void | onInitialized() |
virtual void | onIndication(Indication & indication) override |
virtual void | onConfirmation(Confirmation & confirmation) override |
int | registerProperties(PropArray & properties) |
virtual int8_t | handleCustomMessage(string name, PropArray & data, PropArray & outProps) |
virtual int8_t | handleStreamData(Stream * s, byte * cb, uint32_t len) |
virtual int | setPropertyRequested(uint32_t tag, Property & value, const PropArray & transaction, bool internal) |
virtual int | getPropertyRequested(uint32_t tag, Property & value) |
Public Attributes
Name | |
---|---|
const addr_t | EMPTY_ADDR |
Friends
Name | |
---|---|
class | ConnectionImpl |
class | Service |
Additional inherited members
Public Functions inherited from flake::ConnectedObjectImpl
Name | |
---|---|
ConnectedObjectImpl(ConnectionImpl * conn) | |
~ConnectedObjectImpl() override | |
virtual addr_t | addr() const override |
virtual addr_t | broadcastAddr() const override |
Protected Attributes inherited from flake::ConnectedObjectImpl
Name | |
---|---|
addr_t | m_addr |
addr_t | m_parentAddr |
addr_t | m_broadcastAddr |
ConnectionImpl * | m_connection |
Protected Functions inherited from flake::Object
Name | |
---|---|
~Object() =default |
Public Functions inherited from flake::PropArray
Name | |
---|---|
virtual | ~PropArray() |
PropArray() | |
PropArray(const PropArray & va) | |
const Property & | operator[](size_type __n) const |
PropArray & | operator=(const PropArray & other) |
void | copyFrom(const PropArray & other) |
void | clear() |
const Property & | get(uint32_t tag) const |
bool | has(uint32_t tag) const |
void | set(const Property & val) |
char * | toString() |
size_type | count() const |
virtual bool | serialize(uint16_t * len, flake::byte ** buf) override |
virtual bool | unserialize(uint16_t len, flake::byte * buf) override |
Public Attributes inherited from flake::PropArray
Name | |
---|---|
Property | VAL_ERR_NOT_FOUND |
Public Functions inherited from flake::ConnectedObject
Name | |
---|---|
virtual addr_t | addr() const =0 |
virtual addr_t | broadcastAddr() const =0 |
Protected Functions inherited from flake::ConnectedObject
Name | |
---|---|
~ConnectedObject() =default |
Protected Functions inherited from flake::IndicationSink
Name | |
---|---|
~IndicationSink() =default |
Protected Functions inherited from flake::ConfirmationSink
Name | |
---|---|
~ConfirmationSink() =default |
Public Functions inherited from flake::Serializable
Name | |
---|---|
virtual bool | serialize(uint16_t * len, flake::byte ** buf) =0 |
virtual bool | unserialize(uint16_t len, flake::byte * buf) =0 |
Protected Functions inherited from flake::Serializable
Name | |
---|---|
~Serializable() =default |
Public Functions Documentation
function ObjectImpl
cpp
ObjectImpl()
function ObjectImpl
cpp
ObjectImpl(
Service * srv
)
function connection
cpp
Connection * connection()
function getObjectType
cpp
const char * getObjectType()
function isInitialized
cpp
bool isInitialized()
function defaultPropset
cpp
virtual TagArray defaultPropset()
function subscribe
cpp
virtual int subscribe(
std::function< void(Indication &)> f
) override
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
Reimplements: flake::Object::subscribe
Call subscribe to get informed, when the object has updates, e.g. changed properties
function unsubscribe
cpp
virtual void unsubscribe() override
Unsubscribes from the object, effectively removing ALL subscriptions if there are multiple ones.
Reimplements: flake::Object::unsubscribe
function invoke
cpp
virtual int invoke(
string command,
PropArray & params,
bool blocking,
Confirmation ** conf
) override
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:
Reimplements: flake::Object::invoke
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 string message,
PropArray & params
) override
Parameters:
- command name of the function to invoke
- params the functions parameters as ValueArray
Return:
Reimplements: flake::Object::broadcast
broadcasts a message to all subscribers. messages are implementation specific and not pre-defined for any device-class.
function setProperty
cpp
virtual int setProperty(
const Property & property
) override
Parameters:
- property
Return:
Reimplements: flake::Object::setProperty
document me
function getProperty
cpp
virtual void getProperty(
Property & property
) override
Parameters:
- property
Reimplements: flake::Object::getProperty
function getProperties
cpp
virtual int getProperties(
PropArray & properties
) override
Parameters:
- properties
Return:
Reimplements: flake::Object::getProperties
function setProperties
cpp
virtual int setProperties(
PropArray & properties,
int timeout_ms =FLAKE_DEFAULT_TIMEOUT_MS
) override
Parameters:
- properties
- timeout_ms
Return:
Reimplements: flake::Object::setProperties
function setPropertiesEx
cpp
int setPropertiesEx(
PropArray & properties,
bool dontBlock =false,
int timeout_ms =FLAKE_DEFAULT_TIMEOUT_MS
)
This is strictly temporary, because the backend still expects an original object to "setAsSelf"
function beginUpdate
cpp
virtual void beginUpdate() override
Reimplements: flake::Object::beginUpdate
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
) override
Return: E_OK or an error value, if the call couldn't be executed
Reimplements: flake::Object::commitUpdate
commits all setProperty calls since the last call of beginUpdate()
function commitUpdate
cpp
virtual int8_t commitUpdate(
PropArray * result,
int timeout_ms =0
) override
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
Reimplements: flake::Object::commitUpdate
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
) override
Parameters:
- property
Reimplements: flake::Object::getPendingProperty
function getPendingProperties
cpp
virtual int getPendingProperties(
PropArray & properties
) override
Parameters:
- properties
Return:
Reimplements: flake::Object::getPendingProperties
function ref
cpp
inline virtual void ref() override
Reimplements: flake::ConnectedObject::ref
function unref
cpp
inline virtual void unref() override
Reimplements: flake::ConnectedObject::unref
Protected Functions Documentation
function ObjectImpl
cpp
explicit ObjectImpl(
ConnectionImpl * conn
)
function ~ObjectImpl
cpp
virtual ~ObjectImpl()
function onInitialized
cpp
virtual void onInitialized()
function onIndication
cpp
virtual void onIndication(
Indication & indication
) override
Parameters:
- indication
Reimplements: flake::ConnectedObjectImpl::onIndication
function onConfirmation
cpp
virtual void onConfirmation(
Confirmation & confirmation
) override
Parameters:
- confirmation
Reimplements: flake::ConnectedObjectImpl::onConfirmation
function registerProperties
cpp
int registerProperties(
PropArray & properties
)
function handleCustomMessage
cpp
virtual int8_t handleCustomMessage(
string name,
PropArray & data,
PropArray & outProps
)
function handleStreamData
cpp
virtual int8_t handleStreamData(
Stream * s,
byte * cb,
uint32_t len
)
function setPropertyRequested
cpp
virtual int setPropertyRequested(
uint32_t tag,
Property & value,
const PropArray & transaction,
bool internal
)
function getPropertyRequested
cpp
virtual int getPropertyRequested(
uint32_t tag,
Property & value
)
Public Attributes Documentation
variable EMPTY_ADDR
cpp
static const addr_t flake::ObjectImpl::EMPTY_ADDR
Friends
friend ConnectionImpl
cpp
friend class ConnectionImpl(
ConnectionImpl
);
friend Service
cpp
friend class Service(
Service
);