All Frameworks Class Hierarchy This Framework Previous Next Indexes
ObjectSpecsModeler Class CATOsmUpdateAdapter
System.IUnknown
|
+---System.IDispatch
|
+---System.CATBaseUnknown
|
+---ObjectSpecsModeler.CATIOsmUpdate
|
+---CATOsmUpdateAdapter
Usage: you can derive this class.
public class CATOsmUpdateAdapter
Adapter class for the
CATIOsmUpdate interface.
Role:
This is the base class from which you should derive if you have to
- overload the standard update mechanism, by redefining the Update
and possibly the IsUpToDate and SetUpToDate methods
- allow your object to be ignored by the update mechanism
by implementing the IsInactive method.
It is strongly advised not to implement this interface on features
that derive from startups defined by Dassault Systemes because the
update behaviour of these features is often specialised.
Method Index
- o
IsInactive()
- Indicates whether the object must be ignored by the update mechanism.
- o
IsUpToDate()
- Returns the status of the object concerning the update mechanism.
- o
SetUpToDate(CATBoolean)
- Modifies the object update status.
- o
Update()
- Rebuilds the feature.
Methods
o IsInactive
public virtual HRESULT IsInactive( | )const |
-
Indicates whether the object must be ignored by the update mechanism.
Role:
If you want to allow inactivation of your
object, you must store that information somehow and implement this
method to return S_OK when inactivated. Inactivated objects no
longer update themselves even if they are inputs of other objects.
Thus, inactive objects will never be called on
CATIBuild.Build . Note: This method returns S_FALSE.
- Returns:
- S_OK if the object is to be ignored by the update mechanism, S_FALSE otherwise.
o IsUpToDate
public virtual HRESULT IsUpToDate( | )const |
-
Returns the status of the object concerning the update mechanism.
If you overload this method and when you want to return S_FALSE, in
addition to your own computation, you must also call
SetUpToDate (FALSE).
If you don't want to force the S_FALSE result, you must call
CATOsmUpdateAdapter.IsUpToDate in order for other dependencies to be checked properly. This method will check that all inputs are
up to date and that this feature has been updated after the update of
its inouts.
For example:
Example::IsUpToDate()
{
if (something())
{
SetUpToDate(FALSE);
return S_FALSE;
}
return CATOsmUpdateAdapter::IsUpToDate();
}
Make sure your IsUpToDate implementation is consistent with
Update .
- Returns:
-
- S_OK: the object has been updated.
- S_FALSE : the object has to be updated.
o SetUpToDate
-
Modifies the object update status.
Role:
This method changes the up to date status of the object. It is
called every time the object's status changes. The status may change
either because an input of the object changes, or because the object
is updated (or someone directly calls
CATISpecObject.SetUpToDate ).
You must always call
CATOsmUpdateAdapter.SetUpToDate if you overload this method.
- Parameters:
-
- iflag
- The new status.
- TRUE : the object has just been updated.
- FALSE: the object needs to be rebuild.
o Update
-
Rebuilds the feature.
Role:
This method will be called internally by
CATISpecObject.Update if the startup implements CATIOsmUpdate. It allows the default
method mechanism to be overriden.
This method can throw exceptions.
You must always call
CATOsmUpdateAdapter.Update inside your implementation if you overload this method, except when you know
the update will fail in which case you may return E_FAIL before calling
it. Doing this will allow the standard update mechanism to kick in: This
method detects all features that have been modified upstream from a
feature, rebuilds all the feature impacting the updated feature, and finally rebuilds
the final feature thanks to the
CATIBuild interface.
Make sure your Update implementation is consistent with
IsUpToDate .
- Returns:
- S_OK if update succeeded, E_FAIL otherwise (the update process is then aborted).
This object is included in the file: CATOsmUpdateAdapter.h
If needed, your Imakefile.mk should include the module: CATObjectSpecsModeler