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

Defines the disease measure table data type. More...

#include <disease_table.h>

Public Member Functions

 DiseaseTable ()=delete
 
 DiseaseTable (const core::DiseaseInfo &info, std::map< std::string, int > &&measures, std::map< int, std::map< core::Gender, DiseaseMeasure >> &&data)
 Initialise a new instance of the DiseaseTable class. More...
 
const core::DiseaseInfoinfo () const noexcept
 Gets the disease information. More...
 
std::size_t size () const noexcept
 Gets the total size of the table, number of measure cells. More...
 
std::size_t rows () const noexcept
 Gets the number of rows, age. More...
 
std::size_t cols () const noexcept
 Gets the number of columns, gender. More...
 
bool contains (const int age) const noexcept
 Defines whether the table contains a given age. More...
 
const std::map< std::string, int > & measures () const noexcept
 Gets the measures to identifier mapping. More...
 
const int & at (const std::string &measure) const
 Gets a measure identifier by name. More...
 
const int & operator[] (const std::string &measure) const
 Gets a measure identifier by name. More...
 
DiseaseMeasureoperator() (const int age, const core::Gender gender)
 Lookup for the disease measure entries by age and gender. More...
 
const DiseaseMeasureoperator() (const int age, const core::Gender gender) const
 Lookup for the disease measure entries by age and gender. More...
 

Detailed Description

Defines the disease measure table data type.

Lookup table by age and gender to access multiple disease measures.

Constructor & Destructor Documentation

◆ DiseaseTable() [1/2]

hgps::DiseaseTable::DiseaseTable ( )
delete

◆ DiseaseTable() [2/2]

hgps::DiseaseTable::DiseaseTable ( const core::DiseaseInfo info,
std::map< std::string, int > &&  measures,
std::map< int, std::map< core::Gender, DiseaseMeasure >> &&  data 
)

Initialise a new instance of the DiseaseTable class.

Parameters
infoThe disease information
measuresDiseases measure to identifier mapping
dataDisease measure table dataset
Here is the call graph for this function:

Member Function Documentation

◆ at()

const int & hgps::DiseaseTable::at ( const std::string &  measure) const

Gets a measure identifier by name.

Parameters
measureThe measure name
Returns
Measure identifier
Exceptions
std::out_of_rangefor unknown measure name

◆ cols()

std::size_t hgps::DiseaseTable::cols ( ) const
noexcept

Gets the number of columns, gender.

Returns
NUmber of columns
Here is the caller graph for this function:

◆ contains()

bool hgps::DiseaseTable::contains ( const int  age) const
noexcept

Defines whether the table contains a given age.

Parameters
ageThe age to check
Returns
true if the age entry exists; otherwise, false.

◆ info()

const core::DiseaseInfo & hgps::DiseaseTable::info ( ) const
noexcept

Gets the disease information.

Returns
Disease information
Here is the caller graph for this function:

◆ measures()

const std::map< std::string, int > & hgps::DiseaseTable::measures ( ) const
noexcept

Gets the measures to identifier mapping.

Returns
Measures identifiers

◆ operator()() [1/2]

DiseaseMeasure & hgps::DiseaseTable::operator() ( const int  age,
const core::Gender  gender 
)

Lookup for the disease measure entries by age and gender.

Parameters
ageThe age to lookup
genderThe gender to lookup
Returns
Disease measures collection
Exceptions
std::out_of_rangefor unknown age or gender enumeration

◆ operator()() [2/2]

const DiseaseMeasure & hgps::DiseaseTable::operator() ( const int  age,
const core::Gender  gender 
) const

Lookup for the disease measure entries by age and gender.

Parameters
ageThe age to lookup
genderThe gender to lookup
Returns
Disease measures collection
Exceptions
std::out_of_rangefor unknown age or gender enumeration

◆ operator[]()

const int & hgps::DiseaseTable::operator[] ( const std::string &  measure) const

Gets a measure identifier by name.

Parameters
measureThe measure name
Returns
Measure identifier
Exceptions
std::out_of_rangefor unknown measure name

◆ rows()

std::size_t hgps::DiseaseTable::rows ( ) const
noexcept

Gets the number of rows, age.

Returns
Number of rows
Here is the caller graph for this function:

◆ size()

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

Gets the total size of the table, number of measure cells.

Returns
Total table size
Here is the call graph for this function:

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