Share

AcDbObject::subClose

C++

Acad::ErrorStatus subClose() override;

Description

Called from within close() before anything else is done. The default implementation is to return Acad::eOk. However, when overridden in custom classes, it provides a hook into the close operation. If it returns anything other than Acad::eOk, then the close operation is immediately terminated.

When overriding this function, a sequence of steps is required:

  1. Check to be sure everything is correct with the AcDbObject's state. If not, then immediately return a value other than Acad::eOk, which terminates the close operation.
  2. Call the parent class's subClose(). If this returns Acad::eOk, then continue; otherwise immediately return whatever the parent class's subClose() returned.
  3. Do any operations desired before the close operation continues.
  4. Return Acad::eOk to allow the close operation to continue normally.
Note

When implementing your own subClose(), it is best not to change any of the object's state at all. But, if you must, then it is best to make such changes after invoking the parent class's subClose(), just in case it returns an error code other than Acad::eOk. If you must change state before invoking the parent class's subClose(), then be prepared to reverse the changes if the parent class returns a status other than Acad::eOk.

Links

AcDbRasterImageDef

Was this information helpful?