Top |
NcmModelCtrl * | ncm_model_ctrl_new () |
void | ncm_model_ctrl_free () |
void | ncm_model_ctrl_clear () |
gboolean | ncm_model_ctrl_set_model () |
void | ncm_model_ctrl_force_update () |
NcmModel * | ncm_model_ctrl_get_model () |
gboolean | ncm_model_ctrl_update () |
gboolean | ncm_model_ctrl_model_update () |
gboolean | ncm_model_ctrl_model_last_update () |
gboolean | ncm_model_ctrl_model_has_submodel () |
gboolean | ncm_model_ctrl_submodel_last_update () |
This object is employed to manage the status of a NcmModel. It serves the purpose
of checking whether the model has been updated since the last call to
ncm_model_ctrl_update()
. Calculation objects dependent on the model can utilize
this object to determine if updates are necessary.
NcmModelCtrl *
ncm_model_ctrl_new (NcmModel *model
);
Creates a new NcmModelCtrl object.
void
ncm_model_ctrl_free (NcmModelCtrl *ctrl
);
Decreases the reference count of ctrl
. If the reference count
reaches zero, ctrl
is freed.
void
ncm_model_ctrl_clear (NcmModelCtrl **ctrl
);
Checks if *ctrl
is not NULL
, and if so, decreases the reference count
of ctrl
. If the reference count reaches zero, ctrl
is freed. The
pointer to ctrl
is set to NULL
.
gboolean ncm_model_ctrl_set_model (NcmModelCtrl *ctrl
,NcmModel *model
);
Sets the model inside ctrl
to model
.
void
ncm_model_ctrl_force_update (NcmModelCtrl *ctrl
);
Forces an update on ctrl
. In practice, this function clears the
model inside ctrl
and all submodels.
NcmModel *
ncm_model_ctrl_get_model (NcmModelCtrl *ctrl
);
Gets the current model inside ctrl
.
gboolean ncm_model_ctrl_update (NcmModelCtrl *ctrl
,NcmModel *model
);
Compares the model inside ctrl
with model
and updates the status of
ctrl
. If the model inside ctrl
differs from model
, ctrl
is
updated, and TRUE is returned. Otherwise, FALSE is returned.
If the model is the same but the model's pkey is different, ctrl
is
updated, and TRUE is returned. Otherwise, FALSE is returned.
Submodels inside model
are also analyzed similarly, and ctrl
is
updated if necessary. If any submodel is updated, TRUE is returned.
Otherwise, FALSE is returned.
gboolean ncm_model_ctrl_model_update (NcmModelCtrl *ctrl
,NcmModel *model
);
Same as ncm_model_ctrl_update()
, but only checks if the model objects
are the same. The pkey is not checked.
gboolean
ncm_model_ctrl_model_last_update (NcmModelCtrl *ctrl
);
Checks if the main model was updated during the last call to
ncm_model_ctrl_update()
.
gboolean ncm_model_ctrl_model_has_submodel (NcmModelCtrl *ctrl
,NcmModelID mid
);
Checks if there is a submode inside ctrl model, it is an
error to call this function in an empty ctrl
.
gboolean ncm_model_ctrl_submodel_last_update (NcmModelCtrl *ctrl
,NcmModelID mid
);
Checks if the submodel mid
was updated during the last call to
ncm_model_ctrl_update()
.