NEST main@caf0ae8
 
Loading...
Searching...
No Matches
stimulation_backend.h
Go to the documentation of this file.
1/*
2 * stimulation_backend.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 STIMULATION_BACKEND_H
24#define STIMULATION_BACKEND_H
25
26// C++ includes:
27#include <vector>
28
29#include "stimulation_device.h"
30
31namespace nest
32{
33
68{
69public:
70 StimulationBackend() = default;
71
72 virtual ~StimulationBackend() noexcept = default;
73
107 virtual void enroll( StimulationDevice&, const Dictionary& ) {};
108
124 virtual void disenroll( StimulationDevice& ) {};
125
139 virtual void pre_run_hook() = 0;
140
150 virtual void post_run_hook() = 0;
151
152 // In order to allow a derived backend do work at the end of each simulation step, this base
153 // class could define the function post_step_hook() right about here.
154 // However, this function would be called at the very end of each simulation step and require
155 // a very tight synchronization between incoming data and the simulation control itself. As the
156 // requirements for this are currently not formally defined due to the lack of a suitable use-case,
157 // we decided to omit the function from the interface until such a use-case arises.
158 virtual void initialize() = 0;
159 virtual void finalize() = 0;
160
170 virtual void prepare() = 0;
171
182 virtual void cleanup() = 0;
183
184 void clear( const StimulationDevice& ) {};
185};
186
187} // namespace
188
189#endif /* #ifndef STIMULATION_BACKEND_H */
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
Abstract base class for all NESTio stimulation backends.
Definition stimulation_backend.h:68
virtual void initialize()=0
virtual void cleanup()=0
Clean up the backend at the end of a user level call to the NEST Simulate function.
virtual void enroll(StimulationDevice &, const Dictionary &)
Enroll a StimulationDevice with the StimulationBackend.
Definition stimulation_backend.h:107
virtual void prepare()=0
Prepare the backend at the beginning of the NEST Simulate function.
void clear(const StimulationDevice &)
Definition stimulation_backend.h:184
virtual void finalize()=0
virtual void disenroll(StimulationDevice &)
Disenroll a StimulationDevice from the StimulationBackend.
Definition stimulation_backend.h:124
virtual ~StimulationBackend() noexcept=default
virtual void post_run_hook()=0
Clean up the backend at the end of a Run.
virtual void pre_run_hook()=0
Initialize global backend-specific data structures.
Base class for common properties of StimulationDevices.
Definition stimulation_device.h:154
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33