Share

AcDbAssocDimDependencyBody Class

Class Hierarchy

AcRxObject
    AcGiDrawable
        AcDbObject
            AcDbAssocDependencyBody
                AcDbAssocDimDependencyBodyBase
                    AcDbAssocDimDependencyBody

C++

class AcDbAssocDimDependencyBody : public AcDbAssocDimDependencyBodyBase;

File

AcDbAssocDimDependencyBody.h

Description

Abstract base class for deriving custom dependency body classes that implement functionality of custom dependencies.

An object of a class derived from the AcDbAssocDependencyBody class is always owned by a parent AcDbAssocDependency object. The AssocDependency object has an AcDbHardOwnershipId on it, and the AcDbAssocDependencyBody::ownerId() of the object returns the AcDbObjectId of its parent AcDbAssocDependency object.

Therefore a custom dependency object (in the logical sense of the word "object") is always represented by a pair of physical AcDbObjects:

The parent dependency object of the AcDbAssocDependency class (or possibly, but less commonly, of a derived class).

The dependency body object of a custom class derived from the AcDbAssocDependencyBody abstract base class.

This factoring out of the functionality of the custom dependencies into separate classes derived from the AcDbAssocDependencyBody class, instead of deriving the custom dependency classes directly from the AcDbAssocDependency class, allows better handling of the situations when the application code that implements the custom dependency behavior is not available. Only the custom object of the AcDbAssocDependencyBody-derived class will become a proxy, but its parent AcDbAssocDependency object will always be available and the associative mechanism can still function to some extent.

The abstract AcDbAssocDependencyBody base class defines a set of virtual methods named xxxxxxOverride() that correspond to methods named xxxxxx() in the parent AcDbAssocDependency class. When a method xxxxxx() is called on the parent dependency object and the dependency object owns an dependency body object, the corresponding xxxxxxOverride() method on the dependency body object is called and it either supersedes or amends the default xxxxxx() implementation, depending on the particular method.

If the dependency object does not own an dependency body object or if the dependency body object does not override the xxxxxxOverride() method, the default implementation in the parent dependency object is performed. Also, when the custom dependency body object becomes a proxy because its application code is not available, the parent dependency method just performs its default implementation.

Custom dependency body classes derived from the AcDbAssocDependencyBody class implement their behavior by overriding the appropriate xxxxxxOverride() methods. Only the evaluateOverride() method must always be overridden in the custom classes. If not overridden, the other xxxxxxOverride() methods will do nothing and the default implementation in the parent AcDbAssocDependency object will be performed. This may be the appropriate behavior in most cases.

Because each AcDbAssocDependencyBody object is owned by its parent AcDbAssocDependency object, erasing the parent AcDbAssocDependency object also erases the owned AcDbAssocDependencyBody object. There is no need to erase AcDbAssocDependencyBody objects explicitly.

Links

AcDbAssocDimDependencyBody Methods

Was this information helpful?