libSBML C API  5.18.0
ListOfMembers_t Class Reference

Detailed Description

groups A list of Member_t objects.

In the SBML Level 3 Groups package, the membership of a group is defined by placing Member_t objects within a ListOfMembers_t object contained within a Group_t object. A ListOfMembers_t object is optional, but, if present, it must contain at least one Member_t object. In common with other ListOf___ classes in SBML, ListOfMembers_t is derived from SBase_t. However, an uncommon feature of ListOfMembers_t is that it has optional "id" and "name" attributes that can be used in a manner discussed below.

A ListOfMembers_t must have one or more Member_t children. Since ListOfMembers_t is derived from SBase_t, it inherits the "sboTerm" and "metaid" attributes, as well as the optional children Notes and Annotation. Unlike most lists of objects in SBML, however, the "sboTerm" attribute and the Notes and Annotation children are taken here to apply directly to every SBML element referenced by each child Member_t of this ListOfMembers_t, if that referenced element has no such definition. Thus, if a referenced element has no defined "sboTerm" attribute or child Notes or Annotation objects, that element should be considered to now have the "sboTerm", child Notes, or child Annotation of the ListOfMembers_t.

If multiple ListOfMembers_t have child Member_t elements that reference the same SBML element, and more than one ListOfMembers_t or Member_t has a value for an sboTerm attribute, Notes, or Annotation element, those Member_t elements should be consistent with each other: the "sboTerm" attributes should either be identical, or one should inherit from the other; Notes should say the same or similar things; and Annotation elements should not conflict. Interpreters may choose to resolve any such conflicts arbitrarily.

An uncommon feature about ListOfMembers_t is that, if it is referenced by a Member_t of a different Group_t, the children of the referenced ListOfMembers_t are also considered to be members of the referencing group. In this way, groups may be nested semantically to create larger groups out of subgroups.

Semantics of group memberships

If a Member_t object within a Group_t object's ListOfMembers_t references another Group_t object, it is the referenced Group_t itself that is considered to be a member of the parent Group_t, not the corresponding referenced model component(s). This is true regardless of whether those components themselves happen to point to other components using some mechanism defined by another SBML Level 3 package (as happens, for example, in the SBML Level 3 Hierarchical Model Composition package and its use of SBaseRef_t). However, if instead a Member_t object references a ListOfMembers_t object (using the "id" attribute permitted on ListOfMembers_t objects), it is the components of that ListOfMembers_t that are considered to be part of the parent Group_t. In other words: if in some Group_t G, a Member_t M references another Group_t, that Group_t is the member of G; if M references a ListOfMembers_t, it is the entities referenced by the Member_t objects within the ListOfMembers_t that are the members of G and not the ListOfMembers_t object itself.

The implication of this is that any rule that applies to members of a group (such the meaning of the "kind" attribute, or the restrictions on the application of "sboTerm" attributes on a ListOfMembers_t) applies to the child group when referenced by the Group_t "id", and to the members of the child group when referenced by the ListOfMembers_t "id". In an example situation where a parent group includes two Species_t plus a Group_t which itself contains three other Species_t, if the parent group's ListOfMembers_t is given an "sboTerm" attribute value, that SBO_t term applies to the two species and the group, not to the three child species members of the second group. (Note also that in such a case, the parent group's "kind" attribute value would almost certainly be "collection" or "partonomy", and not "classification", as two species and a group are very unlikely to be classified as the same thing.) In contrast, in the situation where a parent group includes two Species_t plus a ListOfMembers_t which contains three other Species_t, the parent group's ListOfMembers_t "sboTerm" would apply to the five Species_t, and could be more reasonably marked as a "classification".

In a future version of this SBML Level 3 Groups specification, it may be possible to perform set operations on groups, but for now, this type of union is the only set operation that is possible.

Groups are not permitted to be circular: no Member_t may reference itself, its parent ListOfMembers_t, nor its parent Group_t. If a Member_t references a Group_t, the same restrictions apply to that subgroup's children: they may not reference the Member_t, its parent ListOfMembers_t, nor its parent Group_t, and if any of those children reference a Group_t, the same restrictions apply to them, etc.

If a Member_t has a "idRef" or "metaIdRef" attribute which references an object from a namespace that is not understood by the interpreter of the SBML model, that Member_t must be ignored. The referenced object will not be understood by the interpreter, and therefore has no need to become a member of the group. If an interpreter cannot tell whether a referenced object does not exist or if exists in an unparsed namespace, it may choose to produce a warning.

See also
Group_t
Member_t
ListOfGroups_t

Public Member Functions

Member_tListOfMembers_getById (ListOf_t *lo, const char *sid)
 Get a Member_t from the ListOf_t based on its identifier. More...
 
char * ListOfMembers_getId (const ListOf_t *lo)
 Returns the value of the "id" attribute of this ListOf_t. More...
 
Member_tListOfMembers_getMember (ListOf_t *lo, unsigned int n)
 Get a Member_t from the ListOf_t. More...
 
char * ListOfMembers_getName (const ListOf_t *lo)
 Returns the value of the "name" attribute of this ListOf_t. More...
 
int ListOfMembers_isSetId (const ListOf_t *lo)
 Predicate returning 1 (true) if this ListOf_t's "id" attribute is set. More...
 
int ListOfMembers_isSetName (const ListOf_t *lo)
 Predicate returning 1 (true) if this ListOf_t's "name" attribute is set. More...
 
Member_tListOfMembers_remove (ListOf_t *lo, unsigned int n)
 Removes the nth Member_t from this ListOf_t and returns a pointer to it. More...
 
Member_tListOfMembers_removeById (ListOf_t *lo, const char *sid)
 Removes the Member_t from this ListOf_t based on its identifier and returns a pointer to it. More...
 
int ListOfMembers_setId (ListOf_t *lo, const char *id)
 Sets the value of the "id" attribute of this ListOf_t. More...
 
int ListOfMembers_setName (ListOf_t *lo, const char *name)
 Sets the value of the "name" attribute of this ListOf_t. More...
 
int ListOfMembers_unsetId (ListOf_t *lo)
 Unsets the value of the "id" attribute of this ListOf_t. More...
 
int ListOfMembers_unsetName (ListOf_t *lo)
 Unsets the value of the "name" attribute of this ListOf_t. More...
 

Member Function Documentation

Member_t * ListOfMembers_getById ( ListOf_t lo,
const char *  sid 
)

Get a Member_t from the ListOf_t based on its identifier.

Parameters
lothe ListOf_t structure to search.
sida string representing the identifier of the Member_t to retrieve.
Returns
the Member_t in this ListOf_t with the given sid or NULL if no such Member_t exists.
Note
The pointer that is returned by this function is not owned by the caller, but may be queried and modified. Any changes made will be reflected in any resulting SBML document containing the pointer's parent.
char * ListOfMembers_getId ( const ListOf_t lo)

Returns the value of the "id" attribute of this ListOf_t.

Parameters
lothe ListOf_t structure whose id is sought.
Returns
the value of the "id" attribute of this ListOf_t as a pointer to a string.
Warning
The string returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the string will not be reflected in any resulting SBML document unless the string is added to an SBML Document. Even in this case, the string should be deleted, as adding a string to an SBML Document adds a copy of the string, and does not transfer ownership of that string.
Member_t * ListOfMembers_getMember ( ListOf_t lo,
unsigned int  n 
)

Get a Member_t from the ListOf_t.

Parameters
lothe ListOf_t structure to search.
nan unsigned int representing the index of the Member_t to retrieve.
Returns
the nth Member_t in this ListOf_t. If the index n is invalid, NULL is returned.
Note
The pointer that is returned by this function is not owned by the caller, but may be queried and modified. Any changes made will be reflected in any resulting SBML document containing the pointer's parent.
char * ListOfMembers_getName ( const ListOf_t lo)

Returns the value of the "name" attribute of this ListOf_t.

Parameters
lothe ListOf_t structure whose name is sought.
Returns
the value of the "name" attribute of this ListOf_t as a pointer to a string.
Warning
The string returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the string will not be reflected in any resulting SBML document unless the string is added to an SBML Document. Even in this case, the string should be deleted, as adding a string to an SBML Document adds a copy of the string, and does not transfer ownership of that string.
int ListOfMembers_isSetId ( const ListOf_t lo)

Predicate returning 1 (true) if this ListOf_t's "id" attribute is set.

Parameters
lothe ListOf_t structure.
Returns
1 (true) if this ListOf_t's "id" attribute has been set, otherwise 0 (false) is returned.
int ListOfMembers_isSetName ( const ListOf_t lo)

Predicate returning 1 (true) if this ListOf_t's "name" attribute is set.

Parameters
lothe ListOf_t structure.
Returns
1 (true) if this ListOf_t's "name" attribute has been set, otherwise 0 (false) is returned.
Member_t * ListOfMembers_remove ( ListOf_t lo,
unsigned int  n 
)

Removes the nth Member_t from this ListOf_t and returns a pointer to it.

Parameters
lothe ListOf_t structure to search.
nan unsigned int representing the index of the Member_t to remove.
Returns
a pointer to the nth Member_t in this ListOf_t.
Warning
The pointer that is returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the element will not be reflected in any resulting SBML document unless the element is added to an SBML Document. Even in this case, the element's deletion is still the responsibility of the caller with two exceptions: if it is used as the "disownedItem" in the ListOf_appendAndOwn() or ListOf_insertAndOwn() functions. All other functions in libsbml add a copy of the element, and do not transfer ownership of the pointer.
Member_t * ListOfMembers_removeById ( ListOf_t lo,
const char *  sid 
)

Removes the Member_t from this ListOf_t based on its identifier and returns a pointer to it.

Parameters
lothe ListOf_t structure to search.
sida string representing the identifier of the Member_t to remove.
Returns
the Member_t in this ListOf_t based on the identifier or NULL if no such Member_t exists.
Warning
The pointer that is returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the element will not be reflected in any resulting SBML document unless the element is added to an SBML Document. Even in this case, the element's deletion is still the responsibility of the caller with two exceptions: if it is used as the "disownedItem" in the ListOf_appendAndOwn() or ListOf_insertAndOwn() functions. All other functions in libsbml add a copy of the element, and do not transfer ownership of the pointer.
int ListOfMembers_setId ( ListOf_t lo,
const char *  id 
)

Sets the value of the "id" attribute of this ListOf_t.

Parameters
lothe ListOf_t structure.
idconst char * value of the "id" attribute to be set.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are: Calling this function with id = NULL or an empty string is equivalent to calling ListOfMembers_unsetId().
int ListOfMembers_setName ( ListOf_t lo,
const char *  name 
)

Sets the value of the "name" attribute of this ListOf_t.

Parameters
lothe ListOf_t structure.
nameconst char * value of the "name" attribute to be set.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are: Calling this function with name = NULL or an empty string is equivalent to calling ListOfMembers_unsetName().
int ListOfMembers_unsetId ( ListOf_t lo)

Unsets the value of the "id" attribute of this ListOf_t.

Parameters
lothe ListOf_t structure.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int ListOfMembers_unsetName ( ListOf_t lo)

Unsets the value of the "name" attribute of this ListOf_t.

Parameters
lothe ListOf_t structure.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are: