CatapultServer  v0.5.0.1 (Elephant)
RelockableDetachedCatapultCache.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "CatapultCacheDelta.h"
23 #include "catapult/types.h"
24 
25 namespace catapult { namespace cache { class CatapultCache; } }
26 
27 namespace catapult { namespace cache {
28 
31  public:
33  explicit RelockableDetachedCatapultCache(const CatapultCache& catapultCache);
34 
37 
38  public:
40  Height height() const;
41 
44  std::unique_ptr<CatapultCacheDelta> getAndTryLock();
45 
47  std::unique_ptr<CatapultCacheDelta> rebaseAndLock();
48 
49  private:
50  class Impl;
51  std::unique_ptr<Impl> m_pImpl;
52  };
53 }}
catapult::cache::RelockableDetachedCatapultCache::Impl
Definition: RelockableDetachedCatapultCache.cpp:46
catapult::cache::RelockableDetachedCatapultCache::rebaseAndLock
std::unique_ptr< CatapultCacheDelta > rebaseAndLock()
Rebases and locks the (detached) catapult cache delta.
Definition: RelockableDetachedCatapultCache.cpp:88
catapult::cache::CatapultCache::createDetachableDelta
CatapultCacheDetachableDelta createDetachableDelta() const
Definition: CatapultCache.cpp:260
catapult::cache::RelockableDetachedCatapultCache::Impl::m_cacheHeight
Height m_cacheHeight
Definition: RelockableDetachedCatapultCache.cpp:70
catapult::utils::BaseValue< uint64_t, Height_tag >
catapult::cache::RelockableDetachedCatapultCache::Impl::m_catapultCache
const CatapultCache & m_catapultCache
Definition: RelockableDetachedCatapultCache.cpp:69
CatapultCacheDelta.h
m_detachedDelta
CatapultCacheDetachedDelta m_detachedDelta
Definition: RelockableDetachedCatapultCache.cpp:42
catapult::cache::CatapultCache
Central cache holding all sub caches.
Definition: CatapultCache.h:40
catapult::cache::RelockableDetachedCatapultCache::Impl::m_pLockableUnconfirmedCatapultCache
std::unique_ptr< DetachedDeltaWrapper > m_pLockableUnconfirmedCatapultCache
Definition: RelockableDetachedCatapultCache.cpp:71
CatapultCache.h
CatapultCacheDetachedDelta.h
catapult::cache::RelockableDetachedCatapultCache::m_pImpl
std::unique_ptr< Impl > m_pImpl
Definition: RelockableDetachedCatapultCache.h:50
catapult::cache::RelockableDetachedCatapultCache::height
Height height() const
Gets the current cache height.
Definition: RelockableDetachedCatapultCache.cpp:80
catapult::cache::RelockableDetachedCatapultCache::getAndTryLock
std::unique_ptr< CatapultCacheDelta > getAndTryLock()
Definition: RelockableDetachedCatapultCache.cpp:84
catapult::cache::RelockableDetachedCatapultCache::RelockableDetachedCatapultCache
RelockableDetachedCatapultCache(const CatapultCache &catapultCache)
Creates a relockable detached catapult cache around catapultCache.
Definition: RelockableDetachedCatapultCache.cpp:74
types.h
catapult::cache::RelockableDetachedCatapultCache::Impl::getAndTryLock
std::unique_ptr< CatapultCacheDelta > getAndTryLock()
Definition: RelockableDetachedCatapultCache.cpp:57
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::cache::RelockableDetachedCatapultCache::Impl::height
Height height() const
Definition: RelockableDetachedCatapultCache.cpp:53
catapult::cache::RelockableDetachedCatapultCache
A relockable detached catapult cache.
Definition: RelockableDetachedCatapultCache.h:30
catapult::cache::RelockableDetachedCatapultCache::Impl::Impl
Impl(const CatapultCache &catapultCache)
Definition: RelockableDetachedCatapultCache.cpp:48
catapult::cache::RelockableDetachedCatapultCache::~RelockableDetachedCatapultCache
~RelockableDetachedCatapultCache()
Destroys the relockable detached catapult cache.
catapult::cache::RelockableDetachedCatapultCache::Impl::rebaseAndLock
std::unique_ptr< CatapultCacheDelta > rebaseAndLock()
Definition: RelockableDetachedCatapultCache.cpp:61
RelockableDetachedCatapultCache.h