@@ -121,7 +121,7 @@ namespace neuron {
121
121
hoc_retpushx (1 .);
122
122
}
123
123
/* Mechanism procedures and functions */
124
- inline double get_a_42_test_func_proc (_nrn_mechanism_cache_range* _ml, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double a);
124
+ inline double x_plus_a_test_func_proc (_nrn_mechanism_cache_range* _ml, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double a);
125
125
inline int set_x_42_test_func_proc (_nrn_mechanism_cache_range* _ml, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt);
126
126
inline int set_x_a_test_func_proc (_nrn_mechanism_cache_range* _ml, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double a);
127
127
inline int set_a_x_test_func_proc (_nrn_mechanism_cache_range* _ml, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt);
@@ -143,11 +143,11 @@ namespace neuron {
143
143
static void _hoc_set_x_42 (void );
144
144
static void _hoc_set_x_a (void );
145
145
static void _hoc_set_a_x (void );
146
- static void _hoc_get_a_42 (void );
146
+ static void _hoc_x_plus_a (void );
147
147
static double _npy_set_x_42 (Prop*);
148
148
static double _npy_set_x_a (Prop*);
149
149
static double _npy_set_a_x (Prop*);
150
- static double _npy_get_a_42 (Prop*);
150
+ static double _npy_x_plus_a (Prop*);
151
151
152
152
153
153
/* connect user functions to hoc names */
@@ -156,14 +156,14 @@ namespace neuron {
156
156
{" set_x_42_test_func_proc" , _hoc_set_x_42},
157
157
{" set_x_a_test_func_proc" , _hoc_set_x_a},
158
158
{" set_a_x_test_func_proc" , _hoc_set_a_x},
159
- {" get_a_42_test_func_proc " , _hoc_get_a_42 },
159
+ {" x_plus_a_test_func_proc " , _hoc_x_plus_a },
160
160
{0 , 0 }
161
161
};
162
162
static NPyDirectMechFunc npy_direct_func_proc[] = {
163
163
{" set_x_42" , _npy_set_x_42},
164
164
{" set_x_a" , _npy_set_x_a},
165
165
{" set_a_x" , _npy_set_a_x},
166
- {" get_a_42 " , _npy_get_a_42 },
166
+ {" x_plus_a " , _npy_x_plus_a },
167
167
};
168
168
static void _hoc_set_x_42 (void ) {
169
169
double _r{};
@@ -267,22 +267,25 @@ namespace neuron {
267
267
set_a_x_test_func_proc (_ml, id, _ppvar, _thread, _nt);
268
268
return (_r);
269
269
}
270
- static void _hoc_get_a_42 (void ) {
270
+ static void _hoc_x_plus_a (void ) {
271
271
double _r{};
272
272
Datum* _ppvar;
273
273
Datum* _thread;
274
274
NrnThread* _nt;
275
- Prop* _local_prop = _prop_id ? _extcall_prop : nullptr ;
275
+ if (!_prop_id) {
276
+ hoc_execerror (" No data for x_plus_a_test_func_proc. Requires prior call to setdata_test_func_proc and that the specified mechanism instance still be in existence." , NULL );
277
+ }
278
+ Prop* _local_prop = _extcall_prop;
276
279
_nrn_mechanism_cache_instance _ml_real{_local_prop};
277
280
auto * const _ml = &_ml_real;
278
281
size_t const id{};
279
282
_ppvar = _local_prop ? _nrn_mechanism_access_dparam (_local_prop) : nullptr ;
280
283
_thread = _extcall_thread.data ();
281
284
_nt = nrn_threads;
282
- _r = get_a_42_test_func_proc (_ml, id, _ppvar, _thread, _nt, *getarg (1 ));
285
+ _r = x_plus_a_test_func_proc (_ml, id, _ppvar, _thread, _nt, *getarg (1 ));
283
286
hoc_retpushx (_r);
284
287
}
285
- static double _npy_get_a_42 (Prop* _prop) {
288
+ static double _npy_x_plus_a (Prop* _prop) {
286
289
double _r{};
287
290
Datum* _ppvar;
288
291
Datum* _thread;
@@ -293,7 +296,7 @@ namespace neuron {
293
296
_ppvar = _nrn_mechanism_access_dparam (_prop);
294
297
_thread = _extcall_thread.data ();
295
298
_nt = nrn_threads;
296
- _r = get_a_42_test_func_proc (_ml, id, _ppvar, _thread, _nt, *getarg (1 ));
299
+ _r = x_plus_a_test_func_proc (_ml, id, _ppvar, _thread, _nt, *getarg (1 ));
297
300
return (_r);
298
301
}
299
302
@@ -323,11 +326,11 @@ namespace neuron {
323
326
}
324
327
325
328
326
- inline double get_a_42_test_func_proc (_nrn_mechanism_cache_range* _ml, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double a) {
329
+ inline double x_plus_a_test_func_proc (_nrn_mechanism_cache_range* _ml, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double a) {
327
330
auto inst = make_instance_test_func_proc (*_ml);
328
- double ret_get_a_42 = 0.0 ;
329
- ret_get_a_42 = a + 42.0 ;
330
- return ret_get_a_42 ;
331
+ double ret_x_plus_a = 0.0 ;
332
+ ret_x_plus_a = inst. x [id] + a ;
333
+ return ret_x_plus_a ;
331
334
}
332
335
333
336
0 commit comments