NEURON
neuron::Model Struct Reference

Top-level structure. More...

#include <model_data.hpp>

Public Member Functions

 Model ()
 
 ~Model ()
 
container::Node::storagenode_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::storageadd_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::storagemechanism_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_infofind_container_info (void const *cont) const
 Find some metadata about the given container. More...
 
void shrink_to_fit ()
 

Private Member Functions

container::Mechanism::storagemechanism_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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Model()

neuron::Model::Model ( )

Definition at line 16 of file container.cpp.

◆ ~Model()

neuron::Model::~Model ( )

Definition at line 22 of file container.cpp.

Member Function Documentation

◆ add_mechanism()

template<typename... Args>
container::Mechanism::storage& neuron::Model::add_mechanism ( int  type,
Args &&...  args 
)
inline

Create a structure to hold the data of a new Mechanism.

Definition at line 60 of file model_data.hpp.

◆ apply_to_mechanisms() [1/2]

template<typename Callable >
void neuron::Model::apply_to_mechanisms ( Callable const &  callable)
inline

Apply a function to each non-null Mechanism.

Definition at line 37 of file model_data.hpp.

◆ apply_to_mechanisms() [2/2]

template<typename Callable >
void neuron::Model::apply_to_mechanisms ( Callable const &  callable) const
inline

Definition at line 47 of file model_data.hpp.

◆ delete_mechanism()

void neuron::Model::delete_mechanism ( int  type)
inline

Destroy the structure holding the data of a particular mechanism.

Definition at line 79 of file model_data.hpp.

◆ find_container_info()

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.

◆ is_valid_mechanism()

bool neuron::Model::is_valid_mechanism ( int  type) const
inline

Definition at line 107 of file model_data.hpp.

◆ mechanism_data() [1/2]

container::Mechanism::storage& neuron::Model::mechanism_data ( int  type)
inline

Get the structure holding the data of a particular Mechanism.

Definition at line 93 of file model_data.hpp.

◆ mechanism_data() [2/2]

container::Mechanism::storage const& neuron::Model::mechanism_data ( int  type) const
inline

Get the structure holding the data of a particular Mechanism.

Definition at line 99 of file model_data.hpp.

◆ mechanism_data_impl()

container::Mechanism::storage& neuron::Model::mechanism_data_impl ( int  type) const
inlineprivate

Definition at line 126 of file model_data.hpp.

◆ mechanism_storage_size()

std::size_t neuron::Model::mechanism_storage_size ( ) const
inline

Definition at line 103 of file model_data.hpp.

◆ node_data() [1/2]

container::Node::storage& neuron::Model::node_data ( )
inline

Access the structure containing the data of all Nodes.

Definition at line 24 of file model_data.hpp.

◆ node_data() [2/2]

container::Node::storage const& neuron::Model::node_data ( ) const
inline

Access the structure containing the data of all Nodes.

Definition at line 30 of file model_data.hpp.

◆ set_unsorted_callback()

void neuron::Model::set_unsorted_callback ( container::Mechanism::storage mech_data)
private

Definition at line 44 of file container.cpp.

◆ shrink_to_fit()

void neuron::Model::shrink_to_fit ( )
inline

Definition at line 120 of file model_data.hpp.

Member Data Documentation

◆ m_mech_data

std::vector<std::unique_ptr<container::Mechanism::storage> > neuron::Model::m_mech_data {}
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.

◆ m_node_data

container::Node::storage neuron::Model::m_node_data
private

One structure for all Nodes.

Definition at line 145 of file model_data.hpp.

◆ m_ptrs_for_deferred_deletion

std::vector<void*> neuron::Model::m_ptrs_for_deferred_deletion {}
private

Backing storage for defer_delete helper.

Definition at line 157 of file model_data.hpp.


The documentation for this struct was generated from the following files: