Groups have many functions for operating on the elements of the group.
These functions return an element of the group. The element is an instance of the group's element type.
El (int i)
i
. If the index is
out of range, an out of rangeerror is reported, and NULL
is
returned.
DefaultEl()
default_el
variable of the
group.
Leaf (int n)
FirstEl()
NextEl();
Pop()
Peek()
Pop()
function, but it does not
remove the element.
These functions return an integer indicating the index of the element in the group. In all these functions if no match is found, a value of "-1" is returned.
FindEl (inst el)
el
.
FindName (char* name)
name
.
Find (TypeDef t)
T
.
FindLeaf (char* name)
name
.
FindLeafEl (inst el)
el
.
These functions are used to add elements to the group.
AddEl (inst el)
el
to the group
AddUniqueName (inst el)
el
to the group and adds an instance
index to its name if another element in the group has the same name.
Push (inst el)
el
to the end of the group.
PushUnique (inst el)
el
to the end of group only if it is
not in the group already.
PushUniqueName (inst el)
el
to the end of the group only if
there are no other elements of the group with the same name.
Insert (inst el, int i)
el
at position i
in the group.
If the position i
is out of range, it is added to the beginning or
end of the group accordingly.
Replace (int i ,inst el)
i
with the element
el
.
ReplaceEl (inst rel, inst el)
rel
of the group with element
el
. If no match is found, the element el
is not inserted.
ReplaceName (char* name, inst el)
name
with the
element el
. If no match is found, the element el
is not
inserted.
Transfer (inst el)
el
from the group or owner it is currently
in and adds it to this group.
Link (inst el)
el
to this group.
There are also corresponding functions (InsertLink, ReplaceLink, etc)
which perform as the do the Add functions except they link instead of
add (see section 8.2 Groups).
New (int i, typedef t)
i
new objects of type t
in the group.
These functions are used for removing elements from the group.
Remove (int i)
Move (int from, int to)
from
and inserts at position to
.
RemoveName (char* name)
name
.
RemoveLeafName (char* name)
name
.
RemoveAll()
These functions return a subgroup of the group.
Gp (int i)
LeafGp (int n)
FirstGp()
NextGp()