ListOf.cpp File Reference

Detailed Description

Wraps List and inherits from SBase.

Author:
Ben Bornstein
Include dependency graph for ListOf.cpp:

Functions

int ListOf_append (ListOf_t *lo, const SBase *item)
 Adds a copy of item to the end of this ListOf items.
int ListOf_appendAndOwn (ListOf_t *lo, SBase_t *item)
 Adds the given item to the end of this ListOf items.
int ListOf_appendFrom (ListOf_t *lo, ListOf_t *list)
 Adds clones of the given items from the second list to the end of this ListOf items.
void ListOf_clear (ListOf_t *lo, int doDelete)
 Removes all items in this ListOf object.
ListOf_t * ListOf_clone (const ListOf_t *lo)
ListOf_t * ListOf_create (unsigned int level, unsigned int version)
 Creates a new ListOf.
void ListOf_free (ListOf_t *lo)
 Frees the given ListOf and its constituent items.
SBase * ListOf_get (ListOf_t *lo, unsigned int n)
 Returns the nth item in this ListOf items.
int ListOf_getItemTypeCode (const ListOf_t *lo)
int ListOf_insert (ListOf_t *lo, int location, const SBase_t *item)
 inserts a copy of item to this ListOf items at the given position.
int ListOf_insertAndOwn (ListOf_t *lo, int location, SBase_t *item)
 inserts the item to this ListOf items at the given position.
SBase * ListOf_remove (ListOf_t *lo, unsigned int n)
 Removes the nth item from this ListOf items and returns a pointer to it.
unsigned int ListOf_size (const ListOf_t *lo)
 Returns the number of items in this ListOf items.

Function Documentation

int ListOf_append ( ListOf_t *  lo,
const SBase *  item 
)

Adds a copy of item to the end of this ListOf items.

int ListOf_appendAndOwn ( ListOf_t *  lo,
SBase_t *  item 
)

Adds the given item to the end of this ListOf items.

int ListOf_appendFrom ( ListOf_t *  lo,
ListOf_t *  list 
)

Adds clones of the given items from the second list to the end of this ListOf items.

void ListOf_clear ( ListOf_t *  lo,
int  doDelete 
)

Removes all items in this ListOf object.

If doDelete is true (non-zero), all items in this ListOf object are deleted and cleared, and thus the caller doesn't have to delete those items. Otherwise (zero), all items are just cleared from this ListOf object and the caller is responsible for deleting all items (In this case, pointers to all items should be stored elsewhere before calling this function by the caller).

ListOf_t* ListOf_clone ( const ListOf_t *  lo)
Returns:
a (deep) copy of this ListOf items.
ListOf_t* ListOf_create ( unsigned int  level,
unsigned int  version 
)

Creates a new ListOf.

Returns:
a pointer to created ListOf.
void ListOf_free ( ListOf_t *  lo)

Frees the given ListOf and its constituent items.

This function assumes each item in the list is derived from SBase.

SBase* ListOf_get ( ListOf_t *  lo,
unsigned int  n 
)

Returns the nth item in this ListOf items.

int ListOf_getItemTypeCode ( const ListOf_t *  lo)
Returns:
the typecode (int) of this SBML object or SBML_UNKNOWN SBML_UNKNOWN (default).
int ListOf_insert ( ListOf_t *  lo,
int  location,
const SBase_t *  item 
)

inserts a copy of item to this ListOf items at the given position.

int ListOf_insertAndOwn ( ListOf_t *  lo,
int  location,
SBase_t *  item 
)

inserts the item to this ListOf items at the given position.

SBase* ListOf_remove ( ListOf_t *  lo,
unsigned int  n 
)

Removes the nth item from this ListOf items and returns a pointer to it.

The caller owns the returned item and is responsible for deleting it.

unsigned int ListOf_size ( const ListOf_t *  lo)

Returns the number of items in this ListOf items.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines