NEST main@caf0ae8
 
Loading...
Searching...
No Matches
nest::DataSecondaryEvent< DataType, Subclass > Class Template Reference

Template class for the storage and communication of a std::vector of type DataType. More...

#include <secondary_event.h>

Inheritance diagram for nest::DataSecondaryEvent< DataType, Subclass >:
[legend]
Collaboration diagram for nest::DataSecondaryEvent< DataType, Subclass >:
[legend]

Classes

union  CoeffarrayBegin
 
union  CoeffarrayEnd
 

Public Member Functions

void add_syn_id (const synindex synid) override
 This function adds the ids of connection models that use this event type.
 
const std::set< synindex > & get_supported_syn_ids () const override
 
void reset_supported_syn_ids () override
 Resets the vector of supported syn ids to those originally registered via ModelsModule or user defined Modules, i.e., removes all syn ids created by CopyModel.
 
void set_coeffarray (std::vector< DataType > &ca)
 
std::vector< unsignedint >::iterator & operator<< (std::vector< unsigned int >::iterator &pos) override
 The following operator is used to read the information of the DataSecondaryEvent from the buffer in EventDeliveryManager::deliver_events.
 
std::vector< unsignedint >::iterator & operator>> (std::vector< unsigned int >::iterator &pos) override
 The following operator is used to write the information of the DataSecondaryEvent into the secondary_events_buffer_.
 
size_t size () override
 size of event in units of unsigned int
 
const std::vector< unsignedint >::iterator & begin ()
 
const std::vector< unsignedint >::iterator & end ()
 
DataType get_coeffvalue (std::vector< unsigned int >::iterator &pos)
 
- Public Member Functions inherited from nest::SecondaryEvent
SecondaryEvent * clone () const override=0
 
- Public Member Functions inherited from nest::Event
 Event ()
 
virtual ~Event ()
 
virtual void operator() ()=0
 Deliver the event to receiver.
 
void set_receiver (Node &)
 Change pointer to receiving Node.
 
Node & get_receiver () const
 Return reference to receiving Node.
 
size_t get_receiver_node_id () const
 Return node ID of receiving Node.
 
Node & get_sender () const
 Return reference to sending Node.
 
void set_sender (Node &)
 Change pointer to sending Node.
 
size_t get_sender_node_id () const
 Sender is local.
 
size_t retrieve_sender_node_id_from_source_table () const
 Sender is not local.
 
void set_sender_node_id (const size_t)
 Change node ID of sending Node.
 
void set_sender_node_id_info (const size_t tid, const synindex syn_id, const size_t lcid)
 Set tid, syn_id, lcid of spike_data_.
 
Time const & get_stamp () const
 Return time stamp of the event.
 
void set_delay_steps (long)
 Set the transmission delay of the event.
 
long get_delay_steps () const
 Return transmission delay of the event.
 
long get_rel_delivery_steps (const Time &t) const
 Relative spike delivery time in steps.
 
size_t get_port () const
 Return the sender port number of the event.
 
size_t get_rport () const
 Return the receiver port number of the event.
 
void set_port (size_t p)
 Set the port number.
 
void set_rport (size_t p)
 Set the receiver port number (r-port).
 
double get_offset () const
 Return the creation time offset of the Event.
 
void set_offset (double t)
 Set the creation time of the Event.
 
double get_weight () const
 Return the weight.
 
void set_weight (double t)
 Set weight of the event.
 
virtual void set_drift_factor (double)
 Set drift_factor of the event (see DiffusionConnectionEvent).
 
virtual void set_diffusion_factor (double)
 Set diffusion_factor of the event (see DiffusionConnectionEvent).
 
bool sender_is_valid () const
 Returns true if the pointer to the sender node is valid.
 
bool receiver_is_valid () const
 Returns true if the pointer to the receiver node is valid.
 
bool is_valid () const
 Check integrity of the event.
 
void set_stamp (Time const &)
 Set the time stamp of the event.
 
void set_flush_event_flag (bool is_flush_event)
 Sets the flush event flag.
 
bool is_flush_event ()
 Returns whether this spike is a flush event.
 

Static Public Member Functions

static void set_coeff_length (const size_t coeff_length)
 

Private Attributes

union nest::DataSecondaryEvent::CoeffarrayBegin coeffarray_begin_
 
union nest::DataSecondaryEvent::CoeffarrayEnd coeffarray_end_
 

Static Private Attributes

static std::set< synindex > supported_syn_ids_
 
static size_t coeff_length_ = 0
 

Additional Inherited Members

- Protected Attributes inherited from nest::Event
size_t sender_node_id_
 node ID of sender or 0
 
SpikeData sender_spike_data_
 spike data of sender node, in some cases required to retrieve node ID
 
Node * sender_
 Pointer to sender or nullptr.
 
Node * receiver_
 Pointer to receiver or nullptr.
 
size_t p_
 Sender port number.
 
size_t rp_
 Receiver port number (r-port).
 
long d_
 Transmission delay.
 
Time stamp_
 Time stamp.
 
long stamp_steps_
 Time stamp in steps.
 
double offset_
 Offset for precise spike times.
 
double w_
 Weight of the connection.
 

Detailed Description

template<typename DataType, typename Subclass>
class nest::DataSecondaryEvent< DataType, Subclass >

Template class for the storage and communication of a std::vector of type DataType.

The class provides the functionality to communicate homogeneous data of type DataType. The second template type Subclass (which should be chosen as the derived class itself) is used to distinguish derived classes with the same DataType. This is required because of the included static variables in the base class (as otherwise all derived classes with the same DataType would share the same static variables).

Technically the DataSecondaryEvent only contains iterators pointing to the memory location of the std::vector< DataType >.

Conceptually, there is a one-to-one mapping between a SecondaryEvent and a ConnectorModel using it. The synindex of this particular ConnectorModel is stored as first element in the static set supported_syn_ids_ on model registration. There are however reasons (e.g. the usage of CopyModel() or the creation of the labeled synapse model duplicates for pyNN) which make it necessary to register several ConnectorModels with one SecondaryEvent. Therefore the synindices of all these models are added to supported_syn_ids_.

Member Function Documentation

◆ add_syn_id()

template<typename DataType , typename Subclass >
void nest::DataSecondaryEvent< DataType, Subclass >::add_syn_id ( const synindex  synid)
overridevirtual

This function adds the ids of connection models that use this event type.

This is called when the model is registered with the kernel and when the corresponded connector model is copied.

This function needs to be a virtual function of the base class DataSecondaryEvent as it is usually called from a pointer or reference of type SecondaryEvent.

See also:

Implements nest::SecondaryEvent.

References nest::VPManager::assert_thread_parallel(), nest::kernel(), and nest::KernelManager::vp_manager.

Here is the call graph for this function:

◆ begin()

template<typename DataType , typename Subclass >
const std::vector< unsignedint >::iterator & nest::DataSecondaryEvent< DataType, Subclass >::begin ( )
inline

◆ end()

template<typename DataType , typename Subclass >
const std::vector< unsignedint >::iterator & nest::DataSecondaryEvent< DataType, Subclass >::end ( )
inline

◆ get_coeffvalue()

template<typename DataType , typename Subclass >
DataType nest::DataSecondaryEvent< DataType, Subclass >::get_coeffvalue ( std::vector< unsigned int >::iterator &  pos)
inline

References nest::read_from_comm_buffer().

Here is the call graph for this function:

◆ get_supported_syn_ids()

template<typename DataType , typename Subclass >
const std::set< synindex > & nest::DataSecondaryEvent< DataType, Subclass >::get_supported_syn_ids ( ) const
inlineoverridevirtual

◆ operator<<()

template<typename DataType , typename Subclass >
std::vector< unsignedint >::iterator & nest::DataSecondaryEvent< DataType, Subclass >::operator<< ( std::vector< unsigned int >::iterator &  pos)
inlineoverridevirtual

◆ operator>>()

template<typename DataType , typename Subclass >
std::vector< unsignedint >::iterator & nest::DataSecondaryEvent< DataType, Subclass >::operator>> ( std::vector< unsigned int >::iterator &  pos)
inlineoverridevirtual

The following operator is used to write the information of the DataSecondaryEvent into the secondary_events_buffer_.

All DataSecondaryEvents are identified by the synid of the first element in supported_syn_ids_.

Implements nest::SecondaryEvent.

References nest::DataSecondaryEvent< DataType, Subclass >::CoeffarrayBegin::as_DataType, nest::DataSecondaryEvent< DataType, Subclass >::CoeffarrayEnd::as_DataType, nest::DataSecondaryEvent< DataType, Subclass >::coeffarray_begin_, nest::DataSecondaryEvent< DataType, Subclass >::coeffarray_end_, and nest::write_to_comm_buffer().

Here is the call graph for this function:

◆ reset_supported_syn_ids()

template<typename DataType , typename Subclass >
void nest::DataSecondaryEvent< DataType, Subclass >::reset_supported_syn_ids ( )
inlineoverridevirtual

Resets the vector of supported syn ids to those originally registered via ModelsModule or user defined Modules, i.e., removes all syn ids created by CopyModel.

This is important to maintain consistency across ResetKernel, which removes all copied models.

Implements nest::SecondaryEvent.

References nest::DataSecondaryEvent< DataType, Subclass >::supported_syn_ids_.

◆ set_coeff_length()

template<typename DataType , typename Subclass >
void nest::DataSecondaryEvent< DataType, Subclass >::set_coeff_length ( const size_t  coeff_length)
static

References nest::VPManager::assert_single_threaded(), nest::kernel(), and nest::KernelManager::vp_manager.

Here is the call graph for this function:

◆ set_coeffarray()

◆ size()

template<typename DataType , typename Subclass >
size_t nest::DataSecondaryEvent< DataType, Subclass >::size ( )
inlineoverridevirtual

size of event in units of unsigned int

Implements nest::SecondaryEvent.

References nest::DataSecondaryEvent< DataType, Subclass >::coeff_length_.

Member Data Documentation

◆ coeff_length_

template<typename DataType , typename Subclass >
size_t nest::DataSecondaryEvent< DataType, Subclass >::coeff_length_ = 0
staticprivate

◆ coeffarray_begin_

◆ coeffarray_end_

◆ supported_syn_ids_

template<typename DataType , typename Subclass >
std::set< synindex > nest::DataSecondaryEvent< DataType, Subclass >::supported_syn_ids_
staticprivate

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