CatapultServer  v0.5.0.1 (Elephant)
catapult::utils::IdentifierGroup< TIdentifier, TGroupingKey, TIdentifierHasher > Class Template Reference

A group of identifiers that share a common (external) attribute. More...

Public Types

using Identifiers = std::unordered_set< TIdentifier, TIdentifierHasher >
 Unordered set of identifiers. More...
 
using GroupingKeyType = TGroupingKey
 Type of grouping key. More...
 

Public Member Functions

 IdentifierGroup (const TGroupingKey &key)
 Creates a group around a given key. More...
 
const TGroupingKey & key () const
 Gets the grouping key. More...
 
const Identifiers & identifiers () const
 Gets the identifiers. More...
 
bool empty () const
 Returns true if the group is empty, false otherwise. More...
 
size_t size () const
 Gets the number of identifiers in the group. More...
 
void add (const TIdentifier &identifier)
 Adds identifier to the group. More...
 
void remove (const TIdentifier &identifier)
 Removes identifier from the group. More...
 

Private Attributes

TGroupingKey m_key
 
Identifiers m_identifiers
 

Detailed Description

template<typename TIdentifier, typename TGroupingKey, typename TIdentifierHasher>
class catapult::utils::IdentifierGroup< TIdentifier, TGroupingKey, TIdentifierHasher >

A group of identifiers that share a common (external) attribute.

Member Typedef Documentation

◆ GroupingKeyType

template<typename TIdentifier , typename TGroupingKey , typename TIdentifierHasher >
using catapult::utils::IdentifierGroup< TIdentifier, TGroupingKey, TIdentifierHasher >::GroupingKeyType = TGroupingKey

Type of grouping key.

◆ Identifiers

template<typename TIdentifier , typename TGroupingKey , typename TIdentifierHasher >
using catapult::utils::IdentifierGroup< TIdentifier, TGroupingKey, TIdentifierHasher >::Identifiers = std::unordered_set<TIdentifier, TIdentifierHasher>

Unordered set of identifiers.

Constructor & Destructor Documentation

◆ IdentifierGroup()

template<typename TIdentifier , typename TGroupingKey , typename TIdentifierHasher >
catapult::utils::IdentifierGroup< TIdentifier, TGroupingKey, TIdentifierHasher >::IdentifierGroup ( const TGroupingKey &  key)
inlineexplicit

Creates a group around a given key.

Member Function Documentation

◆ add()

template<typename TIdentifier , typename TGroupingKey , typename TIdentifierHasher >
void catapult::utils::IdentifierGroup< TIdentifier, TGroupingKey, TIdentifierHasher >::add ( const TIdentifier &  identifier)
inline

Adds identifier to the group.

◆ empty()

template<typename TIdentifier , typename TGroupingKey , typename TIdentifierHasher >
bool catapult::utils::IdentifierGroup< TIdentifier, TGroupingKey, TIdentifierHasher >::empty ( ) const
inline

Returns true if the group is empty, false otherwise.

◆ identifiers()

template<typename TIdentifier , typename TGroupingKey , typename TIdentifierHasher >
const Identifiers& catapult::utils::IdentifierGroup< TIdentifier, TGroupingKey, TIdentifierHasher >::identifiers ( ) const
inline

Gets the identifiers.

◆ key()

template<typename TIdentifier , typename TGroupingKey , typename TIdentifierHasher >
const TGroupingKey& catapult::utils::IdentifierGroup< TIdentifier, TGroupingKey, TIdentifierHasher >::key ( ) const
inline

Gets the grouping key.

Here is the caller graph for this function:

◆ remove()

template<typename TIdentifier , typename TGroupingKey , typename TIdentifierHasher >
void catapult::utils::IdentifierGroup< TIdentifier, TGroupingKey, TIdentifierHasher >::remove ( const TIdentifier &  identifier)
inline

Removes identifier from the group.

◆ size()

template<typename TIdentifier , typename TGroupingKey , typename TIdentifierHasher >
size_t catapult::utils::IdentifierGroup< TIdentifier, TGroupingKey, TIdentifierHasher >::size ( ) const
inline

Gets the number of identifiers in the group.

Member Data Documentation

◆ m_identifiers

template<typename TIdentifier , typename TGroupingKey , typename TIdentifierHasher >
Identifiers catapult::utils::IdentifierGroup< TIdentifier, TGroupingKey, TIdentifierHasher >::m_identifiers
private

◆ m_key

template<typename TIdentifier , typename TGroupingKey , typename TIdentifierHasher >
TGroupingKey catapult::utils::IdentifierGroup< TIdentifier, TGroupingKey, TIdentifierHasher >::m_key
private

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