Event.h File Reference

Detailed Description

Definitions of Event and ListOfEvents.

Author:
Ben Bornstein
Include dependency graph for Event.h:
This graph shows which files directly or indirectly include this file:

Functions

int Event_addEventAssignment (Event_t *e, const EventAssignment_t *ea)
 Appends a copy of the given EventAssignment_t structure to this Event_t structure.
Event_t * Event_clone (const Event_t *e)
 Returns a copy of the given Event_t structure.
Event_t * Event_create (unsigned int level, unsigned int version)
 Creates a new Event_t structure using the given SBML level and version values.
Delay_t * Event_createDelay (Event_t *e)
 Creates a new, empty Delay_t structure, adds it to this Event, and returns the Delay_t.
EventAssignment_t * Event_createEventAssignment (Event_t *e)
 Creates a new, empty EventAssignment_t structure, adds it to this Event's list of event assignments, and returns the EventAssignment_t.
Priority_t * Event_createPriority (Event_t *e)
 Creates a new, empty Priority_t structure, adds it to this Event, and returns the Priority_t.
Trigger_t * Event_createTrigger (Event_t *e)
 Creates a new, empty Trigger_t structure, adds it to this Event, and returns the Trigger_t.
Event_t * Event_createWithNS (SBMLNamespaces_t *sbmlns)
 Creates a new Event_t structure using the given SBMLNamespaces_t structure.
void Event_free (Event_t *e)
 Frees the given Event_t structure.
Delay_t * Event_getDelay (Event_t *e)
 Takes an Event_t structure and returns its Delay_t structure.
EventAssignment_t * Event_getEventAssignment (Event_t *e, unsigned int n)
 Return a specific EventAssignment_t structure of this Event_t.
EventAssignment_t * Event_getEventAssignmentByVar (Event_t *e, const char *variable)
 Return the event assignment indicated by the given variable.
const char * Event_getId (const Event_t *e)
 Takes an Event_t structure and returns its identifier.
ListOf_t * Event_getListOfEventAssignments (Event_t *e)
 Get the list of EventAssignment_t structures from this Event_t structure.
const char * Event_getName (const Event_t *e)
 Takes a Event_t structure and returns its name.
const XMLNamespaces_t * Event_getNamespaces (Event_t *c)
 Returns a list of XMLNamespaces_t associated with this Event_t structure.
unsigned int Event_getNumEventAssignments (const Event_t *e)
 Returns the number of EventAssignment_t objects attached to this Event.
Priority_t * Event_getPriority (Event_t *e)
 Takes an Event_t structure and returns its Priority_t structure.
const char * Event_getTimeUnits (const Event_t *e)
 Takes an Event_t structure and returns the value of its "timeUnits" attribute.
Trigger_t * Event_getTrigger (Event_t *e)
 Takes an Event_t structure and returns its Trigger_t structure.
int Event_getUseValuesFromTriggerTime (const Event_t *e)
 Takes an Event_t structure and returns the value of its "useValuesFromTriggerTime" attribute.
int Event_hasRequiredAttributes (Event_t *e)
 Predicate returning true or false depending on whether all the required attributes for this Event object have been set.
int Event_hasRequiredElements (Event_t *e)
 Predicate returning true or false depending on whether all the required elements for this Event object have been set.
int Event_isSetDelay (const Event_t *e)
 Predicate returning true or false depending on whether the given Event_t structure's delay is set.
int Event_isSetId (const Event_t *e)
 Predicate returning true or false depending on whether the given Event_t structure's identifier is set.
int Event_isSetName (const Event_t *e)
 Predicate returning true or false depending on whether the given Event_t structure's name is set.
int Event_isSetPriority (const Event_t *e)
 Predicate returning true or false depending on whether the given Event_t structure's priority is set.
int Event_isSetTimeUnits (const Event_t *e)
 Predicate returning true or false depending on whether the given Event_t structure's "timeUnits" attribute is set.
int Event_isSetTrigger (const Event_t *e)
 Predicate returning true or false depending on whether the given Event_t structure's trigger is set.
