NEST main@caf0ae8
 
Loading...
Searching...
No Matches
music_rate_in_proxy.h
Go to the documentation of this file.
1/*
2 * music_rate_in_proxy.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 MUSIC_RATE_IN_PROXY_H
24#define MUSIC_RATE_IN_PROXY_H
25
26// Generated includes:
27#include "config.h"
28
29#ifdef HAVE_MUSIC
30
31// C++ includes:
32#include <vector>
33
34// External includes:
35#include <music.hh>
36
37// Includes from nestkernel:
38#include "device_node.h"
39#include "nest_types.h"
40#include "node.h"
41
42
43/* BeginUserDocs: device, rate, MUSIC
44
45Short description
46+++++++++++++++++
47
48A device which receives rate data from MUSIC
49
50Description
51+++++++++++
52
53A ``music_rate_in_proxy`` can be used to receive rate data from
54remote MUSIC applications in NEST.
55
56It uses the MUSIC library to receive the data from other applications.
57The ``music_rate_in_proxy`` represents a complete port to which MUSIC can
58connect and send data. The ``music_rate_in_proxy`` can be queried using
59``GetStatus`` to retrieve the messages.
60
61Parameters
62++++++++++
63
64The following properties are available in the status Dictionary:
65
66========== ===================================================================
67port_name The name of the MUSIC input port to listen to (default: rate_in)
68port_width The width of the MUSIC input port
69data The data received on the port as vector of doubles
70published A bool indicating if the port has been already published with MUSIC
71========== ===================================================================
72
73The parameter port_name can be set using SetStatus.
74
75Examples
76++++++++
77
78/music_rate_in_proxy Create /mcip Set
7910 Simulate
80mcip GetStatus /data get /gaze_directions Set
81
82Availability: Only when compiled with MUSIC
83
84See also
85++++++++
86
87music_rate_out_proxy, music_cont_in_proxy
88
89Examples using this model
90+++++++++++++++++++++++++
91
92.. listexamples:: music_rate_in_proxy
93
94EndUserDocs*/
95
96namespace nest
97{
98void register_music_rate_in_proxy( const std::string& name );
99
104class music_rate_in_proxy : public DeviceNode
105{
106
107public:
108 music_rate_in_proxy();
109 music_rate_in_proxy( const music_rate_in_proxy& );
110
111 bool
112 has_proxies() const
113 {
114 return false;
115 }
116 bool
117 one_node_per_process() const
118 {
119 return true;
120 }
121
127 using Node::handle;
128 using Node::handles_test_event;
129
130 void handle( InstantaneousRateConnectionEvent& );
131
132 void get_status( Dictionary& ) const;
133 void set_status( const Dictionary& );
134
135 using Node::sends_secondary_event;
136 void
137 sends_secondary_event( InstantaneousRateConnectionEvent& )
138 {
139 }
140 void
141 sends_secondary_event( DelayedRateConnectionEvent& )
142 {
143 }
144
145private:
146 void init_buffers_();
147 void pre_run_hook();
148
149 void update( Time const&, const long, const long );
150
151 // ------------------------------------------------------------
152
153 struct State_;
154
155 struct Parameters_
156 {
157 std::string port_name_;
158 long channel_;
159
160 Parameters_();
161
162 void get( Dictionary& ) const;
163 void set( const Dictionary&, State_& );
164 };
165
166 // ------------------------------------------------------------
167
168 struct State_
169 {
170 bool registered_;
172
173 State_();
174
175 void get( Dictionary& ) const;
177 void set( const Dictionary&, const Parameters_& );
178 };
179
180 // ------------------------------------------------------------
181
182 struct Buffers_
183 {
184 double data_;
185 };
186
187 // ------------------------------------------------------------
188
189 struct Variables_
190 {
191 };
192
193 // ------------------------------------------------------------
194
195 Parameters_ P_;
196 State_ S_;
197 Buffers_ B_;
198 Variables_ V_;
199};
200
201} // namespace
202
203#endif
204
205#endif /* #ifndef MUSIC_RATE_IN_PROXY_H */
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
Declarations for base class Node.