Mask Class Reference

CPP API: mio::abm::Mask Class Reference

Reduces the probability that a Person becomes infected. More...

#include <mask.h>

Collaboration diagram for mio::abm::Mask:

Public Member Functions

void change_mask (MaskType new_mask_type, TimePoint t)
 Change the type of the Mask and reset the time it was used. More...
 
auto default_serialize ()
 This method is used by the default serialization feature. More...
 
const TimeSpan get_time_used (TimePoint curr_time) const
 Get the length of time this Mask has been used. More...
 
MaskType get_type () const
 Get the MaskType of this Mask. More...
 
 Mask (MaskType type, TimePoint t)
 Construct a new Mask of a certain type. More...
 

Private Attributes

TimePoint m_time_first_usage
 TimePoint of the Mask's initial usage. More...
 
MaskType m_type
 Type of the Mask. More...
 

Detailed Description

Reduces the probability that a Person becomes infected.

Every Person has a Mask that reduces the probability of becoming infected when wearing this Mask.

Constructor & Destructor Documentation

◆ Mask()

mio::abm::Mask::Mask ( MaskType  type,
TimePoint  t 
)

Construct a new Mask of a certain type.

Parameters
[in]typeThe type of the Mask.
[in]tThe TimePoint of the Mask's initial usage.

Member Function Documentation

◆ change_mask()

void mio::abm::Mask::change_mask ( MaskType  new_mask_type,
TimePoint  t 
)

Change the type of the Mask and reset the time it was used.

Parameters
[in]new_mask_typeThe type of the new Mask.
[in]tThe TimePoint of mask change.

◆ default_serialize()

auto mio::abm::Mask::default_serialize ( )
inline

This method is used by the default serialization feature.

◆ get_time_used()

const TimeSpan mio::abm::Mask::get_time_used ( TimePoint  curr_time) const

Get the length of time this Mask has been used.

Parameters
[in]curr_timeThe current TimePoint.

◆ get_type()

MaskType mio::abm::Mask::get_type ( ) const
inline

Get the MaskType of this Mask.

Member Data Documentation

◆ m_time_first_usage

TimePoint mio::abm::Mask::m_time_first_usage
private

TimePoint of the Mask's initial usage.

◆ m_type

MaskType mio::abm::Mask::m_type
private

Type of the Mask.