BioDynaMo  v1.05.119-a4ff3934
type_index.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 //
3 // Copyright (C) 2021 CERN & University of Surrey for the benefit of the
4 // BioDynaMo collaboration. All Rights Reserved.
5 //
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // See the LICENSE file distributed with this work for details.
10 // See the NOTICE file distributed with this work for additional information
11 // regarding copyright ownership.
12 //
13 // -----------------------------------------------------------------------------
14 
15 #ifndef CORE_TYPE_INDEX_H_
16 #define CORE_TYPE_INDEX_H_
17 
18 #include <vector>
19 #include "core/agent/agent.h"
21 #include "core/container/flatmap.h"
22 
23 class TClass;
24 
25 namespace bdm {
26 
27 class TypeIndex {
28  public:
29  void Add(Agent* agent);
30 
31  void Update(Agent* new_agent);
32 
33  void Remove(Agent* agent);
34 
35  void Clear();
36 
37  void Reserve(uint64_t capacity);
38 
39  const std::vector<Agent*>& GetType(TClass* tclass) const;
40 
41  private:
44 };
45 
46 } // namespace bdm
47 
48 #endif // CORE_TYPE_INDEX_H_
agent_uid_map.h
bdm::TypeIndex::Add
void Add(Agent *agent)
Definition: type_index.cc:22
bdm
Definition: agent.cc:39
bdm::TypeIndex::data_
UnorderedFlatmap< TClass *, std::vector< Agent * > > data_
Definition: type_index.h:42
bdm::TypeIndex::GetType
const std::vector< Agent * > & GetType(TClass *tclass) const
Definition: type_index.cc:70
bdm::TypeIndex
Definition: type_index.h:27
bdm::Agent
Contains code required by all agents.
Definition: agent.h:79
bdm::TypeIndex::Remove
void Remove(Agent *agent)
Definition: type_index.cc:40
bdm::TypeIndex::Clear
void Clear()
Definition: type_index.cc:55
agent.h
bdm::AgentUidMap< uint64_t >
bdm::TypeIndex::Update
void Update(Agent *new_agent)
Definition: type_index.cc:33
flatmap.h
bdm::TypeIndex::index_
AgentUidMap< uint64_t > index_
Definition: type_index.h:43
bdm::TypeIndex::Reserve
void Reserve(uint64_t capacity)
Definition: type_index.cc:63
bdm::UnorderedFlatmap
Definition: flatmap.h:28