Google is committed to advancing racial equity for Black communities. See how.

nl::Weave::Profiles::DataManagement_Current::SubscriptionEngine

#include <src/lib/profiles/data-management/Current/SubscriptionEngine.h>

This is a singleton hosting all WDM Next subscriptions, both client and publisher sides.

Summary

Constructors and Destructors

SubscriptionEngine(void)

Public types

EventCallback)(void *const aAppState, EventID aEvent, const InEventParam &aInParam, OutEventParam &aOutParam) typedef
void(*
Set the event back function and pointer to associated state object for SubscriptionEngine specific call backs.
EventID enum
Events generated directly from this component.

Public static functions

DefaultEventHandler(EventID aEvent, const InEventParam & aInParam, OutEventParam & aOutParam)
void
This is the default event handler to be called by application layer for any ignored or unrecognized event.
GetInstance(void)
Retrieve the singleton Subscription Engine.

Public functions

GetExchangeManager(void) const
GetMinEventLogPosition(size_t & outLogPosition) const
Retrieve the minimum relative position of the event offload point from all active subscription handlers.
Init(nl::Weave::WeaveExchangeManager *const apExchangeMgr, void *const aAppState, const EventCallback aEventCallback)
SetEventCallback(void *const aAppState, const EventCallback aEventCallback)
void
Set the event back function and pointer to associated state object for SubscriptionEngine specific call backs.

Unions

nl::Weave::Profiles::DataManagement_Current::SubscriptionEngine::InEventParam

Incoming parameters sent with events generated directly from this component.

nl::Weave::Profiles::DataManagement_Current::SubscriptionEngine::OutEventParam

Outgoing parameters sent with events generated directly from this component.

Public types

EventCallback

void(* EventCallback)(void *const aAppState, EventID aEvent, const InEventParam &aInParam, OutEventParam &aOutParam)

Set the event back function and pointer to associated state object for SubscriptionEngine specific call backs.

Details
Parameters
[in] aAppState
A pointer to application layer supplied state object
[in] aEvent
A function pointer for event call back
[in] aInParam
A const reference to the input parameter for this event
[out] aOutParam
A reference to the output parameter for this event

EventID

 EventID

Events generated directly from this component.

Public static functions

DefaultEventHandler

void DefaultEventHandler(
  EventID aEvent,
  const InEventParam & aInParam,
  OutEventParam & aOutParam
)

This is the default event handler to be called by application layer for any ignored or unrecognized event.

Details
Parameters
[in] aEvent
A function pointer for event call back
[in] aInParam
A const reference to the input parameter for this event
[out] aOutParam
A reference to the output parameter for this event

GetInstance

SubscriptionEngine * GetInstance(
  void
)

Retrieve the singleton Subscription Engine.

Note this function should be implemented by the adoption layer.

Details
Returns
A pointer to the shared Subscription Engine

Public functions

GetExchangeManager

nl::Weave::WeaveExchangeManager * GetExchangeManager(
  void
) const 

GetMinEventLogPosition

WEAVE_ERROR GetMinEventLogPosition(
  size_t & outLogPosition
) const 

Retrieve the minimum relative position of the event offload point from all active subscription handlers.

Retrieves the minimum relative (to the boottime) position of the event offload point from all active subscription handlers.

Details
Parameters
[in,out] outLogPosition
Minimum log offload point for all active subscription handlers. If no subscription handlers are active, the value remains unchanged. The log position is set to 0 upon initializing the subscription handler.
Return Values
WEAVE_NO_ERROR
unconditionally

Init

WEAVE_ERROR Init(
  nl::Weave::WeaveExchangeManager *const apExchangeMgr,
  void *const aAppState,
  const EventCallback aEventCallback
)

SetEventCallback

void SetEventCallback(
  void *const aAppState,
  const EventCallback aEventCallback
)

Set the event back function and pointer to associated state object for SubscriptionEngine specific call backs.

Details
Parameters
[in] aAppState
A pointer to application layer supplied state object
[in] aEventCallback
A function pointer for event call back

SubscriptionEngine

 SubscriptionEngine(
  void
)