NEST main@caf0ae8
 
Loading...
Searching...
No Matches
music_cont_in_proxy.h
Go to the documentation of this file.
1/*
2 * music_cont_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_CONT_IN_PROXY_H
24#define MUSIC_CONT_IN_PROXY_H
25
26// Generated includes:
27#include "config.h"
28
29#ifdef HAVE_MUSIC
30
31// C includes:
32#include <mpi.h>
33
34// C++ includes:
35#include <vector>
36
37// External includes:
38#include <music.hh>
39
40// Includes from nestkernel:
41#include "device_node.h"
42#include "nest_types.h"
43
44
45namespace nest
46{
47void register_music_cont_in_proxy( const std::string& name );
48
49/* BeginUserDocs: device, MUSIC
50
51Short description
52+++++++++++++++++
53
54A device which receives continuous data from MUSIC
55
56Description
57+++++++++++
58
59A ``music_cont_in_proxy`` can be used to receive continuous data from
60remote MUSIC applications in NEST.
61
62It uses the MUSIC library to receive the data from other applications.
63The ``music_cont_in_proxy`` represents a complete port to which MUSIC can
64connect and send data. The music_cont_in_proxy can queried using
65GetStatus to retrieve the messages.
66
67This model is only available if NEST was compiled with MUSIC.
68
69Parameters
70++++++++++
71
72The following properties are available in the status Dictionary:
73
74=========== ======= ========================================================
75 port_name string The name of the MUSIC input port to listen to (default:
76 cont_in)
77 port_width integer The width of the MUSIC input port
78 data list The data received on the port
79 published boolean A bool indicating if the port has been already published
80 with MUSIC
81=========== ======= ========================================================
82
83The parameter port_name can be set using SetStatus.
84
85See also
86++++++++
87
88music_event_out_proxy, music_event_in_proxy, music_message_in_proxy
89
90Examples using this model
91+++++++++++++++++++++++++
92
93.. listexamples:: music_cont_in_proxy
94
95EndUserDocs */
96
97class music_cont_in_proxy : public DeviceNode
98{
99
100public:
101 music_cont_in_proxy();
102 music_cont_in_proxy( const music_cont_in_proxy& );
103
104 bool
105 has_proxies() const
106 {
107 return false;
108 }
109 bool
110 one_node_per_process() const
111 {
112 return true;
113 }
114
115 void get_status( Dictionary& ) const;
116 void set_status( const Dictionary& );
117
118private:
119 void init_buffers_();
120 void pre_run_hook();
121
122 void
123 update( Time const&, const long, const long )
124 {
125 }
126
127 // ------------------------------------------------------------
128
129 struct State_;
130
131 struct Parameters_
132 {
133 std::string port_name_;
134
135 Parameters_();
136
137 void get( Dictionary& ) const;
138 void set( const Dictionary&, State_&, Node* );
139 };
140
141 // ------------------------------------------------------------
142
143 struct State_
144 {
145 bool published_;
147 int port_width_;
148
149 State_();
150
151 void get( Dictionary& ) const;
153 void set( const Dictionary&, const Parameters_& );
154 };
155
156 // ------------------------------------------------------------
157
158 struct Buffers_
159 {
160 std::vector< double > data_;
161 };
162
163 // ------------------------------------------------------------
164
165 struct Variables_
166 {
167 MUSIC::ContInputPort* MP_;
168 };
169
170 // ------------------------------------------------------------
171
172 Parameters_ P_;
173 State_ S_;
174 Buffers_ B_;
175 Variables_ V_;
176};
177
178} // namespace
179
180#endif
181
182#endif /* #ifndef MUSIC_CONT_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