NEURON
nrnmusic.h
Go to the documentation of this file.
1 #include <string>
2 
3 #if defined(NO_PYTHON_H)
4 typedef struct _object PyObject;
5 #else
6 #include <nrnwrap_Python.h>
7 #endif
8 #include <music.hh>
9 
10 #include <unordered_map>
11 
12 class PreSyn;
13 using Gi2PreSynTable = std::unordered_map<int, PreSyn*>;
14 
15 // Interface which nrnmusic.so module (which mdj writes) will use
16 
17 namespace NRNMUSIC {
18 
19 class EventOutputPort: public MUSIC::EventOutputPort {
20  public:
21  EventOutputPort(MUSIC::Setup* s, std::string id)
22  : MUSIC::Port(s, id)
23  , MUSIC::EventOutputPort(s, id) {}
24 
25  // Connect a gid to a MUSIC global index in this port
26  void gid2index(int gid, int gi);
27 
29 };
30 
31 class EventInputPort: public MUSIC::EventInputPort {
32  public:
33  EventInputPort(MUSIC::Setup* s, std::string id);
34 
35  // Connect a MUSIC global index to a gid in this port
36  PyObject* index2target(int gi, PyObject* target);
37 
39 };
40 
41 EventOutputPort* publishEventOutput(std::string identifier);
42 
43 EventInputPort* publishEventInput(std::string identifier);
44 
45 } // namespace NRNMUSIC
EventInputPort(MUSIC::Setup *s, std::string id)
Definition: nrnmusic.cpp:158
PyObject * index2target(int gi, PyObject *target)
Definition: nrnmusic.cpp:168
Gi2PreSynTable * gi_table
Definition: nrnmusic.h:38
EventOutputPort(MUSIC::Setup *s, std::string id)
Definition: nrnmusic.h:21
void gid2index(int gid, int gi)
Definition: nrnmusic.cpp:134
Gi2PreSynTable * gi_table
Definition: nrnmusic.h:28
Definition: netcon.h:258
#define id
Definition: md1redef.h:41
EventInputPort * publishEventInput(std::string identifier)
Definition: nrnmusic.cpp:164
EventOutputPort * publishEventOutput(std::string identifier)
Definition: nrnmusic.cpp:130
s
Definition: multisend.cpp:521
std::unordered_map< int, PreSyn * > Gi2PreSynTable
Definition: nrnmusic.h:13
_object PyObject
Definition: nrnpy.h:12