int Event_isSetUseValuesFromTriggerTime (const Event_t *e)
 Predicate returning true or false depending on whether the given Event_t structure's useValuesFromTriggerTime attribute is set.
EventAssignment_t * Event_removeEventAssignment (Event_t *e, unsigned int n)
 Removes the nth EventAssignment_t object from this Event_t object and returns a pointer to it.
EventAssignment_t * Event_removeEventAssignmentByVar (Event_t *e, const char *variable)
 Removes the EventAssignment_t object with the given "variable" attribute from this Event_t object and returns a pointer to it.
int Event_setDelay (Event_t *e, const Delay_t *delay)
 Sets the delay of this Event to a copy of the given Delay.
int Event_setId (Event_t *e, const char *sid)
 Assigns the identifier of an Event_t structure.
int Event_setName (Event_t *e, const char *name)
 Sets the name of this Event to a copy of name.
int Event_setPriority (Event_t *e, const Priority_t *priority)
 Sets the priority of this Event to a copy of the given Priority.
int Event_setTimeUnits (Event_t *e, const char *sid)
 Sets the "timeUnits" attribute of this Event to a copy of sid.
int Event_setTrigger (Event_t *e, const Trigger_t *trigger)
 Sets the trigger of this Event to a copy of the given Trigger.
int Event_setUseValuesFromTriggerTime (Event_t *e, int value)
 Sets the "useValuesFromTriggerTime" attribute of this Event to a value.
int Event_unsetDelay (Event_t *e)
 Unsets the delay of this Event.
int Event_unsetId (Event_t *e)
 Unsets the "id" attribute of this Event_t structure.
int Event_unsetName (Event_t *e)
 Unsets the "name" attribute of this Event_t structure.
int Event_unsetPriority (Event_t *e)
 Unsets the priority of this Event.
int Event_unsetTimeUnits (Event_t *e)
 Unsets the "timeUnits" attribute of this Event.
Event_t * ListOfEvents_getById (ListOf_t *lo, const char *sid)
Event_t * ListOfEvents_removeById (ListOf_t *lo, const char *sid)
 Removes item in this ListOf items with the given id or NULL if no such item exists.

Function Documentation

int Event_addEventAssignment ( Event_t *  e,
const EventAssignment_t *  ea 
)

Appends a copy of the given EventAssignment_t structure to this Event_t structure.

Parameters:
ethe Event_t structure to which the event assignment should be added
eaan EventAssignment_t structure to add
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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_LEVEL_MISMATCH
  • LIBSBML_VERSION_MISMATCH
  • LIBSBML_DUPLICATE_OBJECT_ID
  • LIBSBML_OPERATION_FAILED
Event_t* Event_clone ( const Event_t *  e)

Returns a copy of the given Event_t structure.

Parameters:
ethe Event_t structure to copy.
Returns:
a (deep) copy of the Event_t.
Event_t* Event_create ( unsigned int  level,
unsigned int  version 
)

Creates a new Event_t structure using the given SBML level and version values.

Parameters:
levelan unsigned int, the SBML Level to assign to this Event
versionan unsigned int, the SBML Version to assign to this Event
Returns:
a pointer to the newly created Event_t structure.
Note:
Once a Event has been added to an SBMLDocument, the level and version for the document override those used to create the Event. Despite this, the ability to supply the values at creation time is an important aid to creating valid SBML. Knowledge of the intended SBML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing SBMLDocument.
Delay_t* Event_createDelay ( Event_t *  e)

Creates a new, empty Delay_t structure, adds it to this Event, and returns the Delay_t.

Parameters:
ethe Event_t structure to which the delay should be added
EventAssignment_t* Event_createEventAssignment ( Event_t *  e)

Creates a new, empty EventAssignment_t structure, adds it to this Event's list of event assignments, and returns the EventAssignment_t.

Parameters:
ethe Event_t structure to which the event assignment should be added
Priority_t* Event_createPriority ( Event_t *  e)

Creates a new, empty Priority_t structure, adds it to this Event, and returns the Priority_t.

Parameters:
ethe Event_t structure to which the priority should be added
Trigger_t* Event_createTrigger ( Event_t *  e)

Creates a new, empty Trigger_t structure, adds it to this Event, and returns the Trigger_t.

