Policy‐based implementation of ObserverContainerBase.
Synopsis
Declared in <folly/ObserverContainer.h>
template<
typename ObserverInterface,
typename Observed,
typename ContainerPolicy,
typename StorePolicy = ObserverContainerStorePolicyDefault<>,
std::size_t MaxConstructorCallbacks = 4>
class ObserverContainer
: public ObserverContainerBase<ObserverInterface, Observed, ContainerPolicy>
Base Classes
Name |
Description |
|
Base ObserverContainer and definition of Observers. |
Types
Name |
Description |
Helper class for observers that attach to single object / container. |
|
Observer interface. |
|
Observer base interface. |
|
EventSet is used to keep track of the observer events that are enabled. |
Type Aliases
Name |
Description |
Base container type. |
|
Constructor callback list type for the observed object. |
|
Enum of events that observers can subscribe to. |
|
Integer type underlying EventEnum. |
|
Observer type stored in this container. |
|
Base store interface type. |
|
Observer interface type. |
|
Type of the observed object. |
|
Container policy type. |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy the container, notifying observers that the object is destroyed. |
Assignment operators |
|
Adds an observer to the container. |
|
Get a list of observers in the container of type T. |
|
Returns the object associated with the container (e.g., observed object). |
|
Get all observers. |
|
Returns if any observer in the container is subscribed to a given event. |
|
Invokes an observer interface method on observers subscribed to an event. |
|
Invokes an observer interface method on all observers. |
|
Get number of observers in container. |
|
Removes an observer from the container. |
Static Member Functions
Name |
Description |
Add a callback fired each time obj of the observed type is constructed. |
Using Declarations
Protected Member Functions
Name |
Description |
|
Return the underlying observer store. |
|
Return the underlying observer store, const overload. |
Invoke an interface method on each subscribed observer. |
Created with MrDocs