23#ifndef SECONDARY_EVENT_H
24#define SECONDARY_EVENT_H
59 virtual std::vector< unsigned int >::iterator&
operator<<( std::vector< unsigned int >::iterator& pos ) = 0;
60 virtual std::vector< unsigned int >::iterator&
operator>>( std::vector< unsigned int >::iterator& pos ) = 0;
73template <
typename T >
77 size_t num_uints =
sizeof( T ) /
sizeof(
unsigned int );
78 if ( num_uints *
sizeof(
unsigned int ) <
sizeof( T ) )
95template <
typename T >
101 char*
const c =
reinterpret_cast< char*
>( &d );
103 const size_t num_uints = number_of_uints_covered< T >();
104 size_t left_to_copy =
sizeof( T );
106 for (
size_t i = 0; i < num_uints; i++ )
108 memcpy( &( *( pos + i ) ), c + i *
sizeof(
unsigned int ), std::min( left_to_copy,
sizeof(
unsigned int ) ) );
109 left_to_copy -=
sizeof(
unsigned int );
122template <
typename T >
128 char*
const c =
reinterpret_cast< char*
>( &d );
130 const size_t num_uints = number_of_uints_covered< T >();
131 size_t left_to_copy =
sizeof( T );
133 for (
size_t i = 0; i < num_uints; i++ )
135 memcpy( c + i *
sizeof(
unsigned int ), &( *( pos + i ) ), std::min( left_to_copy,
sizeof(
unsigned int ) ) );
136 left_to_copy -=
sizeof(
unsigned int );
163template <
typename DataType,
typename Sub
class >
172 std::vector< unsigned int >::iterator
as_uint;
181 std::vector< unsigned int >::iterator
as_uint;
202 const std::set< synindex >&
235 std::vector< unsigned int >::iterator&
236 operator<<( std::vector< unsigned int >::iterator& pos )
override
244 pos +=
coeff_length_ * number_of_uints_covered< DataType >();
257 std::vector< unsigned int >::iterator&
258 operator>>( std::vector< unsigned int >::iterator& pos )
override
272 size_t s = number_of_uints_covered< synindex >();
273 s += number_of_uints_covered< size_t >();
279 const std::vector< unsigned int >::iterator&
285 const std::vector< unsigned int >::iterator&
395template <
typename DataType,
typename Sub
class >
404template <
typename DataType,
typename Sub
class >
407template <
typename DataType,
typename Sub
class >
Template class for the storage and communication of a std::vector of type DataType.
Definition secondary_event.h:165
static std::set< synindex > supported_syn_ids_
Definition secondary_event.h:167
size_t size() override
size of event in units of unsigned int
Definition secondary_event.h:270
void reset_supported_syn_ids() override
Resets the vector of supported syn ids to those originally registered via ModelsModule or user define...
Definition secondary_event.h:216
static size_t coeff_length_
Definition secondary_event.h:168
void set_coeffarray(std::vector< DataType > &ca)
Definition secondary_event.h:224
union nest::DataSecondaryEvent::CoeffarrayEnd coeffarray_end_
union nest::DataSecondaryEvent::CoeffarrayBegin coeffarray_begin_
static void set_coeff_length(const size_t coeff_length)
Definition secondary_event_impl.h:50
DataType get_coeffvalue(std::vector< unsigned int >::iterator &pos)
Definition secondary_event.h:397
const std::vector< unsignedint >::iterator & end()
Definition secondary_event.h:286
void add_syn_id(const synindex synid) override
This function adds the ids of connection models that use this event type.
Definition secondary_event_impl.h:33
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_...
Definition secondary_event.h:258
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 E...
Definition secondary_event.h:236
const std::vector< unsignedint >::iterator & begin()
Definition secondary_event.h:280
const std::set< synindex > & get_supported_syn_ids() const override
Definition secondary_event.h:203
Event for rate model connections with delay.
Definition secondary_event.h:331
void operator()() override
Deliver the event to receiver.
Definition event.cpp:143
DelayedRateConnectionEvent * clone() const override
Definition secondary_event.h:423
DelayedRateConnectionEvent()
Definition secondary_event.h:334
Event for diffusion connections (rate model connections for the siegert_neuron).
Definition secondary_event.h:348
DiffusionConnectionEvent * clone() const override
Definition secondary_event.h:429
DiffusionConnectionEvent()
Definition secondary_event.h:356
void set_diffusion_factor(double t) override
Set diffusion_factor of the event (see DiffusionConnectionEvent).
Definition secondary_event.h:364
double get_diffusion_factor() const
Definition secondary_event.h:441
void set_drift_factor(double t) override
Set drift_factor of the event (see DiffusionConnectionEvent).
Definition secondary_event.h:370
double diffusion_factor_
Definition secondary_event.h:353
double drift_factor_
Definition secondary_event.h:351
void operator()() override
Deliver the event to receiver.
Definition event.cpp:149
double get_drift_factor() const
Definition secondary_event.h:435
Encapsulate information sent between nodes.
Definition event.h:103
Event for gap-junction information.
Definition secondary_event.h:299
GapJunctionEvent()
Definition secondary_event.h:302
GapJunctionEvent * clone() const override
Definition secondary_event.h:411
void operator()() override
Deliver the event to receiver.
Definition event.cpp:131
Event for rate model connections without delay.
Definition secondary_event.h:315
InstantaneousRateConnectionEvent()
Definition secondary_event.h:318
void operator()() override
Deliver the event to receiver.
Definition event.cpp:137
InstantaneousRateConnectionEvent * clone() const override
Definition secondary_event.h:417
Event for learning signal connections.
Definition secondary_event.h:384
LearningSignalConnectionEvent()
Definition secondary_event.h:387
void operator()() override
Deliver the event to receiver.
Definition event.cpp:155
LearningSignalConnectionEvent * clone() const override
Definition secondary_event.h:447
Event for slow inward current (SIC) connections between astrocytes and neurons.
Definition secondary_event.h:458
SICEvent()
Definition secondary_event.h:461
void operator()()
Deliver the event to receiver.
Definition event.cpp:161
SICEvent * clone() const
Definition secondary_event.h:470
Base class of secondary events.
Definition secondary_event.h:50
SecondaryEvent * clone() const override=0
virtual size_t size()=0
size of event in units of unsigned int
virtual const std::set< synindex > & get_supported_syn_ids() const =0
virtual void reset_supported_syn_ids()=0
virtual void add_syn_id(const synindex synid)=0
virtual std::vector< unsignedint >::iterator & operator>>(std::vector< unsigned int >::iterator &pos)=0
virtual std::vector< unsignedint >::iterator & operator<<(std::vector< unsigned int >::iterator &pos)=0
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
size_t number_of_uints_covered()
This template function returns the number of uints covered by a variable of type T.
Definition secondary_event.h:75
void write_to_comm_buffer(T d, std::vector< unsigned int >::iterator &pos)
This template function writes data of type T to a given position of a std::vector< unsigned int >.
Definition secondary_event.h:97
void read_from_comm_buffer(T &d, std::vector< unsigned int >::iterator &pos)
This template function reads data of type T from a given position of a std::vector< unsigned int >.
Definition secondary_event.h:124
size_t synindex
For enumerations of synapse types.
Definition nest_types.h:115
Definition secondary_event.h:171
std::vector< unsignedint >::iterator as_uint
Definition secondary_event.h:172
CoeffarrayBegin()
Definition secondary_event.h:175
std::vector< DataType >::iterator as_DataType
Definition secondary_event.h:173
Definition secondary_event.h:180
CoeffarrayEnd()
Definition secondary_event.h:184
std::vector< DataType >::iterator as_DataType
Definition secondary_event.h:182
std::vector< unsignedint >::iterator as_uint
Definition secondary_event.h:181