Parameters:
ethe Event_t structure to which the trigger should be added
Event_t* Event_createWithNS ( SBMLNamespaces_t *  sbmlns)

Creates a new Event_t structure using the given SBMLNamespaces_t structure.

Parameters:
sbmlnsSBMLNamespaces, a pointer to an SBMLNamespaces structure to assign to this Event
Returns:
a pointer to the newly created Event_t structure.
Note:
Once a Event has been added to an SBMLDocument, the sbmlns namespaces for the document override those used to create the Event. Despite this, the ability to supply the values at creation time is an important aid to creating valid SBML. Knowledge of the intended SBML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing SBMLDocument.
void Event_free ( Event_t *  e)

Frees the given Event_t structure.

Parameters:
ethe Event_t structure to free.
Delay_t* Event_getDelay ( Event_t *  e)

Takes an Event_t structure and returns its Delay_t structure.

Parameters:
ethe Event_t structure whose delay definition is sought.
Returns:
the Delay_t of this Event.
EventAssignment_t* Event_getEventAssignment ( Event_t *  e,
unsigned int  n 
)

Return a specific EventAssignment_t structure of this Event_t.

Parameters:
ethe Event_t structure to use
nan integer, the index of the EventAssignment_t structure to return
Returns:
the nth EventAssignment_t of this Event.
EventAssignment_t* Event_getEventAssignmentByVar ( Event_t *  e,
const char *  variable 
)

Return the event assignment indicated by the given variable.

Parameters:
ethe Event_t structure to use
variablea string, the identifier of the variable whose EventAssignment_t is being sought.
Returns:
the EventAssignment_t for the given variable, or NULL if no such EventAssignment_t exits.
const char* Event_getId ( const Event_t *  e)

Takes an Event_t structure and returns its identifier.

Parameters:
pthe Event_t structure whose identifier is sought
Returns:
the identifier of this Event_t, as a pointer to a string.
ListOf_t* Event_getListOfEventAssignments ( Event_t *  e)

Get the list of EventAssignment_t structures from this Event_t structure.

Parameters:
ethe Event_t structure to use.
Returns:
the list of EventAssignments for this Event.
const char* Event_getName ( const Event_t *  e)

Takes a Event_t structure and returns its name.

Parameters:
pthe Event_t whose name is sought.
Returns:
the name of this Event_t, as a pointer to a string.
const XMLNamespaces_t* Event_getNamespaces ( Event_t *  e)

Returns a list of XMLNamespaces_t associated with this Event_t structure.

Parameters:
ethe Event_t structure
Returns:
pointer to the XMLNamespaces_t structure associated with this SBML object
unsigned int Event_getNumEventAssignments ( const Event_t *  e)

Returns the number of EventAssignment_t objects attached to this Event.

Parameters:
ethe Event_t structure to use
Returns:
the number of EventAssignment_t structures in this Event.
Priority_t* Event_getPriority ( Event_t *  e)

Takes an Event_t structure and returns its Priority_t structure.

Parameters:
ethe Event_t structure whose delay definition is sought.
Returns:
the Priority_t of this Event.
const char* Event_getTimeUnits ( const Event_t *  e)

Takes an Event_t structure and returns the value of its "timeUnits" attribute.

Parameters:
ethe Event_t structure whose "timeUnits" value is sought
Returns:
the timeUnits of this Event
Warning:
Definitions of Event in SBML Level 2 Versions 1 and 2 included the additional attribute called "timeUnits", but it was removed in SBML Level 2 Version 3. LibSBML supports this attribute for compatibility with previous versions of SBML Level 2, but its use is discouraged since models in Level 2 Versions 3 and 4 cannot contain it.
Trigger_t* Event_getTrigger ( Event_t *  e)

Takes an Event_t structure and returns its Trigger_t structure.

Parameters:
ethe Event_t structure whose trigger definition is sought.
Returns:
the Trigger_t of this Event.
int Event_getUseValuesFromTriggerTime ( const Event_t *  e)

Takes an Event_t structure and returns the value of its "useValuesFromTriggerTime" attribute.

