classes child is_cas parent sec has_parent nchild root
section sref = new SectionRef()
This class allows sections to be referenced as normal object variables for assignment and passing as arguments.
SectionRef
sref.sec
This last is a procedure that takes two SectionRef args and connects them end to end.create soma, axon axon.diam=2 soma.diam=10 access axon objref s1, s2 soma s1 = new SectionRef() // s1 holds a reference to the soma print s1.sec.diam // print the diameter of the soma s2 = s1 // s2 also holds a reference to the soma s2.sec { psection() } // print all info about soma axon s2 = new SectionRef() proc c() { $o1.sec connect $o2.sec(0), 1 } c(s1, s2) topology()
SectionRef
sref.parent
sref.parent { statement }
just like a
normal section name and does NOT need a section_pop
If there is a chance that a section does not have a parent then
has_parent should be called first to avoid an execution error.
Note that the parent is the current parent of sref.sec, not necessarily
the parent when the SectionRef was created.
SectionRef
sref.child[i]
Note that the children are the current children of sref.sec, not necessarily the same as when the SectionRef was created since sections may be deleted or re-connected subsequent to the instantiation of the SectionRef.for i=0, sref.nchild-1 sref.child[i] { statement }
SectionRef
sref.root
SectionRef
boolean = sref.has_parent
SectionRef
integer = sref.nchild
SectionRef
boolean = sref.is_cas()