CatapultServer  v0.5.0.1 (Elephant)
catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView > Class Template Reference
Inheritance diagram for catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >:
Collaboration diagram for catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >:

Classes

struct  is_type_expression_t< decltype(reinterpret_cast< const T * >(0) ->tryGetMerkleRoot())> >
 
struct  is_type_expression_t< decltype(reinterpret_cast< T * >(0) ->setMerkleRoot(Hash256()))> >
 
struct  MerkleRootAccessor
 
struct  MerkleRootMutator
 

Public Member Functions

 SubCacheViewAdapter (TView &&view, const SubCacheViewIdentifier &id)
 
const SubCacheViewIdentifierid () const override
 Gets view identifier. More...
 
const void * get () const override
 Returns a const pointer to the underlying view. More...
 
void * get () override
 Returns a pointer to the underlying view. More...
 
bool supportsMerkleRoot () const override
 Returns true if cache supports merkle root. More...
 
bool tryGetMerkleRoot (Hash256 &merkleRoot) const override
 Gets the cache merkle root (merkleRoot) if supported. More...
 
bool trySetMerkleRoot (const Hash256 &merkleRoot) override
 Sets the cache merkle root (merkleRoot) if supported. More...
 
void updateMerkleRoot (Height height) override
 Recalculates the merkle root given the specified chain height if supported. More...
 
const void * asReadOnly () const override
 Returns a read-only view of this view. More...
 
- Public Member Functions inherited from catapult::cache::SubCacheView
virtual ~SubCacheView ()=default
 

Private Types

enum  MerkleRootType { MerkleRootType::Unsupported, MerkleRootType::Supported }
 
using UnsupportedMerkleRootFlag = std::integral_constant< MerkleRootType, MerkleRootType::Unsupported >
 
using SupportedMerkleRootFlag = std::integral_constant< MerkleRootType, MerkleRootType::Supported >
 

Private Member Functions

auto merkleRootAccessor () const
 
auto merkleRootMutator ()
 

Static Private Member Functions

static bool SupportsMerkleRoot (const TView &, UnsupportedMerkleRootFlag)
 
static bool SupportsMerkleRoot (const TView &view, SupportedMerkleRootFlag)
 
static bool TryGetMerkleRoot (const TView &, Hash256 &, UnsupportedMerkleRootFlag)
 
static bool TryGetMerkleRoot (const TView &view, Hash256 &merkleRoot, SupportedMerkleRootFlag)
 
static bool TrySetMerkleRoot (TView &, const Hash256 &, UnsupportedMerkleRootFlag)
 
static bool TrySetMerkleRoot (TView &view, const Hash256 &merkleRoot, SupportedMerkleRootFlag)
 
static void UpdateMerkleRoot (TView &, Height, UnsupportedMerkleRootFlag)
 
static void UpdateMerkleRoot (TView &view, Height height, SupportedMerkleRootFlag)
 

Private Attributes

TView m_view
 
SubCacheViewIdentifier m_id
 

Member Typedef Documentation

◆ SupportedMerkleRootFlag

template<typename TCache, typename TStorageTraits>
template<typename TView >
using catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::SupportedMerkleRootFlag = std::integral_constant<MerkleRootType, MerkleRootType::Supported>
private

◆ UnsupportedMerkleRootFlag

template<typename TCache, typename TStorageTraits>
template<typename TView >
using catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::UnsupportedMerkleRootFlag = std::integral_constant<MerkleRootType, MerkleRootType::Unsupported>
private

Member Enumeration Documentation

◆ MerkleRootType

template<typename TCache, typename TStorageTraits>
template<typename TView >
enum catapult::cache::SubCachePluginAdapter::SubCacheViewAdapter::MerkleRootType
strongprivate
Enumerator
Unsupported 
Supported 

Constructor & Destructor Documentation

◆ SubCacheViewAdapter()

template<typename TCache, typename TStorageTraits>
template<typename TView >
catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::SubCacheViewAdapter ( TView &&  view,
const SubCacheViewIdentifier id 
)
inlineexplicit

Member Function Documentation

◆ asReadOnly()

template<typename TCache, typename TStorageTraits>
template<typename TView >
const void* catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::asReadOnly ( ) const
inlineoverridevirtual

Returns a read-only view of this view.

Implements catapult::cache::SubCacheView.

◆ get() [1/2]

template<typename TCache, typename TStorageTraits>
template<typename TView >
const void* catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::get ( ) const
inlineoverridevirtual

Returns a const pointer to the underlying view.

Implements catapult::cache::SubCacheView.

◆ get() [2/2]

template<typename TCache, typename TStorageTraits>
template<typename TView >
void* catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::get ( )
inlineoverridevirtual

Returns a pointer to the underlying view.

Implements catapult::cache::SubCacheView.

◆ id()

template<typename TCache, typename TStorageTraits>
template<typename TView >
const SubCacheViewIdentifier& catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::id ( ) const
inlineoverridevirtual

Gets view identifier.

Implements catapult::cache::SubCacheView.

◆ merkleRootAccessor()

template<typename TCache, typename TStorageTraits>
template<typename TView >
auto catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::merkleRootAccessor ( ) const
inlineprivate
Here is the caller graph for this function:

◆ merkleRootMutator()

template<typename TCache, typename TStorageTraits>
template<typename TView >
auto catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::merkleRootMutator ( )
inlineprivate
Here is the caller graph for this function:

◆ supportsMerkleRoot()

template<typename TCache, typename TStorageTraits>
template<typename TView >
bool catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::supportsMerkleRoot ( ) const
inlineoverridevirtual

Returns true if cache supports merkle root.

Implements catapult::cache::SubCacheView.

Here is the call graph for this function:

◆ SupportsMerkleRoot() [1/2]

template<typename TCache, typename TStorageTraits>
template<typename TView >
static bool catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::SupportsMerkleRoot ( const TView &  ,
UnsupportedMerkleRootFlag   
)
inlinestaticprivate
Here is the caller graph for this function:

◆ SupportsMerkleRoot() [2/2]

template<typename TCache, typename TStorageTraits>
template<typename TView >
static bool catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::SupportsMerkleRoot ( const TView &  view,
SupportedMerkleRootFlag   
)
inlinestaticprivate

◆ TryGetMerkleRoot() [1/2]

template<typename TCache, typename TStorageTraits>
template<typename TView >
static bool catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::TryGetMerkleRoot ( const TView &  ,
Hash256 ,
UnsupportedMerkleRootFlag   
)
inlinestaticprivate
Here is the caller graph for this function:

◆ TryGetMerkleRoot() [2/2]

template<typename TCache, typename TStorageTraits>
template<typename TView >
static bool catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::TryGetMerkleRoot ( const TView &  view,
Hash256 merkleRoot,
SupportedMerkleRootFlag   
)
inlinestaticprivate

◆ tryGetMerkleRoot()

template<typename TCache, typename TStorageTraits>
template<typename TView >
bool catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::tryGetMerkleRoot ( Hash256 merkleRoot) const
inlineoverridevirtual

Gets the cache merkle root (merkleRoot) if supported.

Implements catapult::cache::SubCacheView.

Here is the call graph for this function:

◆ trySetMerkleRoot()

template<typename TCache, typename TStorageTraits>
template<typename TView >
bool catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::trySetMerkleRoot ( const Hash256 merkleRoot)
inlineoverridevirtual

Sets the cache merkle root (merkleRoot) if supported.

Implements catapult::cache::SubCacheView.

Here is the call graph for this function:

◆ TrySetMerkleRoot() [1/2]

template<typename TCache, typename TStorageTraits>
template<typename TView >
static bool catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::TrySetMerkleRoot ( TView &  ,
const Hash256 ,
UnsupportedMerkleRootFlag   
)
inlinestaticprivate
Here is the caller graph for this function:

◆ TrySetMerkleRoot() [2/2]

template<typename TCache, typename TStorageTraits>
template<typename TView >
static bool catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::TrySetMerkleRoot ( TView &  view,
const Hash256 merkleRoot,
SupportedMerkleRootFlag   
)
inlinestaticprivate

◆ updateMerkleRoot()

template<typename TCache, typename TStorageTraits>
template<typename TView >
void catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::updateMerkleRoot ( Height  height)
inlineoverridevirtual

Recalculates the merkle root given the specified chain height if supported.

Implements catapult::cache::SubCacheView.

Here is the call graph for this function:

◆ UpdateMerkleRoot() [1/2]

template<typename TCache, typename TStorageTraits>
template<typename TView >
static void catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::UpdateMerkleRoot ( TView &  ,
Height  ,
UnsupportedMerkleRootFlag   
)
inlinestaticprivate
Here is the caller graph for this function:

◆ UpdateMerkleRoot() [2/2]

template<typename TCache, typename TStorageTraits>
template<typename TView >
static void catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::UpdateMerkleRoot ( TView &  view,
Height  height,
SupportedMerkleRootFlag   
)
inlinestaticprivate

Member Data Documentation

◆ m_id

template<typename TCache, typename TStorageTraits>
template<typename TView >
SubCacheViewIdentifier catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::m_id
private

◆ m_view

template<typename TCache, typename TStorageTraits>
template<typename TView >
TView catapult::cache::SubCachePluginAdapter< TCache, TStorageTraits >::SubCacheViewAdapter< TView >::m_view
private

The documentation for this class was generated from the following file: