Stride Reference Manual
- generated for commit 9643b11
|
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< Id > | IdList = IdPack_t::AsInitializerList |
To allow iteration over the type ids. More... | |
Namespace to manage types of ContactPool.
using stride::ContactType::IdPack_t = typedef IDPack<Id::Household, Id::K12School, Id::College, Id::Workplace, Id::PrimaryCommunity, Id::SecondaryCommunity> |
Placed separately to please swig and avoid syntax errors there.
Definition at line 69 of file ContactType.h.
|
strong |
Enumerates the ContactPool types.
Enumerator | |
---|---|
Household | |
K12School | |
College | |
Workplace | |
PrimaryCommunity | |
SecondaryCommunity |
Definition at line 34 of file ContactType.h.
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().
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().
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().
|
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().
|
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[]().
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.
constexpr std::initializer_list<Id> stride::ContactType::IdList = IdPack_t::AsInitializerList |
To allow iteration over the type ids.
Definition at line 75 of file ContactType.h.
Referenced by stride::DefaultPopBuilder::Build(), stride::SimBuilder::Build(), stride::ContactPoolSys::ContactPoolSys(), stride::ContactType::IdSubscriptArray< AgeContactProfile >::IdSubscriptArray(), stride::ContactType::IdSubscriptArray< bool >::IdSubscriptArray(), geopop::Location::operator==(), stride::Sim::TimeStep(), geopop::GeoGridJSONWriter::WriteLocation(), and geopop::GeoGridProtoWriter::WriteLocation().