Creating a proxy or cache for API_Attributes was necessary due to different reasons:
- If the attributes are output (or accessed) inline during element output then querying the same attribute through the API quite possibly many times would introduce a big overhead.
- If the attributes are output (or accessed) after the element output then we need to know at least which attributes were used in the API_Elements or API_PrimElements.
- Some attributes (namely the attributes stored inside a drawing) are only accessible during the primitive decomposition (inside the ShapePrimsProc () call), so to access these later when outputting the API_PrimElements, it is necessary to store them somewhere during the decomposition.
This interface enhances the IAPIPseudoContainer interface (from which it is derived from) with abstract methods to get and store attributes, get their additional API_AttributeDefExt info structures, and also new Begin () and End () methods which allow for enumerating only parts of this container: only attributes inside a database or even only a given type of attribute inside that database.
There’s a class in the DefaultImplementation folder which implements this interface in an effective way (AttributeProxy).
Caching the used attributes works much like outputting the elements. For each element loaded through the container’s GetNext () method the iterators request an attribute adapter from an attribute adapter factory, and then use that adapter to cache the attributes used by the element.
Version: API 10.21 or later