Skip to content

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()
boolisInitialized()
virtual TagArraydefaultPropset()
virtual intsubscribe(std::function< void(Indication &)> f) override
virtual voidunsubscribe() override
Unsubscribes from the object, effectively removing ALL subscriptions if there are multiple ones.
virtual intinvoke(string command, PropArray & params, bool blocking, Confirmation ** conf) override
virtual intbroadcast(const string message, PropArray & params) override
virtual intsetProperty(const Property & property) override
virtual voidgetProperty(Property & property) override
virtual intgetProperties(PropArray & properties) override
virtual intsetProperties(PropArray & properties, int timeout_ms =FLAKE_DEFAULT_TIMEOUT_MS) override
intsetPropertiesEx(PropArray & properties, bool dontBlock =false, int timeout_ms =FLAKE_DEFAULT_TIMEOUT_MS)
virtual voidbeginUpdate() override
virtual int8_tcommitUpdate(int timeout_ms =0) override
virtual int8_tcommitUpdate(PropArray * result, int timeout_ms =0) override
virtual voidgetPendingProperty(Property & property) override
virtual intgetPendingProperties(PropArray & properties) override
virtual voidref() override
virtual voidunref() override

Protected Functions

Name
ObjectImpl(ConnectionImpl * conn)
virtual~ObjectImpl()
virtual voidonInitialized()
virtual voidonIndication(Indication & indication) override
virtual voidonConfirmation(Confirmation & confirmation) override
intregisterProperties(PropArray & properties)
virtual int8_thandleCustomMessage(string name, PropArray & data, PropArray & outProps)
virtual int8_thandleStreamData(Stream * s, byte * cb, uint32_t len)
virtual intsetPropertyRequested(uint32_t tag, Property & value, const PropArray & transaction, bool internal)
virtual intgetPropertyRequested(uint32_t tag, Property & value)

Public Attributes

Name
const addr_tEMPTY_ADDR

Friends

Name
classConnectionImpl
classService

Additional inherited members

Public Functions inherited from flake::ConnectedObjectImpl

Name
ConnectedObjectImpl(ConnectionImpl * conn)
~ConnectedObjectImpl() override
virtual addr_taddr() const override
virtual addr_tbroadcastAddr() const override

Protected Attributes inherited from flake::ConnectedObjectImpl

Name
addr_tm_addr
addr_tm_parentAddr
addr_tm_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)
voidcopyFrom(const PropArray & other)
voidclear()
const Property &get(uint32_t tag) const
boolhas(uint32_t tag) const
voidset(const Property & val)
char *toString()
size_typecount() const
virtual boolserialize(uint16_t * len, flake::byte ** buf) override
virtual boolunserialize(uint16_t len, flake::byte * buf) override

Public Attributes inherited from flake::PropArray

Name
PropertyVAL_ERR_NOT_FOUND

Public Functions inherited from flake::ConnectedObject

Name
virtual addr_taddr() const =0
virtual addr_tbroadcastAddr() 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 boolserialize(uint16_t * len, flake::byte ** buf) =0
virtual boolunserialize(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 
);