CellML API
cellml_context::ModelNode Interface Reference
This represents a node in the tree containing all models available to the user interface. More...


Public Member Functions | |
ModelNode | getLatestDerivative () |
Returns the node in the derivative tree which is the latest (i.e. | |
ModelNode | getWritable () |
Gets a model node which is writable. | |
void | stampModifiedNow () |
Sets the last modified stamp to now. | |
void | flushChanges () |
Requests that any tools / controls which have changes that they have not saved cached somewhere flush their changes back to the model. | |
void | addModelMonitor (in ModelNodeMonitor monitor) |
Adds a model monitor. | |
void | removeModelMonitor (in ModelNodeMonitor monitor) |
Removes a model monitor. | |
![]() | |
void | add_ref () |
Called to indicate that some code is keeping an owning reference to the object. | |
oneway void | release_ref () |
Removes a reference to an object which was created by some other means (e.g. | |
IObject | query_interface (in utf8string id) |
Returns an IObject of the same implementation, which supports a specific interface. |
Public Attributes | |
attribute wstring | name |
The name of the model, according to the user. | |
attribute boolean | isFrozen |
If the model is frozen, the user should be prevented from making changes to it, because it will not make semantic sense. | |
readonly attribute unsigned long | modificationTimestamp |
A timestamp representing when stampModifiedNow was last called. | |
attribute cellml_api::Model | model |
The model this node points to... | |
attribute XPCOM::IObject | owner |
Describes the 'owner' tool / control of the current model object. | |
readonly attribute ModelList | derivedModels |
The list of all derived models... | |
readonly attribute ModelList | parentList |
Fetches the model list this node belongs to, or null if this node has no parent. | |
attribute boolean | dirty |
Determines if the model is 'dirty'. | |
![]() | |
readonly attribute string | objid |
Fetches the ID of the object. |
Detailed Description
This represents a node in the tree containing all models available to the user interface.
Definition at line 295 of file CellML_Context.idl.
Member Function Documentation
void cellml_context::ModelNode::addModelMonitor | ( | in ModelNodeMonitor | monitor | ) |
Adds a model monitor.
This will receive notifications for all models in the list, and all more derived models.
- Parameters
-
monitor The model monitor to add.
void cellml_context::ModelNode::flushChanges | ( | ) |
Requests that any tools / controls which have changes that they have not saved cached somewhere flush their changes back to the model.
Any tool or control except for the node owner should always call this before making changes to the model, because otherwise there might be conflicting changes made by different tools.
ModelNode cellml_context::ModelNode::getLatestDerivative | ( | ) |
Returns the node in the derivative tree which is the latest (i.e.
greatest modificationTimestamp). This can return itself if it is the latest model(this will only happen under the normal usage convention if there are no derivatives).
ModelNode cellml_context::ModelNode::getWritable | ( | ) |
Gets a model node which is writable.
If this node is not frozen, will return itself. Otherwise, the model is cloned, and a new node pointing to the cloned is inserted into this node, and the new node returned.
void cellml_context::ModelNode::removeModelMonitor | ( | in ModelNodeMonitor | monitor | ) |
Removes a model monitor.
- Parameters
-
monitor The model node monitor to remove.
void cellml_context::ModelNode::stampModifiedNow | ( | ) |
Sets the last modified stamp to now.
Member Data Documentation
readonly attribute ModelList cellml_context::ModelNode::derivedModels |
The list of all derived models...
Definition at line 367 of file CellML_Context.idl.
attribute boolean cellml_context::ModelNode::dirty |
Determines if the model is 'dirty'.
Models are initially not dirty, but if any changes are made to the model, they become dirty. The dirty flag can also be manually set or cleared. This flag is used to indicate if the model has unsaved changes.
Definition at line 394 of file CellML_Context.idl.
attribute boolean cellml_context::ModelNode::isFrozen |
If the model is frozen, the user should be prevented from making changes to it, because it will not make semantic sense.
Individual tools need to enforce the frozen model restrictions themselves.
Definition at line 322 of file CellML_Context.idl.
attribute cellml_api::Model cellml_context::ModelNode::model |
The model this node points to...
Definition at line 338 of file CellML_Context.idl.
readonly attribute unsigned long cellml_context::ModelNode::modificationTimestamp |
A timestamp representing when stampModifiedNow was last called.
Equal to 0 if stampModifiedNow() never called.
Definition at line 328 of file CellML_Context.idl.
attribute wstring cellml_context::ModelNode::name |
The name of the model, according to the user.
Definition at line 300 of file CellML_Context.idl.
attribute XPCOM::IObject cellml_context::ModelNode::owner |
Describes the 'owner' tool / control of the current model object.
The owner is allowed to cache changes to the model node and only flush them later when required (although it is of course preferrable that where possible changes are made immediately so views will not be stale). Owners should always monitor the node and look for ownerChanged notifications so they can flush any changes and stop acting as the owner at the appropriate point in time.
May be set to null to clear the owner. There is no strong reference to owners held, so owners must clear their ownership by setting this to null before being destroyed.
Definition at line 362 of file CellML_Context.idl.
readonly attribute ModelList cellml_context::ModelNode::parentList |
Fetches the model list this node belongs to, or null if this node has no parent.
Definition at line 386 of file CellML_Context.idl.