NEURON
hoccontext.h
Go to the documentation of this file.
1 #ifndef hoccontext_h
2 #define hoccontext_h
3 
4 
5 extern Object* hoc_thisobject;
8 extern Symlist* hoc_symlist;
9 
10 #define HocTopContextSet \
11  HocContext hcref; \
12  HocContext* hc_ = 0; \
13  if (hoc_thisobject) { \
14  hc_ = hc_save_and_set_to_top_(&hcref); \
15  }
16 
17 #define HocContextRestore \
18  if (hc_) { \
19  hc_restore_(hc_); \
20  }
21 
22 typedef struct HocContext {
26 } HocContext;
27 
29  hc->obj = hoc_thisobject;
30  hc->obd = hoc_objectdata;
31  hc->sl = hoc_symlist;
32  hoc_thisobject = 0;
34  hoc_symlist = hoc_top_level_symlist;
35  return hc;
36 }
37 static void hc_restore_(HocContext* hc) {
38  hoc_thisobject = hc->obj;
39  hoc_objectdata = hc->obd;
40  hoc_symlist = hc->sl;
41 }
42 #endif
Definition: hocdec.h:84
Symlist * hoc_symlist
Objectdata * hoc_top_level_data
Definition: hoc_oop.cpp:134
Object * obj
Definition: hoccontext.h:23
Symlist * sl
Definition: hoccontext.h:25
static void hc_restore_(HocContext *hc)
Definition: hoccontext.h:37
Objectdata * hoc_objectdata
Definition: hoc_oop.cpp:133
Objectdata * obd
Definition: hoccontext.h:24
Symlist * hoc_top_level_symlist
Neuron/Java Interface code.
Definition: symbol.cpp:41
struct HocContext HocContext
Definition: hocdec.h:226
Object * hoc_thisobject
Definition: hoc_oop.cpp:132
static HocContext * hc_save_and_set_to_top_(HocContext *hc)
Definition: hoccontext.h:28