25 #include <unordered_set> 30 namespace observer_detail {
32 class ObserverManager;
38 class Core :
public std::enable_shared_from_this<Core> {
40 using Ptr = std::shared_ptr<Core>;
57 std::shared_ptr<const void>
data;
size_t getVersion() const
Core(folly::Function< std::shared_ptr< const void >()> creator)
size_t getVersionLastChange()
constexpr detail::Map< Move > move
std::atomic< size_t > versionLastChange_
VersionedData(std::shared_ptr< const void > data_, size_t version_)
—— Concurrent Priority Queue Implementation ——
folly::Synchronized< Dependents > dependents_
std::shared_ptr< const void > data
folly::Synchronized< Dependencies > dependencies_
std::shared_ptr< Core > Ptr
std::unordered_set< Ptr > Dependencies
size_t refresh(size_t version, bool force=false)
void addDependent(Core::WeakPtr dependent)
folly::Function< std::shared_ptr< const void >)> creator_
folly::Synchronized< VersionedData > data_
std::weak_ptr< Core > WeakPtr
std::vector< WeakPtr > Dependents
std::atomic< size_t > version_
void removeStaleDependents()
static Ptr create(folly::Function< std::shared_ptr< const void >()> creator)