Parameters:
ethe Event_t structure whose "useValuesFromTriggerTime" value is sought
Returns:
the useValuesFromTriggerTime of this Event
int Event_hasRequiredAttributes ( Event_t *  e)

Predicate returning true or false depending on whether all the required attributes for this Event object have been set.

Note:
The required attributes for a Event object are:
  • useValuesfromTriggerTime ( L3 onwards )
int Event_hasRequiredElements ( Event_t *  e)

Predicate returning true or false depending on whether all the required elements for this Event object have been set.

Note:
The required elements for a Event object are:
  • trigger
  • listOfEventAssignments (requirement removed in L3)
int Event_isSetDelay ( const Event_t *  e)

Predicate returning true or false depending on whether the given Event_t structure's delay is set.

Parameters:
ethe Event_t structure to query
Returns:
non-zero (true) if a Delay_t structure is assigned to the given Event_t structure, zero (false) otherwise.
int Event_isSetId ( const Event_t *  e)

Predicate returning true or false depending on whether the given Event_t structure's identifier is set.

Parameters:
ethe Event_t structure to query
Returns:
non-zero (true) if the "id" attribute of the given Event_t structure is set, zero (false) otherwise.
int Event_isSetName ( const Event_t *  e)

Predicate returning true or false depending on whether the given Event_t structure's name is set.

Parameters:
ethe Event_t structure to query
Returns:
non-zero (true) if the "name" attribute of the given Event_t structure is set, zero (false) otherwise.
int Event_isSetPriority ( const Event_t *  e)

Predicate returning true or false depending on whether the given Event_t structure's priority is set.

Parameters:
ethe Event_t structure to query
Returns:
non-zero (true) if a Priority_t structure is assigned to the given Event_t structure, zero (false) otherwise.
int Event_isSetTimeUnits ( const Event_t *  e)

Predicate returning true or false depending on whether the given Event_t structure's "timeUnits" attribute is set.

Parameters:
ethe Event_t structure to query
Returns:
non-zero (true) if a value for the "timeUnits" attribute is assigned in the given Event_t structure, zero (false) otherwise.
Warning:
Definitions of Event in SBML Level 2 Versions 1 and 2 included the additional attribute called "timeUnits", but it was removed in SBML Level 2 Version 3. LibSBML supports this attribute for compatibility with previous versions of SBML Level 2, but its use is discouraged since models in Level 2 Versions 3 and 4 cannot contain it.
int Event_isSetTrigger ( const Event_t *  e)

Predicate returning true or false depending on whether the given Event_t structure's trigger is set.

Parameters:
ethe Event_t structure to query
Returns:
non-zero (true) if a Trigger_t structure is assigned to the given Event_t structure, zero (false) otherwise.
int Event_isSetUseValuesFromTriggerTime ( const Event_t *  e)

Predicate returning true or false depending on whether the given Event_t structure's useValuesFromTriggerTime attribute is set.

Parameters:
ethe Event_t structure to query
Returns:
non-zero (true) if the "useValuesFromTriggerTime" attribute of the given Event_t structure is set, zero (false) otherwise.
EventAssignment_t* Event_removeEventAssignment ( Event_t *  e,
unsigned int  n 
)

Removes the nth EventAssignment_t object from this Event_t object and returns a pointer to it.

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

Parameters:
mthe Event_t structure
nthe integer index of the EventAssignment_t sought
Returns:
the EventAssignment_t object removed. As mentioned above, the caller owns the returned item. NULL is returned if the given index is out of range.
EventAssignment_t* Event_removeEventAssignmentByVar ( Event_t *  e,
const char *  variable 
)

Removes the EventAssignment_t object with the given "variable" attribute from this Event_t object and returns a pointer to it.

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

Parameters:
mthe Event_t structure
sidthe string of the "variable" attribute of the EventAssignment_t sought
Returns:
the EventAssignment_t object removed. As mentioned above, the caller owns the returned object. NULL is returned if no EventAssignment_t object with the "variable" attribute exists in this Event_t object.
int Event_setDelay ( Event_t *  e,
const Delay_t *  delay 
)

Sets the delay of this Event to a copy of the given Delay.

