NEST  2.6.0,not_revisioned_source_dir@0
static_connection.h
Go to the documentation of this file.
1 /*
2  * static_connection.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 
24 /* BeginDocumentation
25  Name: static_synapse - Synapse type for static connections.
26 
27  Description:
28  static_synapse does not support any kind of plasticity. It simply stores
29  the parameters target, weight, delay and receiver port for each connection.
30 
31  FirstVersion: October 2005
32  Author: Jochen Martin Eppler, Moritz Helias
33 
34  Transmits: SpikeEvent, RateEvent, CurrentEvent, ConductanceEvent, DoubleDataEvent, DataLoggingRequest
35 
36  Remarks: Refactored for new connection system design, March 2007
37 
38  SeeAlso: synapsedict, tsodyks_synapse, stdp_synapse
39 */
40 
41 #ifndef STATICCONNECTION_H
42 #define STATICCONNECTION_H
43 
44 #include "connection.h"
45 
46 namespace nest
47 {
48 
55 template<typename targetidentifierT>
56 class StaticConnection : public Connection<targetidentifierT>
57 {
59 
60  public:
61 
62  // this line determines which common properties to use
64 
66 
72  { }
73 
79  { }
80 
81  // Explicitly declare all methods inherited from the dependent base ConnectionBase.
82  // This avoids explicit name prefixes in all places these functions are used.
83  // Since ConnectionBase depends on the template parameter, they are not automatically
84  // found in the base class.
88 
89 
91  {
92  public:
93  // Ensure proper overriding of overloaded virtual functions.
94  // Return values from functions are ignored.
104  };
105 
107  {
108  ConnTestDummyNode dummy_target;
109  ConnectionBase::check_connection_(dummy_target, s, t, receptor_type);
110  }
111 
113  {
114  e.set_weight(weight_);
116  e.set_receiver(*get_target(t));
117  e.set_rport(get_rport());
118  e();
119  }
120 
121  void get_status(DictionaryDatum & d) const;
122 
123  void set_status(const DictionaryDatum & d, ConnectorModel& cm);
124 
125  void set_weight (double_t w) { weight_ = w; }
126 };
127 
128 template<typename targetidentifierT>
130 {
131 
132  ConnectionBase::get_status(d);
133  def<double_t>(d, names::weight, weight_);
134  def<long_t>(d, names::size_of, sizeof(*this));
135 }
136 
137 template<typename targetidentifierT>
139 {
140  ConnectionBase::set_status(d, cm);
141  updateValue<double_t>(d, names::weight, weight_);
142 }
143 
144 } // namespace
145 
146 #endif /* #ifndef STATICCONNECTION_H */
void set_rport(rport p)
Set the receiver port number (r-port).
Definition: event.h:817
Class representing a static connection.
Definition: static_connection.h:56
void set_receiver(Node &)
Change pointer to receiving Node.
Definition: event.h:708
const Name receptor_type("receptor_type")
Connection parameters.
Definition: nest_names.h:240
Definition: lockptrdatum.h:40
const Name d("d")
Specific to Izhikevich 2003.
Definition: nest_names.h:83
"Callback request event" for use in Device.
Definition: event.h:374
long_t get_delay_steps() const
Return the delay of the connection in steps.
Definition: connection.h:126
void check_connection_(Node &dummy_target, Node &source, Node &target, rport receptor_type)
This function calls check_connection() on the sender to check if the receiver accepts the event type ...
Definition: connection.h:183
const rport invalid_port_
Value for invalid connection port number.
Definition: nest.h:160
const Name weight("weight")
Connection parameters.
Definition: nest_names.h:344
Encapsulates information which is sent between Nodes.
Definition: event.h:73
port handles_test_event(DataLoggingRequest &, rport)
Definition: static_connection.h:98
void set_weight(weight t)
Set weight of the event.
Definition: event.h:751
port handles_test_event(RateEvent &, rport)
Definition: static_connection.h:97
Event for electrical currents.
Definition: event.h:420
long_t rport
Connection port number to distinguish incoming connections, also called receiver port.
Definition: nest.h:147
Connection< targetidentifierT > ConnectionBase
Definition: static_connection.h:65
Node * get_target(thread t) const
Definition: connection.h:155
port handles_test_event(CurrentEvent &, rport)
Definition: static_connection.h:99
const Name w("w")
Specific to Brette & Gerstner 2005 (aeif_cond-*)
Definition: nest_names.h:343
port handles_test_event(DoubleDataEvent &, rport)
Definition: static_connection.h:101
void set_delay(delay)
Set the transmission delay of the event.
Definition: event.h:781
void check_connection(Node &s, Node &t, rport receptor_type, double_t, const CommonPropertiesType &)
Definition: static_connection.h:106
void get_status(DictionaryDatum &d) const
Definition: static_connection.h:129
void send(Event &e, thread t, double_t, const CommonSynapseProperties &)
Definition: static_connection.h:112
void set_weight(double_t w)
Definition: static_connection.h:125
StaticConnection(const StaticConnection &rhs)
Copy constructor from a property object.
Definition: static_connection.h:78
Base class for dummy nodes used in connection testing.
Definition: connection.h:64
port handles_test_event(SpikeEvent &, rport)
Check if the node can handle a particular event and receptor type.
Definition: static_connection.h:96
Event for firing rate information.
Definition: event.h:387
StaticConnection()
Default Constructor.
Definition: static_connection.h:71
long_t port
Connection port number to distinguis outgoing connections.
Definition: nest.h:155
Definition: static_connection.h:90
double double_t
Double precision floating point numbers.
Definition: nest.h:93
port handles_test_event(DSSpikeEvent &, rport)
Definition: static_connection.h:102
rport get_rport() const
Definition: connection.h:156
virtual port handles_test_event(SpikeEvent &, rport receptor_type)
Check if the node can handle a particular event and receptor type.
Definition: node.cpp:203
Request data to be logged/logged data to be sent.
Definition: event.h:486
const Name size_of("sizeof")
Connection parameters.
Definition: nest_names.h:259
Class containing the common properties for all connections of a certain type.
Definition: common_synapse_properties.h:44
port handles_test_event(ConductanceEvent &, rport)
Definition: static_connection.h:100
Definition: event.h:685
void set_status(const DictionaryDatum &d, ConnectorModel &cm)
Definition: static_connection.h:138
double_t weight_
Definition: static_connection.h:58
port handles_test_event(DSCurrentEvent &, rport)
Definition: static_connection.h:103
Base class for representing connections.
Definition: connection.h:85
Event for spike information.
Definition: event.h:320
CommonSynapseProperties CommonPropertiesType
Definition: static_connection.h:63
Base class for all NEST network objects.
Definition: node.h:96
Definition: connector_model.h:38
int_t thread
Thread index type.
Definition: nest.h:133
const double e
Definition: numerics.cpp:62
"Callback request event" for use in Device.
Definition: event.h:465
Event for electrical conductances.
Definition: event.h:616