NEURON
neuron::container::non_owning_identifier< Storage > Struct Template Reference

A non-owning permutation-stable identifier for a entry in a container. More...

#include <soa_identifier.hpp>

Inheritance diagram for neuron::container::non_owning_identifier< Storage >:
neuron::container::non_owning_identifier_without_container

Public Types

using storage_type = Storage
 

Public Member Functions

 non_owning_identifier (Storage *storage, non_owning_identifier_without_container id)
 
Storage & underlying_storage ()
 Return a reference to the container in which this entry lives. More...
 
Storage const & underlying_storage () const
 Return a const reference to the container in which this entry lives. More...
 
- Public Member Functions inherited from neuron::container::non_owning_identifier_without_container
 non_owning_identifier_without_container ()=default
 Create a null identifier. More...
 
 non_owning_identifier_without_container (const non_owning_identifier_without_container &other)=default
 
 non_owning_identifier_without_container (non_owning_identifier_without_container &&other)=default
 
non_owning_identifier_without_containeroperator= (const non_owning_identifier_without_container &)=default
 
non_owning_identifier_without_containeroperator= (non_owning_identifier_without_container &&)=default
 
 ~non_owning_identifier_without_container ()=default
 
 operator bool () const
 Does the identifier refer to a valid entry? More...
 
std::size_t current_row () const
 What is the current row? More...
 
bool was_once_valid () const
 Did the identifier use to refer to a valid entry? More...
 
bool has_always_been_null () const
 Has the identifier always been null. More...
 

Private Attributes

Storage * m_storage
 

Additional Inherited Members

- Protected Member Functions inherited from neuron::container::non_owning_identifier_without_container
 non_owning_identifier_without_container (std::shared_ptr< std::size_t > ptr)
 
void set_current_row (std::size_t row)
 
 non_owning_identifier_without_container (size_t row)
 

Detailed Description

template<typename Storage>
struct neuron::container::non_owning_identifier< Storage >

A non-owning permutation-stable identifier for a entry in a container.

Template Parameters
StorageThe type of the referred-to container. This might be a type derived from neuron::container::soa<...>, or a plain container like std::vector<T> in the case of neuron::container::data_handle<T>.

A (non-owning) handle to that row combines an instance of that class with an interface that is specific to Storage. non_owning_identifier<Storage> wraps non_owning_identifier_without_container so as to provide the same interface as owning_identifier<Storage>.

Definition at line 32 of file soa_identifier.hpp.

Member Typedef Documentation

◆ storage_type

template<typename Storage >
using neuron::container::non_owning_identifier< Storage >::storage_type = Storage

Definition at line 53 of file soa_identifier.hpp.

Constructor & Destructor Documentation

◆ non_owning_identifier()

template<typename Storage >
neuron::container::non_owning_identifier< Storage >::non_owning_identifier ( Storage *  storage,
non_owning_identifier_without_container  id 
)
inline

Definition at line 33 of file soa_identifier.hpp.

Member Function Documentation

◆ underlying_storage() [1/2]

template<typename Storage >
Storage& neuron::container::non_owning_identifier< Storage >::underlying_storage ( )
inline

Return a reference to the container in which this entry lives.

Definition at line 40 of file soa_identifier.hpp.

◆ underlying_storage() [2/2]

template<typename Storage >
Storage const& neuron::container::non_owning_identifier< Storage >::underlying_storage ( ) const
inline

Return a const reference to the container in which this entry lives.

Definition at line 48 of file soa_identifier.hpp.

Member Data Documentation

◆ m_storage

template<typename Storage >
Storage* neuron::container::non_owning_identifier< Storage >::m_storage
private

Definition at line 56 of file soa_identifier.hpp.


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