10 struct generic_data_handle;
92 [[nodiscard]] std::vector<double*>
data();
94 template <std::
size_t variable>
95 [[nodiscard]]
double&
fpfield(std::size_t instance) {
96 return data(instance, variable);
99 template <std::
size_t variable>
105 std::size_t instance,
116 int array_index = 0);
133 int array_index = 0)
const;
173 [[nodiscard]] std::ptrdiff_t
legacy_index(
double const* ptr)
const;
231 [[nodiscard]]
int type()
const;
__attribute__((noreturn)) void sigsegvcatch(int)
size_t get_num_variables(T const &t)
constexpr std::size_t invalid_row
A view into a set of mechanism instances.
void set_storage_offset(std::size_t offset)
Set the offset of this Memb_list into global storage for this type.
int const * get_array_prefix_sums() const
Get the array_dims of field variable.
double & fpfield(std::size_t instance)
neuron::container::data_handle< double > data_handle(std::size_t instance, neuron::container::field_index field) const
Memb_list()=default
Construct a null Memb_list that does not refer to any thread/type.
bool m_owns_nodes
Whether this memlist owns its nodes memory or whether we are a view Has implications on memory manage...
std::ptrdiff_t legacy_index(neuron::container::data_handle< double > const &dh) const
Calculate a legacy index from a data handle.
void nodes_free()
Free memory allocated for nodes (with nodes_alloc)
Memb_list(const Memb_list &)=delete
int type() const
Get the mechanism type.
Memb_list & operator=(const Memb_list &)=default
~Memb_list() noexcept
Uninitialize, freeing any allocated mem for nodes.
neuron::container::Mechanism::storage * m_storage
Pointer to the global mechanism data structure for this mech type.
void set_storage_pointer(neuron::container::Mechanism::storage *storage)
Set the pointer to the underlying data container.
std::ptrdiff_t legacy_index(double const *ptr) const
Calculate a legacy index of the given pointer in this mechanism data.
std::vector< double * > data()
Get a vector of double* representing the model data.
int const * get_array_dims() const
Get the array_dims of field variable.
std::size_t m_storage_offset
Offset of this thread+mechanism into the global mechanism data.
std::size_t get_storage_offset() const
Get the offset of this Memb_list into global storage for this type.
double * dptr_field(std::size_t instance)
void nodes_alloc(int node_count, bool also_pdata)
Allocate memory for node_count nodes.
Underlying storage for all instances of a particular Mechanism.
Struct used to index SoAoS data, such as array range variables.
Non-template stable handle to a generic value.