CatapultServer  v0.5.0.1 (Elephant)
catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet > Class Template Reference

A conditional container that delegates to either a storage or a memory backed container. More...

Inheritance diagram for catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >:
Collaboration diagram for catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >:

Classes

class  ConditionalIterator
 A const iterator. More...
 

Public Types

using StorageSetType = TStorageSet
 
using MemorySetType = TMemorySet
 
using value_type = typename MemorySetType::value_type
 
using const_iterator = ConditionalIterator
 
using iterator = ConditionalIterator
 
- Public Types inherited from catapult::deltaset::detail::StlContainerTraits< TMemorySet >
using key_compare = typename TMemorySet ::key_compare
 

Public Member Functions

 ConditionalContainer ()
 Creates a memory conditional container with mode. More...
 
template<typename... TStorageArgs>
 ConditionalContainer (ConditionalContainerMode mode, TStorageArgs &&... storageArgs)
 
bool empty () const
 Gets a value indicating whether or not this set is empty. More...
 
size_t size () const
 Gets the size of this set. More...
 
ConditionalIterator cend () const
 Returns a const iterator to the element following the last element of the underlying set. More...
 
ConditionalIterator find (const typename TKeyTraits::KeyType &key) const
 Searches for key in this set. More...
 
void update (const DeltaElements< MemorySetType > &deltas)
 Applies all changes in deltas to the underlying container. More...
 
template<typename TPruningBoundary >
void prune (const TPruningBoundary &pruningBoundary)
 Optionally prunes underlying container using pruningBoundary. More...
 

Private Types

using StorageFlag = std::integral_constant< ConditionalContainerMode, ConditionalContainerMode::Storage >
 
using MemoryFlag = std::integral_constant< ConditionalContainerMode, ConditionalContainerMode::Memory >
 

Private Attributes

std::unique_ptr< StorageSetTypem_pContainer1
 
std::unique_ptr< MemorySetTypem_pContainer2
 

Friends

template<typename TKeyTraits2 , typename TStorageSet2 , typename TMemorySet2 >
bool IsSetIterable (const ConditionalContainer< TKeyTraits2, TStorageSet2, TMemorySet2 > &set)
 
template<typename TKeyTraits2 , typename TStorageSet2 , typename TMemorySet2 >
const friend TMemorySet2 & SelectIterableSet (const ConditionalContainer< TKeyTraits2, TStorageSet2, TMemorySet2 > &set)
 

Detailed Description

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
class catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >

A conditional container that delegates to either a storage or a memory backed container.

Member Typedef Documentation

◆ const_iterator

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
using catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >::const_iterator = ConditionalIterator

◆ iterator

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
using catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >::iterator = ConditionalIterator

◆ MemoryFlag

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
using catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >::MemoryFlag = std::integral_constant<ConditionalContainerMode, ConditionalContainerMode::Memory>
private

◆ MemorySetType

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
using catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >::MemorySetType = TMemorySet

◆ StorageFlag

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
using catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >::StorageFlag = std::integral_constant<ConditionalContainerMode, ConditionalContainerMode::Storage>
private

◆ StorageSetType

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
using catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >::StorageSetType = TStorageSet

◆ value_type

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
using catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >::value_type = typename MemorySetType::value_type

Constructor & Destructor Documentation

◆ ConditionalContainer() [1/2]

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >::ConditionalContainer ( )
inline

Creates a memory conditional container with mode.

◆ ConditionalContainer() [2/2]

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
template<typename... TStorageArgs>
catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >::ConditionalContainer ( ConditionalContainerMode  mode,
TStorageArgs &&...  storageArgs 
)
inlineexplicit

Creates a memory conditional container with mode. storageArgs are forwarded to the underlying storage container.

Member Function Documentation

◆ cend()

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
ConditionalIterator catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >::cend ( ) const
inline

Returns a const iterator to the element following the last element of the underlying set.

◆ empty()

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
bool catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >::empty ( ) const
inline

Gets a value indicating whether or not this set is empty.

◆ find()

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
ConditionalIterator catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >::find ( const typename TKeyTraits::KeyType &  key) const
inline

Searches for key in this set.

◆ prune()

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
template<typename TPruningBoundary >
void catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >::prune ( const TPruningBoundary &  pruningBoundary)
inline

Optionally prunes underlying container using pruningBoundary.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ size()

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
size_t catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >::size ( ) const
inline

Gets the size of this set.

◆ update()

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
void catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >::update ( const DeltaElements< MemorySetType > &  deltas)
inline

Applies all changes in deltas to the underlying container.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ IsSetIterable

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
template<typename TKeyTraits2 , typename TStorageSet2 , typename TMemorySet2 >
bool IsSetIterable ( const ConditionalContainer< TKeyTraits2, TStorageSet2, TMemorySet2 > &  set)
friend

◆ SelectIterableSet

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
template<typename TKeyTraits2 , typename TStorageSet2 , typename TMemorySet2 >
const friend TMemorySet2& SelectIterableSet ( const ConditionalContainer< TKeyTraits2, TStorageSet2, TMemorySet2 > &  set)
friend

Member Data Documentation

◆ m_pContainer1

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
std::unique_ptr<StorageSetType> catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >::m_pContainer1
private

◆ m_pContainer2

template<typename TKeyTraits, typename TStorageSet, typename TMemorySet>
std::unique_ptr<MemorySetType> catapult::deltaset::ConditionalContainer< TKeyTraits, TStorageSet, TMemorySet >::m_pContainer2
private

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