Base ObserverContainer and definition of Observers.

Synopsis

Declared in <folly/ObserverContainer.h>

template<
    typename ObserverInterface,
    typename Observed,
    typename ContainerPolicy>
class ObserverContainerBase;

Types

Name

Description

ManagedObserver

Helper class for observers that attach to single object / container.

Observer

Observer interface.

ObserverBase

Observer base interface.

ObserverEventSet

EventSet is used to keep track of the observer events that are enabled.

Type Aliases

Name

Description

EventEnum

Enum of events that observers can subscribe to.

EventEnumIntT

Integer type underlying EventEnum.

interface_type

Observer interface type.

observed_type

Type of the observed object.

policy_type

Container policy type.

Member Functions

Name

Description

~ObserverContainerBase [destructor] [virtual]

Destroy the container base.

addObserver

Adds an observer to the container.

findObservers

Get a list of observers in the container of type T.

getObject [virtual]

Returns the object associated with the container (e.g., observed object).

getObservers

Get all observers.

hasObserversForEvent

Returns if any observer in the container is subscribed to a given event.

numObservers

Get number of observers in container.

removeObserver

Removes an observer from the container.

Protected Member Functions

Name

Description

getStore [virtual]

Return the underlying observer store.

getStoreConst [virtual]

Return the underlying observer store, const overload.

invokeInterfaceMethodImpl

Invoke an interface method on each subscribed observer.

Derived Classes

Name

Description

ObserverContainer

Policy‐based implementation of ObserverContainerBase.

Created with MrDocs