Stride Reference Manual
- generated for commit 9643b11
|
ContactPoolSys contains for each of the type of pools (Household, K12School, ...) a vector of with all of the contact pools of the type. More...
#include <ContactPoolSys.h>
Public Member Functions | |
ContactPoolSys () | |
Empty system. More... | |
ContactPool * | CreateContactPool (ContactType::Id typeId) |
Create a new contact pool of a given type. More... | |
template<ContactType::Id T> | |
ContactPool * | CreateContactPool () |
Templated version of for use when type id is fixed. More... | |
const util::SegmentedVector< ContactPool > & | CRefPools (ContactType::Id id) const |
Access through const reference to ContactPools of type 'id'. More... | |
template<ContactType::Id T> | |
const util::SegmentedVector< ContactPool > & | CRefPools () const |
Templated version of for use when the type id is fixed. More... | |
Private Member Functions | |
util::SegmentedVector< ContactPool > & | RefPools (ContactType::Id id) |
/// Access through non-const reference to ContactPools of type 'id'. More... | |
Private Attributes | |
ContactType::IdSubscriptArray< unsigned int > | m_currentContactPoolId |
The contact pool counters (one per type id) for assigning pool UIDs. More... | |
ContactType::IdSubscriptArray< util::SegmentedVector< ContactPool > > | m_sys |
Pool system container: array that is subscriptable with ContactType::Ids and for each Id contains a SegmentedVector with the ContactPools for that ContactType::Id. More... | |
Friends | |
class | DefaultPopBuilder |
class | Sim |
ContactPoolSys contains for each of the type of pools (Household, K12School, ...) a vector of with all of the contact pools of the type.
The ContactPoolSys container is an std::array extended to be subscriptable with the enum class of the pool type Ids.
Definition at line 36 of file ContactPoolSys.h.
stride::ContactPoolSys::ContactPoolSys | ( | ) |
Empty system.
Definition at line 28 of file ContactPoolSys.cpp.
References stride::ContactType::IdList, m_currentContactPoolId, and m_sys.
ContactPool * stride::ContactPoolSys::CreateContactPool | ( | ContactType::Id | typeId | ) |
Create a new contact pool of a given type.
Definition at line 36 of file ContactPoolSys.cpp.
References m_currentContactPoolId, and m_sys.
Referenced by geopop::Generator< ID >::AddPools(), geopop::GeoGridJSONReader::ParseContactPool(), and geopop::GeoGridProtoReader::ParseContactPool().
|
inline |
Templated version of for use when type id is fixed.
T | One of the ContactType::Id's (Household, K12 School, ...). |
Definition at line 49 of file ContactPoolSys.h.
References m_currentContactPoolId, and m_sys.
|
inline |
Access through const reference to ContactPools of type 'id'.
id | ContactType::Id of pools container you want to access. |
Definition at line 57 of file ContactPoolSys.h.
References m_sys.
|
inline |
Templated version of for use when the type id is fixed.
T | ContactType::Id of pools container you want to access. |
Definition at line 63 of file ContactPoolSys.h.
References m_sys.
|
inlineprivate |
/// Access through non-const reference to ContactPools of type 'id'.
id | ContactType::Id of pools container you want to access. |
Definition at line 72 of file ContactPoolSys.h.
References m_sys.
|
friend |
Definition at line 74 of file ContactPoolSys.h.
|
friend |
Definition at line 75 of file ContactPoolSys.h.
|
private |
The contact pool counters (one per type id) for assigning pool UIDs.
Counters generate a non zero UID that's unique per type of pool, so <type, UID> uniquely detemines the pool. UID zero means 'NA" e.g. wor[lace UID for a K12school student will be zero. As a defensive measure, the ContactPoolSys gets initialized with (for each type) an empty pool in the vecotor storing the contact pools. As a consequence, one has: if UID != 0 then ContactPoolSys[type][UID].GetId() == UID for all type the index in the vector with pools is identical to the pool's UID.
Definition at line 86 of file ContactPoolSys.h.
Referenced by ContactPoolSys(), and CreateContactPool().
|
private |
Pool system container: array that is subscriptable with ContactType::Ids and for each Id contains a SegmentedVector with the ContactPools for that ContactType::Id.
We use the SegmentedVector not to run in re-allocations and to be able to use pointers into the SegmentedVector.
Definition at line 92 of file ContactPoolSys.h.
Referenced by ContactPoolSys(), CreateContactPool(), CRefPools(), and RefPools().