NEURON
neuron::container::Mechanism::handle_interface< Identifier > Struct Template Reference

Base class defining the public API of Mechanism handles. More...

#include <mechanism.hpp>

Inheritance diagram for neuron::container::Mechanism::handle_interface< Identifier >:
neuron::container::handle_base< Identifier >

Public Types

using base_type = handle_base< Identifier >
 

Public Member Functions

int num_fpfields () const
 Return the number of floating point fields accessible via fpfield. More...
 
int fpfields_size () const
 Get the sum of array dimensions of floating point fields. More...
 
int fpfield_dimension (int field_index) const
 Return the array size of the given field. More...
 
field::FloatingPoint::typefpfield (int field_index, int array_index=0)
 
field::FloatingPoint::type const & fpfield (int field_index, int array_index=0) const
 
data_handle< field::FloatingPoint::typefpfield_handle (int field_index, int array_index=0)
 Return a data_handle to a floating point value. More...
 
- Public Member Functions inherited from neuron::container::handle_base< Identifier >
 handle_base (Identifier identifier)
 Construct a handle from an identifier. More...
 
std::size_t current_row () const
 Return current offset in the underlying storage where this object lives. More...
 
non_owning_identifier_without_container id () const
 Obtain a lightweight identifier of the current entry. More...
 
auto id_hack () const
 This is a workaround for id sometimes being a macro. More...
 
auto & underlying_storage ()
 Obtain a reference to the storage this handle refers to. More...
 
auto const & underlying_storage () const
 Obtain a const reference to the storage this handle refers to. More...
 

Friends

std::ostream & operator<< (std::ostream &os, handle_interface const &handle)
 

Additional Inherited Members

- Protected Member Functions inherited from neuron::container::handle_base< Identifier >
template<typename Tag >
auto get_handle ()
 Get a data_handle<T> referring to the given field inside this handle. More...
 
template<typename Tag >
auto get_handle (int field_index, int array_offset=0)
 Get a data_handle<T> referring to the (runtime) field_index-th copy of a given (static) field. More...
 
template<typename Tag >
auto & get ()
 
template<typename Tag >
auto const & get () const
 
template<typename Tag >
constexpr Tag const & get_tag () const
 Get the instance of the given tag type from underlying storage. More...
 
template<typename Tag >
auto & get (int field_index, int array_offset=0)
 
template<typename Tag >
auto const & get (int field_index, int array_offset=0) const
 

Detailed Description

template<typename Identifier>
struct neuron::container::Mechanism::handle_interface< Identifier >

Base class defining the public API of Mechanism handles.

Template Parameters
IdentifierThe concrete owning/non-owning identifier type.

This allows the same struct-like accessors (v(), ...) to be used on all of the different types of objects that represent a single Node:

  • owning_handle: stable over permutations of underlying data, manages lifetime of a row in the underlying storage. Only null when in moved-from state.
  • handle: stable over permutations of underlying data, produces runtime error if it is dereferenced after the corresponding owning_handle has gone out of scope. Can be null.

Definition at line 71 of file mechanism.hpp.

Member Typedef Documentation

◆ base_type

template<typename Identifier >
using neuron::container::Mechanism::handle_interface< Identifier >::base_type = handle_base<Identifier>

Definition at line 72 of file mechanism.hpp.

Member Function Documentation

◆ fpfield() [1/2]

template<typename Identifier >
field::FloatingPoint::type& neuron::container::Mechanism::handle_interface< Identifier >::fpfield ( int  field_index,
int  array_index = 0 
)
inline

Definition at line 105 of file mechanism.hpp.

◆ fpfield() [2/2]

template<typename Identifier >
field::FloatingPoint::type const& neuron::container::Mechanism::handle_interface< Identifier >::fpfield ( int  field_index,
int  array_index = 0 
) const
inline

Definition at line 109 of file mechanism.hpp.

◆ fpfield_dimension()

template<typename Identifier >
int neuron::container::Mechanism::handle_interface< Identifier >::fpfield_dimension ( int  field_index) const
inline

Return the array size of the given field.

Definition at line 95 of file mechanism.hpp.

◆ fpfield_handle()

template<typename Identifier >
data_handle<field::FloatingPoint::type> neuron::container::Mechanism::handle_interface< Identifier >::fpfield_handle ( int  field_index,
int  array_index = 0 
)
inline

Return a data_handle to a floating point value.

Definition at line 116 of file mechanism.hpp.

◆ fpfields_size()

template<typename Identifier >
int neuron::container::Mechanism::handle_interface< Identifier >::fpfields_size ( ) const
inline

Get the sum of array dimensions of floating point fields.

Definition at line 85 of file mechanism.hpp.

◆ num_fpfields()

template<typename Identifier >
int neuron::container::Mechanism::handle_interface< Identifier >::num_fpfields ( ) const
inline

Return the number of floating point fields accessible via fpfield.

Definition at line 78 of file mechanism.hpp.

Friends And Related Function Documentation

◆ operator<<

template<typename Identifier >
std::ostream& operator<< ( std::ostream &  os,
handle_interface< Identifier > const &  handle 
)
friend

Definition at line 121 of file mechanism.hpp.


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