![]() |
NEURON
|
Top-level structure. More...
#include <model_data.hpp>
Public Member Functions | |
Model () | |
~Model () | |
container::Node::storage & | node_data () |
Access the structure containing the data of all Nodes. More... | |
container::Node::storage const & | node_data () const |
Access the structure containing the data of all Nodes. More... | |
template<typename Callable > | |
void | apply_to_mechanisms (Callable const &callable) |
Apply a function to each non-null Mechanism. More... | |
template<typename Callable > | |
void | apply_to_mechanisms (Callable const &callable) const |
template<typename... Args> | |
container::Mechanism::storage & | add_mechanism (int type, Args &&... args) |
Create a structure to hold the data of a new Mechanism. More... | |
void | delete_mechanism (int type) |
Destroy the structure holding the data of a particular mechanism. More... | |
container::Mechanism::storage & | mechanism_data (int type) |
Get the structure holding the data of a particular Mechanism. More... | |
container::Mechanism::storage const & | mechanism_data (int type) const |
Get the structure holding the data of a particular Mechanism. More... | |
std::size_t | mechanism_storage_size () const |
bool | is_valid_mechanism (int type) const |
std::unique_ptr< container::utils::storage_info > | find_container_info (void const *cont) const |
Find some metadata about the given container. More... | |
void | shrink_to_fit () |
Private Member Functions | |
container::Mechanism::storage & | mechanism_data_impl (int type) const |
void | set_unsorted_callback (container::Mechanism::storage &mech_data) |
Private Attributes | |
container::Node::storage | m_node_data |
One structure for all Nodes. More... | |
std::vector< std::unique_ptr< container::Mechanism::storage > > | m_mech_data {} |
Storage for mechanism-specific data. More... | |
std::vector< void * > | m_ptrs_for_deferred_deletion {} |
Backing storage for defer_delete helper. More... | |
Top-level structure.
This level of indirection (as opposed to, for example, the Node data being a global variable in its own right) will give us more control over construction/destruction/... of different parts of the model data.
Definition at line 18 of file model_data.hpp.
neuron::Model::Model | ( | ) |
Definition at line 16 of file container.cpp.
neuron::Model::~Model | ( | ) |
Definition at line 22 of file container.cpp.
|
inline |
Create a structure to hold the data of a new Mechanism.
Definition at line 60 of file model_data.hpp.
|
inline |
Apply a function to each non-null Mechanism.
Definition at line 37 of file model_data.hpp.
|
inline |
Definition at line 47 of file model_data.hpp.
|
inline |
Destroy the structure holding the data of a particular mechanism.
Definition at line 79 of file model_data.hpp.
std::unique_ptr< container::utils::storage_info > neuron::Model::find_container_info | ( | void const * | cont | ) | const |
Find some metadata about the given container.
The argument type will typically be a T* that contains the result of calling .data() on some vector in the global model data structure.
Definition at line 29 of file container.cpp.
|
inline |
Definition at line 107 of file model_data.hpp.
|
inline |
Get the structure holding the data of a particular Mechanism.
Definition at line 93 of file model_data.hpp.
|
inline |
Get the structure holding the data of a particular Mechanism.
Definition at line 99 of file model_data.hpp.
|
inlineprivate |
Definition at line 126 of file model_data.hpp.
|
inline |
Definition at line 103 of file model_data.hpp.
|
inline |
Access the structure containing the data of all Nodes.
Definition at line 24 of file model_data.hpp.
|
inline |
Access the structure containing the data of all Nodes.
Definition at line 30 of file model_data.hpp.
|
private |
Definition at line 44 of file container.cpp.
|
inline |
Definition at line 120 of file model_data.hpp.
|
private |
Storage for mechanism-specific data.
Each element is allocated on the heap so that reallocating this vector does not invalidate pointers to container::Mechanism::storage.
Definition at line 152 of file model_data.hpp.
|
private |
One structure for all Nodes.
Definition at line 145 of file model_data.hpp.
|
private |
Backing storage for defer_delete helper.
Definition at line 157 of file model_data.hpp.