Stride Reference Manual  - generated for commit 9643b11
stride::ContactType Namespace Reference

Namespace to manage types of ContactPool. More...

Classes

struct  IDPack
 Keeps all available Ids in a template pack and exposes it as a std::initialize_list Useful when initializing a IdSubscriptArray with a type that is not default constructible. More...
 
class  IdSubscriptArray
 An std::array modified to enable subscripting with the constact pool type indentifiers. More...
 
class  IdSubscriptArray< bool >
 Specialisation of IdSubscriptArray foor booleans. More...
 

Typedefs

using IdPack_t = IDPack< Id::Household, Id::K12School, Id::College, Id::Workplace, Id::PrimaryCommunity, Id::SecondaryCommunity >
 Placed separately to please swig and avoid syntax errors there. More...
 

Enumerations

enum  Id : unsigned int {
  Id::Household = static_cast<unsigned int>(0), Id::K12School, Id::College, Id::Workplace,
  Id::PrimaryCommunity, Id::SecondaryCommunity
}
 Enumerates the ContactPool types. More...
 

Functions

bool IsId (const std::string &s)
 Check whether string is name of a ContactPoolType::Id. More...
 
Id ToId (const std::string &s)
 Converts a string with name to Id. More...
 
string ToString (Id w)
 Converts a ContactPoolType::Id value to corresponding name. More...
 
constexpr unsigned int NumOfTypes ()
 Number of ContactPool types. More...
 
constexpr std::size_t ToSizeT (Id id)
 Cast to size_t for indexing. More...
 

Variables

constexpr IdPack_t IdPack
 A constexpr global variable that gives access to the available Ids. More...
 
constexpr std::initializer_list< IdIdList = IdPack_t::AsInitializerList
 To allow iteration over the type ids. More...
 

Detailed Description

Namespace to manage types of ContactPool.

Typedef Documentation

Placed separately to please swig and avoid syntax errors there.

Definition at line 69 of file ContactType.h.

Enumeration Type Documentation

enum stride::ContactType::Id : unsigned int
strong

Enumerates the ContactPool types.

Enumerator
Household 
K12School 
College 
Workplace 
PrimaryCommunity 
SecondaryCommunity 

Definition at line 34 of file ContactType.h.

Function Documentation

bool stride::ContactType::IsId ( const string &  s)

Check whether string is name of a ContactPoolType::Id.

Definition at line 33 of file ContactType.cpp.

References College, Household, K12School, PrimaryCommunity, SecondaryCommunity, and Workplace.

Referenced by NumOfTypes().

Here is the caller graph for this function:

Id stride::ContactType::ToId ( const string &  s)

Converts a string with name to Id.

Definition at line 48 of file ContactType.cpp.

References College, Household, K12School, PrimaryCommunity, SecondaryCommunity, and Workplace.

Referenced by NumOfTypes().

Here is the caller graph for this function:

std::string stride::ContactType::ToString ( Id  c)

Converts a ContactPoolType::Id value to corresponding name.

Definition at line 63 of file ContactType.cpp.

References College, Household, K12School, PrimaryCommunity, SecondaryCommunity, and Workplace.

Referenced by ToSizeT().

Here is the caller graph for this function:

constexpr unsigned int stride::ContactType::NumOfTypes ( )
inline

Number of ContactPool types.

Definition at line 45 of file ContactType.h.

References IsId(), and ToId().

Referenced by stride::ContactType::IdSubscriptArray< AgeContactProfile >::at(), and stride::ContactType::IdSubscriptArray< bool >::at().

Here is the call graph for this function:

Here is the caller graph for this function:

constexpr std::size_t stride::ContactType::ToSizeT ( Id  id)
inline

Cast to size_t for indexing.

Definition at line 54 of file ContactType.h.

References ToString().

Referenced by stride::ContactType::IdSubscriptArray< AgeContactProfile >::at(), stride::ContactType::IdSubscriptArray< bool >::at(), stride::ContactType::IdSubscriptArray< AgeContactProfile >::operator[](), and stride::ContactType::IdSubscriptArray< bool >::operator[]().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

constexpr IdPack_t stride::ContactType::IdPack

A constexpr global variable that gives access to the available Ids.

Definition at line 72 of file ContactType.h.