CatapultServer  v0.5.0.1 (Elephant)
catapult::state::RootNamespaceHistory Class Reference

A root namespace history. More...

Collaboration diagram for catapult::state::RootNamespaceHistory:

Public Member Functions

 RootNamespaceHistory (NamespaceId id)
 Creates a root namespace history around id. More...
 
 RootNamespaceHistory (const RootNamespaceHistory &history)
 
 RootNamespaceHistory (RootNamespaceHistory &&history)=default
 Move constructor. More...
 
RootNamespaceoperator= (const RootNamespace &rhs)=delete
 
bool empty () const
 Gets a value indicating whether or not the history is empty. More...
 
NamespaceId id () const
 Gets the id of the root namespace history. More...
 
size_t historyDepth () const
 Gets the root namespace history size. More...
 
size_t activeOwnerHistoryDepth () const
 Gets the number of root namespaces with the same owner starting at the active history. More...
 
size_t numActiveRootChildren () const
 Gets the number of children of the most recent root namespace. More...
 
size_t numAllHistoricalChildren () const
 
void push_back (const Key &owner, const NamespaceLifetime &lifetime)
 Adds a new root namespace around owner and lifetime at the end of the history. More...
 
void pop_back ()
 Removes the last entry in the history. More...
 
const RootNamespaceback () const
 Gets a const reference to the most recent root namespace. More...
 
RootNamespaceback ()
 Gets a reference to the most recent root namespace. More...
 
std::set< NamespaceIdprune (Height height)
 Prunes all root namespaces that are not active at height. More...
 
std::list< RootNamespace >::const_iterator begin () const
 Returns a const iterator to the first root namespace. More...
 
std::list< RootNamespace >::const_iterator end () const
 Returns a const iterator to the element following the last root namespace. More...
 
bool isActiveAndUnlocked (Height height) const
 Returns true if history is active at height (excluding grace period). More...
 
bool isActive (Height height) const
 

Private Attributes

NamespaceId m_id
 
std::list< RootNamespacem_rootHistory
 

Detailed Description

A root namespace history.

Constructor & Destructor Documentation

◆ RootNamespaceHistory() [1/3]

catapult::state::RootNamespaceHistory::RootNamespaceHistory ( NamespaceId  id)
explicit

Creates a root namespace history around id.

◆ RootNamespaceHistory() [2/3]

catapult::state::RootNamespaceHistory::RootNamespaceHistory ( const RootNamespaceHistory history)

Copy constructor.

Note
this constructor is needed to ensure that the copy is sharing children among consecutive roots with same owners.

◆ RootNamespaceHistory() [3/3]

catapult::state::RootNamespaceHistory::RootNamespaceHistory ( RootNamespaceHistory &&  history)
default

Move constructor.

Member Function Documentation

◆ activeOwnerHistoryDepth()

size_t catapult::state::RootNamespaceHistory::activeOwnerHistoryDepth ( ) const

Gets the number of root namespaces with the same owner starting at the active history.

Here is the call graph for this function:

◆ back() [1/2]

RootNamespace & catapult::state::RootNamespaceHistory::back ( )

Gets a reference to the most recent root namespace.

◆ back() [2/2]

const RootNamespace & catapult::state::RootNamespaceHistory::back ( ) const

Gets a const reference to the most recent root namespace.

Here is the caller graph for this function:

◆ begin()

std::list< RootNamespace >::const_iterator catapult::state::RootNamespaceHistory::begin ( ) const

Returns a const iterator to the first root namespace.

◆ empty()

bool catapult::state::RootNamespaceHistory::empty ( ) const

Gets a value indicating whether or not the history is empty.

Here is the caller graph for this function:

◆ end()

std::list< RootNamespace >::const_iterator catapult::state::RootNamespaceHistory::end ( ) const

Returns a const iterator to the element following the last root namespace.

◆ historyDepth()

size_t catapult::state::RootNamespaceHistory::historyDepth ( ) const

Gets the root namespace history size.

Here is the caller graph for this function:

◆ id()

NamespaceId catapult::state::RootNamespaceHistory::id ( ) const

Gets the id of the root namespace history.

Here is the caller graph for this function:

◆ isActive()

bool catapult::state::RootNamespaceHistory::isActive ( Height  height) const

Returns true if history is active at height (including grace period).

Note
This needs to be called isActive in order for it to dictate state lifetime.
Here is the call graph for this function:

◆ isActiveAndUnlocked()

bool catapult::state::RootNamespaceHistory::isActiveAndUnlocked ( Height  height) const

Returns true if history is active at height (excluding grace period).

Here is the call graph for this function:

◆ numActiveRootChildren()

size_t catapult::state::RootNamespaceHistory::numActiveRootChildren ( ) const

Gets the number of children of the most recent root namespace.

Here is the call graph for this function:

◆ numAllHistoricalChildren()

size_t catapult::state::RootNamespaceHistory::numAllHistoricalChildren ( ) const

Gets the number of all children.

Note
Children are counted more than one time if they are in more than one root namespace.
Here is the call graph for this function:

◆ operator=()

RootNamespace& catapult::state::RootNamespaceHistory::operator= ( const RootNamespace rhs)
delete

◆ pop_back()

void catapult::state::RootNamespaceHistory::pop_back ( )

Removes the last entry in the history.

◆ prune()

std::set< NamespaceId > catapult::state::RootNamespaceHistory::prune ( Height  height)

Prunes all root namespaces that are not active at height.

Here is the caller graph for this function:

◆ push_back()

void catapult::state::RootNamespaceHistory::push_back ( const Key owner,
const NamespaceLifetime lifetime 
)

Adds a new root namespace around owner and lifetime at the end of the history.

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

Member Data Documentation

◆ m_id

NamespaceId catapult::state::RootNamespaceHistory::m_id
private

◆ m_rootHistory

std::list<RootNamespace> catapult::state::RootNamespaceHistory::m_rootHistory
private

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