NEST  2.6.0,not_revisioned_source_dir@0
connection_id.h
Go to the documentation of this file.
1 /*
2  * connection_id.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 CONNECTION_ID_H
24 #define CONNECTION_ID_H
25 
26 #include "arraydatum.h"
27 #include "dictutils.h"
28 
29 namespace nest
30 {
31 
33  {
34  public:
36  ConnectionID(long source_gid, long target_gid, long target_thread, long synapse_modelid, long port);
37  ConnectionID(long source_gid, long target_thread, long synapse_modelid, long port);
38  ConnectionID(const ConnectionID &);
39 
40  DictionaryDatum get_dict() const;
41  ArrayDatum to_ArrayDatum() const;
42  bool operator==(const ConnectionID& c) const;
43  void print_me(std::ostream& out) const;
44  long get_source_gid() const;
45  long get_target_gid() const;
46  long get_target_thread() const;
47  long get_synapse_model_id() const;
48  long get_port() const;
49 
50  protected:
55  long port_;
56  };
57 
58  inline
60  : source_gid_(cid.source_gid_),
61  target_gid_(cid.target_gid_),
62  target_thread_(cid.target_thread_),
63  synapse_modelid_(cid.synapse_modelid_),
64  port_(cid.port_)
65  {}
66 
67  inline
69  {
70  return source_gid_;
71  }
72 
73  inline
75  {
76  return target_gid_;
77  }
78 
79  inline
81  {
82  return target_thread_;
83  }
84 
85  inline
87  {
88  return synapse_modelid_;
89  }
90 
91  inline
93  {
94  return port_;
95  }
96 
97 } // namespace
98 
99 #endif /* #ifndef CONNECTION_ID_H */
long get_source_gid() const
Definition: connection_id.h:68
long get_synapse_model_id() const
Definition: connection_id.h:86
Definition: lockptrdatum.h:40
long get_target_thread() const
Definition: connection_id.h:80
long target_thread_
Definition: connection_id.h:53
bool operator==(const ConnectionID &c) const
Definition: connection_id.cpp:70
Definition: connection_id.h:32
long get_target_gid() const
Definition: connection_id.h:74
void print_me(std::ostream &out) const
Definition: connection_id.cpp:79
DictionaryDatum get_dict() const
Definition: connection_id.cpp:46
ArrayDatum to_ArrayDatum() const
Definition: connection_id.cpp:59
long synapse_modelid_
Definition: connection_id.h:54
long_t port
Connection port number to distinguis outgoing connections.
Definition: nest.h:155
long source_gid_
Definition: connection_id.h:51
const Name target_thread("target_thread")
Connection parameters.
Definition: nest_names.h:283
long get_port() const
Definition: connection_id.h:92
ConnectionID()
Definition: connection_id.h:35
long target_gid_
Definition: connection_id.h:52
const Name synapse_modelid("synapse_modelid")
Connection parameters.
Definition: nest_names.h:273
long port_
Definition: connection_id.h:55
const Name c("c")
Specific to Izhikevich 2003.
Definition: nest_names.h:62