Class EntityWatchdogFactory

Page Contents

Class Documentation

class EntityWatchdogFactory

Utility class for managing instances of EntityWatchdog for various data types.

Public Functions

EntityWatchdogFactory(std::shared_ptr<Configuration> config, std::shared_ptr<net::IApiClient> apiClient)

Initializes the factory with any defaults.

Parameters
  • config – The global configuration object to initialize the factory with.

  • apiClient – The instance of ApiClient to use when creating EntityWatchdog instances.

~EntityWatchdogFactory()

Clears the factory state and frees up any memory resources used by the factory.

template<class T>
inline std::shared_ptr<EntityWatchdog<T>> GetEntityWatchdog()

Creates and/or returns the EntityWatchdog class instance for a specified type.

Returns

The entity watchdog class associated with the specified type, otherwise nullptr.

bool NotifyEntityUpdate(Object &message)

Notifies all entity watchdogs that an entity has been updated.

Parameters

message – The message object containing the entity update.

Returns

Returns true if the entity update was handled by a watchdog instance, otherwise returns false.

void SetPushSocket(std::shared_ptr<net::IWebSocket> socket)

Sets the currently active push notification websocket connection.