NEST main@caf0ae8
 
Loading...
Searching...
No Matches
syn_id_delay.h
Go to the documentation of this file.
1/*
2 * syn_id_delay.h
3 *
4 * This file is part of NEST.
5 *
6 * Copyright (C) 2004 The NEST Initiative
7 *
8 * NEST is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * NEST is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with NEST. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#ifndef SYN_ID_DELAY_H
24#define SYN_ID_DELAY_H
25
26// Includes from nestkernel:
27#include "nest_time.h"
28#include "nest_types.h"
29
30namespace nest
31{
32
34{
35 unsigned int delay : NUM_BITS_DELAY;
36 unsigned int syn_id : NUM_BITS_SYN_ID;
37 bool more_targets : 1;
38 bool disabled : 1;
39
40 explicit SynIdDelay( double d )
42 , more_targets( false )
43 , disabled( false )
44 {
45 set_delay_ms( d );
46 }
47
48 SynIdDelay( const SynIdDelay& s ) = default;
49 SynIdDelay& operator=( const SynIdDelay& s ) = default;
50
54 double
56 {
58 }
59
63 void
64 set_delay_ms( const double d )
65 {
67 }
68
69 void
71 {
72 this->more_targets = more_targets;
73 }
74
75 bool
77 {
78 return more_targets;
79 }
80
86 void
88 {
89 disabled = true;
90 }
91
97 bool
99 {
100 return disabled;
101 }
102};
103
105using success_syn_id_delay_data_size = StaticAssert< sizeof( SynIdDelay ) == 4 >::success;
106}
107
108#endif
static double delay_steps_to_ms(long steps)
Convert between delays given in steps and milliseconds.
Definition nest_time.h:529
static long delay_ms_to_steps(double ms)
Definition nest_time.h:535
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
StaticAssert< sizeof(SynIdDelay)==4 >::success success_syn_id_delay_data_size
check legal size
Definition syn_id_delay.h:105
constexpr uint8_t NUM_BITS_DELAY
Definition nest_types.h:88
constexpr uint8_t NUM_BITS_SYN_ID
Definition nest_types.h:77
constexpr synindex invalid_synindex
Definition nest_types.h:116
Compile time assertions.
Definition static_assert.h:47
Definition syn_id_delay.h:34
double get_delay_ms() const
Return the delay of the connection in ms.
Definition syn_id_delay.h:55
bool source_has_more_targets() const
Definition syn_id_delay.h:76
SynIdDelay(double d)
Definition syn_id_delay.h:40
void disable()
Disables the synapse.
Definition syn_id_delay.h:87
unsigned int syn_id
Definition syn_id_delay.h:36
bool disabled
Definition syn_id_delay.h:38
SynIdDelay(const SynIdDelay &s)=default
bool more_targets
Definition syn_id_delay.h:37
SynIdDelay & operator=(const SynIdDelay &s)=default
void set_source_has_more_targets(const bool more_targets)
Definition syn_id_delay.h:70
unsigned int delay
Definition syn_id_delay.h:35
void set_delay_ms(const double d)
Set the delay of the connection specified in ms.
Definition syn_id_delay.h:64
bool is_disabled() const
Returns a flag denoting if the synapse is disabled.
Definition syn_id_delay.h:98