NEST main@caf0ae8
 
Loading...
Searching...
No Matches
music_event_handler.h
Go to the documentation of this file.
1/*
2 * music_event_handler.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_EVENT_HANDLER
24#define MUSIC_EVENT_HANDLER
25
26// Generated includes:
27#include "config.h"
28
29#ifdef HAVE_MUSIC
30
31// C++ includes:
32#include <music.hh>
33#include <queue>
34
35// Includes from nestkernel:
36#include "nest_types.h"
37#include "node.h"
38
39
40namespace nest
41{
42
46class MusicEventHandler : public MUSIC::EventHandlerGlobalIndex
47{
48public:
49 MusicEventHandler();
50 MusicEventHandler( std::string portname, double acceptable_latency, int max_buffered );
51
52 virtual ~MusicEventHandler();
53
57 void register_channel( size_t channel, Node* mp );
58
65 void publish_port();
66
73 void operator()( double t, MUSIC::GlobalIndex channel );
74
79 void update( Time const&, const long, const long );
80
81private:
82 MUSIC::EventInputPort* music_port_;
83 MUSIC::PermutationIndex* music_perm_ind_;
84 bool published_;
85 std::string portname_;
87 std::vector< Node* > channelmap_;
89 std::vector< MUSIC::GlobalIndex > indexmap_;
90 double acceptable_latency_;
91 int max_buffered_;
92
99 std::vector< std::priority_queue< double, std::vector< double >, std::greater< double > > > eventqueue_;
100};
101
102} // namespace nest
103
104#endif /* #ifdef HAVE_MUSIC */
105
106#endif /* #ifndef MUSIC_EVENT_HANDLER */
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
Declarations for base class Node.