Re: Accessing fields and functions of a NMODL object in NMODL
Posted: Wed Apr 01, 2009 3:04 pm
Declare nil as an objref and just do not allow it to reference anything.
hoc_objgetarg(1) returns an Object** so it is typically called via
Object* o = *hoc_objgetarg(1);
Then, if you want to be safe, check that the Object is a reference to a NetCon with
check_obj_type(o, "NetCon");
And then finally extract the pointer to the c++ NetCon object
void* vnc = o->u.this_pointer;
vnc can be the first arg to nrn_netcon_event
Code: Select all
oc>objref nil
oc>print nil
NULLobject
oc>
Not quite.Is that true?
hoc_objgetarg(1) returns an Object** so it is typically called via
Object* o = *hoc_objgetarg(1);
Then, if you want to be safe, check that the Object is a reference to a NetCon with
check_obj_type(o, "NetCon");
And then finally extract the pointer to the c++ NetCon object
void* vnc = o->u.this_pointer;
vnc can be the first arg to nrn_netcon_event