Parameters:
ethe Event_t structure to set
delaythe Delay_t structure to use.
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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_LEVEL_MISMATCH
  • LIBSBML_VERSION_MISMATCH
int Event_setId ( Event_t *  e,
const char *  sid 
)

Assigns the identifier of an Event_t structure.

This makes a copy of the string passed in the param sid.

Parameters:
ethe Event_t structure to set.
sidthe string to use as the identifier.
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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_ATTRIBUTE_VALUE
Note:
Using this function with an id of NULL is equivalent to unsetting the "id" attribute.
int Event_setName ( Event_t *  e,
const char *  name 
)

Sets the name of this Event to a copy of name.

Parameters:
ethe Event_t structure to set
namethe name to assign to this Event_t's "name" attribute.
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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_ATTRIBUTE_VALUE
Note:
Using this function with the name set to NULL is equivalent to unsetting the "name" attribute.
int Event_setPriority ( Event_t *  e,
const Priority_t *  priority 
)

Sets the priority of this Event to a copy of the given Priority.

Parameters:
ethe Event_t structure to set
prioritythe Priority_t structure to use.
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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_LEVEL_MISMATCH
  • LIBSBML_VERSION_MISMATCH
  • LIBSBML_UNEXPECTED_ATTRIBUTE
int Event_setTimeUnits ( Event_t *  e,
const char *  sid 
)

Sets the "timeUnits" attribute of this Event to a copy of sid.

Parameters:
ethe Event_t structure to set
sidthe identifier of the units to use as the value of the "timeUnits" attribute
Warning:
Definitions of Event in SBML Level 2 Versions 1 and 2 included the additional attribute called "timeUnits", but it was removed in SBML Level 2 Version 3. LibSBML supports this attribute for compatibility with previous versions of SBML Level 2, but its use is discouraged since models in Level 2 Versions 3 and 4 cannot contain it.
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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_ATTRIBUTE_VALUE
  • LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
Using this function with an id of NULL is equivalent to unsetting the "timeUnits" attribute.
int Event_setTrigger ( Event_t *  e,
const Trigger_t *  trigger 
)

Sets the trigger of this Event to a copy of the given Trigger.

Parameters:
ethe Event_t structure to set
triggerthe Trigger_t structure to use.
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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_LEVEL_MISMATCH
  • LIBSBML_VERSION_MISMATCH
int Event_setUseValuesFromTriggerTime ( Event_t *  e,
int  value 
)

Sets the "useValuesFromTriggerTime" attribute of this Event to a value.

Parameters:
ethe Event_t structure to set
valuethe value of the "useValuesFromTriggerTime" attribute
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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_UNEXPECTED_ATTRIBUTE
int Event_unsetDelay ( Event_t *  e)

Unsets the delay of this Event.

Parameters:
ethe Event_t structure to unset
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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
int Event_unsetId ( Event_t *  e)

Unsets the "id" attribute of this Event_t structure.

Parameters:
ethe Event_t structure to unset
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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
int Event_unsetName ( Event_t *  e)

Unsets the "name" attribute of this Event_t structure.

Parameters:
ethe Event_t structure to unset
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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
int Event_unsetPriority ( Event_t *  e)

Unsets the priority of this Event.

Parameters:
ethe Event_t structure to unset
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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
int Event_unsetTimeUnits ( Event_t *  e)

Unsets the "timeUnits" attribute of this Event.

Parameters:
ethe Event_t structure to unset
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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
Warning:
Definitions of Event in SBML Level 2 Versions 1 and 2 included the additional attribute called "timeUnits", but it was removed in SBML Level 2 Version 3. LibSBML supports this attribute for compatibility with previous versions of SBML Level 2, but its use is discouraged since models in Level 2 Versions 3 and 4 cannot contain it.
Event_t* ListOfEvents_getById ( ListOf_t *  lo,
const char *  sid 
)
Returns:
item in this ListOfEvent with the given id or NULL if no such item exists.
Event_t* ListOfEvents_removeById ( ListOf_t *  lo,
const char *  sid 
)

Removes item in this ListOf items with the given id or NULL if no such item exists.

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

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines