Health-GPS  1.2.2.0
Global Health Policy Simulation model (Health-GPS)
hgps::HierarchicalMapping Class Reference

Defines the hierarchical model mapping data type. More...

#include <mapping.h>

Public Types

using IteratorType = std::vector< MappingEntry >::iterator
 Hierarchical mappings iterator. More...
 
using ConstIteratorType = std::vector< MappingEntry >::const_iterator
 read-only hierarchical mappings iterator More...
 

Public Member Functions

 HierarchicalMapping ()=delete
 
 HierarchicalMapping (std::vector< MappingEntry > &&mapping)
 Initialises a new instance of the HierarchicalMapping class. More...
 
const std::vector< MappingEntry > & entries () const noexcept
 Gets the collection of mapping entries. More...
 
std::vector< MappingEntryentries_without_dynamic () const noexcept
 Gets the collection of mapping entries without the dynamic factor. More...
 
std::size_t size () const noexcept
 Gets the size of the mappings collection. More...
 
int max_level () const noexcept
 Gets the maximum hierarchical level. More...
 
MappingEntry at (const core::Identifier &key) const
 Gets a mapping entry by identifier. More...
 
std::vector< MappingEntryat_level (int level) const noexcept
 Gets the mapping entries at a given hierarchical level. More...
 
std::vector< MappingEntryat_level_without_dynamic (int level) const noexcept
 Gets the mapping entries at a given hierarchical level without the dynamic factor. More...
 
IteratorType begin () noexcept
 Gets an iterator to the beginning of the mappings. More...
 
IteratorType end () noexcept
 Gets an iterator to the element following the last mapping. More...
 
ConstIteratorType begin () const noexcept
 Gets an read-only iterator to the beginning of the mappings. More...
 
ConstIteratorType end () const noexcept
 Gets a read-only iterator to the element following the last mapping. More...
 
ConstIteratorType cbegin () const noexcept
 Gets an read-only iterator to the beginning of the mappings. More...
 
ConstIteratorType cend () const noexcept
 Gets a read-only iterator to the element following the last mapping. More...
 

Detailed Description

Defines the hierarchical model mapping data type.

Member Typedef Documentation

◆ ConstIteratorType

using hgps::HierarchicalMapping::ConstIteratorType = std::vector<MappingEntry>::const_iterator

read-only hierarchical mappings iterator

◆ IteratorType

using hgps::HierarchicalMapping::IteratorType = std::vector<MappingEntry>::iterator

Hierarchical mappings iterator.

Constructor & Destructor Documentation

◆ HierarchicalMapping() [1/2]

hgps::HierarchicalMapping::HierarchicalMapping ( )
delete

◆ HierarchicalMapping() [2/2]

hgps::HierarchicalMapping::HierarchicalMapping ( std::vector< MappingEntry > &&  mapping)

Initialises a new instance of the HierarchicalMapping class.

Parameters
mappingThe collection of mapping entries

Member Function Documentation

◆ at()

MappingEntry hgps::HierarchicalMapping::at ( const core::Identifier key) const

Gets a mapping entry by identifier.

Parameters
keyThe factor unique identifier
Returns
The factor mapping definition
Exceptions
std::out_of_rangefor identifier not found in the mappings collection.

◆ at_level()

std::vector< MappingEntry > hgps::HierarchicalMapping::at_level ( int  level) const
noexcept

Gets the mapping entries at a given hierarchical level.

Parameters
levelThe hierarchical level
Returns
The collection of mappings

◆ at_level_without_dynamic()

std::vector< MappingEntry > hgps::HierarchicalMapping::at_level_without_dynamic ( int  level) const
noexcept

Gets the mapping entries at a given hierarchical level without the dynamic factor.

Parameters
levelThe hierarchical level
Returns
The collection of mappings without the dynamic factor
Here is the caller graph for this function:

◆ begin() [1/2]

ConstIteratorType hgps::HierarchicalMapping::begin ( ) const
inlinenoexcept

Gets an read-only iterator to the beginning of the mappings.

Returns
Iterator to the first mapping

◆ begin() [2/2]

IteratorType hgps::HierarchicalMapping::begin ( )
inlinenoexcept

Gets an iterator to the beginning of the mappings.

Returns
Iterator to the first mapping

◆ cbegin()

ConstIteratorType hgps::HierarchicalMapping::cbegin ( ) const
inlinenoexcept

Gets an read-only iterator to the beginning of the mappings.

Returns
Iterator to the first mapping

◆ cend()

ConstIteratorType hgps::HierarchicalMapping::cend ( ) const
inlinenoexcept

Gets a read-only iterator to the element following the last mapping.

Returns
Iterator to the element following the last mapping

◆ end() [1/2]

ConstIteratorType hgps::HierarchicalMapping::end ( ) const
inlinenoexcept

Gets a read-only iterator to the element following the last mapping.

Returns
Iterator to the element following the last mapping

◆ end() [2/2]

IteratorType hgps::HierarchicalMapping::end ( )
inlinenoexcept

Gets an iterator to the element following the last mapping.

Returns
Iterator to the element following the last mapping

◆ entries()

const std::vector< MappingEntry > & hgps::HierarchicalMapping::entries ( ) const
noexcept

Gets the collection of mapping entries.

Returns
The mapping entries

◆ entries_without_dynamic()

std::vector< MappingEntry > hgps::HierarchicalMapping::entries_without_dynamic ( ) const
noexcept

Gets the collection of mapping entries without the dynamic factor.

Returns
The mapping entries without dynamic factor

◆ max_level()

int hgps::HierarchicalMapping::max_level ( ) const
noexcept

Gets the maximum hierarchical level.

Returns
Maximum hierarchy level

◆ size()

std::size_t hgps::HierarchicalMapping::size ( ) const
noexcept

Gets the size of the mappings collection.

Returns
The mappings collection size

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