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

Weight classification model polymorphic wrapper class. More...

#include <weight_model.h>

Public Member Functions

template<typename T >
 WeightModel (T &&value)
 Initialises a new instance of the WeightModel class. More...
 
 WeightModel (const WeightModel &other)
 Constructs the WeightModel with the copy of the other's contents. More...
 
WeightModeloperator= (const WeightModel &other)
 Replaces the WeightModel with a copy of the other's contents. More...
 
 WeightModel (WeightModel &&other)=default
 Constructs the WeightModel with the contents of other using move semantics. More...
 
WeightModeloperator= (WeightModel &&other)=default
 Replaces the WeightModel contents with the other using move semantics. More...
 
unsigned int child_cutoff_age () const noexcept
 Gets the children cut-off age (before adult) More...
 
WeightCategory classify_weight (const Person &person) const
 Classify a person weight according with the predefined categories. More...
 
double adjust_risk_factor_value (const Person &entity, const core::Identifier &risk_factor_key, double value) const
 Adjust a Person risk factor value. More...
 

Detailed Description

Weight classification model polymorphic wrapper class.

Constructor & Destructor Documentation

◆ WeightModel() [1/3]

template<typename T >
hgps::WeightModel::WeightModel ( T &&  value)
inline

Initialises a new instance of the WeightModel class.

Template Parameters
TWeight model type
Parameters
valueThe weight model instance

◆ WeightModel() [2/3]

hgps::WeightModel::WeightModel ( const WeightModel other)
inline

Constructs the WeightModel with the copy of the other's contents.

Parameters
otherThe other WeightModel instance to copy

◆ WeightModel() [3/3]

hgps::WeightModel::WeightModel ( WeightModel &&  other)
default

Constructs the WeightModel with the contents of other using move semantics.

Parameters
otherThe other WeightModel instance to move

Member Function Documentation

◆ adjust_risk_factor_value()

double hgps::WeightModel::adjust_risk_factor_value ( const Person entity,
const core::Identifier risk_factor_key,
double  value 
) const
inline

Adjust a Person risk factor value.

Parameters
entityThe Person instance to adjust
risk_factor_keyThe risk factor identifier
valueThe amount of adjustment value
Returns
The adjusted risk factor value
Exceptions
std::out_of_rangefor unknown weight category definition

◆ child_cutoff_age()

unsigned int hgps::WeightModel::child_cutoff_age ( ) const
inlinenoexcept

Gets the children cut-off age (before adult)

Returns
The cut-off age for children

◆ classify_weight()

WeightCategory hgps::WeightModel::classify_weight ( const Person person) const
inline

Classify a person weight according with the predefined categories.

Parameters
personThe Person instance to classify
Returns
The respective weight classification

◆ operator=() [1/2]

WeightModel& hgps::WeightModel::operator= ( const WeightModel other)
inline

Replaces the WeightModel with a copy of the other's contents.

Parameters
otherThe other WeightModel instance to copy
Returns
This instance

◆ operator=() [2/2]

WeightModel& hgps::WeightModel::operator= ( WeightModel &&  other)
default

Replaces the WeightModel contents with the other using move semantics.

Parameters
otherThe other WeightModel instance to move
Returns
This instance

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