Skip to content

class flake::ObjectImpl

#include </Users/ios_developer/workspace/coldwave-os/build/_deps/flake-src/ObjectImpl.h>

Inherits from flake::Object, flake::ConnectedObjectImpl, flake::ConnectedObject, AtomicRef, flake::IndicationSink, flake::ConfirmationSink

Public Functions

Name
ObjectImpl()
ObjectImpl(ConnectionImpl * conn)
ObjectImpl(ObjectDelegate * d)
virtual~ObjectImpl()
[void]init([addr_t] addr, [addr_t] parentAddr, [const]PropArray & params, [addr_t] broadcastAddr =0U, [bool] read_only =[false])
[void]postInit()
[bool]isInitialized() const
[void]notifyStreamClosed(StreamImpl * stream)
ObjectDelegate *delegate() const
[const]PropArray &properties() const
[const]PropArray &cache() const
[void]reset()
virtual [int]subscribe(std::function< [void]([const]Indication &)> f) override
virtual [void]unsubscribe() override
Unsubscribes from the object, effectively removing ALL subscriptions if there are multiple ones.
virtual [int]invoke(std::string command, PropArray & params, [bool] blocking, PropArray & reply) override
virtual [int]broadcast([const] std::string command, PropArray & params) override
virtual [int]openProperty([const][uint32_t] propTag, Stream ** stream) 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) override
virtual [int]sync([unsigned] timeout_ms, [bool] block) override
virtual [void]defer() override
instead of syncing defer the current cache to the next sync
virtual [int]syncDeferred([unsigned] timeout_ms, [bool] block) override
virtual [bool]hasDeferred() override
virtual [void]clear() override
[const][char] *type()

Protected Functions

Name
virtual [void]onIndication([const]Indication & indication) override
virtual [void]onConfirmation([const]Confirmation & confirmation) override
virtual ObjectImpl *impl() override
[int]sendCustomMessage([const] std::string & messageName, PropArray & params, [bool] blocking, PropArray & reply, [bool] broadcast)
[void]defer([uint32_t] timestamp)
[int]sync([unsigned] timeout_ms, [bool] block, PropArray * sourceProps, PropArray & syncProps)
PropArray *prepareSync(PropArray * sourceProps, [uint32_t] size_limit, PropArray & syncProps)
[void]updateProperties(PropArray * sourceProps, [const]PropArray & syncedProps, [const]PropArray & updatedProps)

Friends

Name
[class]PoolAllocator< ObjectImpl, MAX_OBJECT_POOL >([PoolAllocator]< ObjectImpl, MAX_OBJECT_POOL > )

Additional inherited members

Protected Functions inherited from flake::Object

Name
~Object() =default

Friends inherited from flake::Object

Name
[class]ConnectionImpl(ConnectionImpl )

Public Functions inherited from flake::ConnectedObjectImpl

Name
ConnectedObjectImpl(ConnectionImpl * conn)
virtual~ConnectedObjectImpl() override =default
virtual [addr_t]addr() const override
virtual [addr_t]broadcastAddr() const override
virtual [addr_t]parentAddr() const override
ConnectionImpl *connection() const
[void]connect(ConnectionImpl * c)
[void]disconnect()

Protected Functions inherited from flake::ConnectedObjectImpl

Name
[void]setParentAddr([addr_t] addr)
[void]setAddr([addr_t] addr)
[void]setBroadcastAddr([addr_t] addr)

Protected Attributes inherited from flake::ConnectedObjectImpl

Name
PropArraym_properties

Friends inherited from flake::ConnectedObjectImpl

Name
[class]ConnectionImpl(ConnectionImpl )

Public Functions inherited from flake::ConnectedObject

Name
virtual [addr_t]addr() const =0
virtual [addr_t]broadcastAddr() const =0
virtual [addr_t]parentAddr() 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 Documentation

function ObjectImpl

cpp
ObjectImpl()

function ObjectImpl

cpp
explicit ObjectImpl(
    ConnectionImpl * conn
)

function ObjectImpl

cpp
explicit ObjectImpl(
    ObjectDelegate * d
)

function ~ObjectImpl

cpp
virtual ~ObjectImpl()

function init

cpp
void init(
    addr_t addr,
    addr_t parentAddr,
    constPropArray & params,
    addr_t broadcastAddr =0U,
    bool read_only =false
)

function postInit

cpp
void postInit()

function isInitialized

cpp
bool isInitialized() const

function notifyStreamClosed

cpp
void notifyStreamClosed(
    StreamImpl * stream
)

function delegate

cpp
ObjectDelegate * delegate() const

function properties

cpp
inline constPropArray & properties() const

function cache

cpp
inline constPropArray & cache() const

function reset

cpp
void reset()

function subscribe

cpp
virtual int subscribe(
    std::function< void(constIndication &)> 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(
    std::string command,
    PropArray & params,
    bool blocking,
    PropArray & reply
) 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 std::string command,
    PropArray & params
) override

Parameters:

  • message 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 openProperty

cpp
virtual int openProperty(
    constuint32_t propTag,
    Stream ** stream
) override

Reimplements: flake::Object::openProperty

function setProperty

cpp
virtual int setProperty(
    constProperty & 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
) override

Parameters:

  • properties

Return:

Reimplements: flake::Object::setProperties

function sync

cpp
virtual int sync(
    unsigned timeout_ms,
    bool block
) override

Reimplements: flake::Object::sync

Alternative to [beginUpdate()] / [commitUpdate()] all pending properties from all threads are committed at once

function defer

cpp
virtual void defer() override

instead of syncing defer the current cache to the next sync

Reimplements: flake::Object::defer

function syncDeferred

cpp
virtual int syncDeferred(
    unsigned timeout_ms,
    bool block
) override

Reimplements: flake::Object::syncDeferred

function hasDeferred

cpp
virtual bool hasDeferred() override

Reimplements: flake::Object::hasDeferred

function clear

cpp
virtual void clear() override

Reimplements: flake::Object::clear

function type

cpp
static constchar * type()

Protected Functions Documentation

function onIndication

cpp
virtual void onIndication(
    constIndication & indication
) override

Parameters:

  • indication

Reimplements: flake::ConnectedObjectImpl::onIndication

function onConfirmation

cpp
virtual void onConfirmation(
    constConfirmation & confirmation
) override

Parameters:

  • confirmation

Reimplements: flake::ConnectedObjectImpl::onConfirmation

function impl

cpp
virtual ObjectImpl * impl() override

Reimplements: flake::Object::impl

function sendCustomMessage

cpp
int sendCustomMessage(
    const std::string & messageName,
    PropArray & params,
    bool blocking,
    PropArray & reply,
    bool broadcast
)

function defer

cpp
void defer(
    uint32_t timestamp
)

function sync

cpp
int sync(
    unsigned timeout_ms,
    bool block,
    PropArray * sourceProps,
    PropArray & syncProps
)

function prepareSync

cpp
PropArray * prepareSync(
    PropArray * sourceProps,
    uint32_t size_limit,
    PropArray & syncProps
)

function updateProperties

cpp
void updateProperties(
    PropArray * sourceProps,
    constPropArray & syncedProps,
    constPropArray & updatedProps
)

Friends

friend PoolAllocator< ObjectImpl, MAX_OBJECT_POOL >

cpp
friend class PoolAllocator< ObjectImpl, MAX_OBJECT_POOL >(
    PoolAllocator< ObjectImpl, MAX_OBJECT_POOL > 
);