folly::observer_detail::Core

Core stores the current version of the object held by Observer. It also keeps all dependencies and dependents of the Observer.

Synopsis

Declared in <folly/observer/detail/Core.h>

class Core
    : public std::enable_shared_from_this<Core>

Base Classes

NameDescription
std::enable_shared_from_this<Core>

Types

NameDescription
CreatorContext Describes the creator functor and its result type.
VersionedData View of the observed object as well as its version and created time

Type Aliases

NameDescription
Ptr Shared pointer to a Core.
WeakPtr Weak pointer to a Core.

Member Functions

NameDescription
~Core [destructor]Destroys the Core.
getCreatorContext Returns the context describing the creator functor.
getData Gets current view of the observed object. This is safe to call from any thread. If this is called from other Observer functor then that Observer is marked as dependent on current Observer.
getSnapshotOfDependencies Returns a copy of the current set of dependencies.
getVersion Gets the version of the observed object.
getVersionLastChange Get the last version at which the observed object was actually changed.
refresh Check if the observed object needs to be re-computed. Returns the version of last change.
setForceRefresh Force the next call to refresh to unconditionally re-compute the observed object, even if dependencies didn't change.
shared_from_this
weak_from_this

Static Member Functions

NameDescription
create Blocks until creator is successfully run by ObserverManager

Protected Member Functions

Name
operator=