Class Hierarchy
ReadableAcDbObject
C++
template <class ACDB_CLASS, getClassDescFuncType ACDB_GET_CLASS_DESC=ACDB_CLASS::desc> class ReadableAcDbObject;
File
dbobjptr2.h
Description
This class manages calls to accessAcDbObjectForRead and then reverts the open state change, if any, from the destructor or a call to the revertRead() member. While existing internal callers are free to continue using this class, new callers are strongly encouraged to use AcDbSmartObjectPointer only.
Notes
The fundamental requirement for using AcDbSmartObjectPointer, ReadableAcDbObject, and WritableAcDbObject is that the open state cannot be different at the point when these classes initiate access to the object and terminate the access, usually in the constructors and destructors. Intervening logic can open the object, as long as it also closes it. Instances of AcDbSmartObjectPointer and/or ReadableAcDbObject and WritableAcDbObject can be nested arbitrarily, as long as the nested instances release the object in reverse order of acquiring it. Failure to adhere to this requirement will result in program error.
As long as the constructor/destructor or open/close calls on these classes are exclusively used, i.e. access management is automated, multiple instances of AcDbSmartObjectPointer, ReadableAcDbObject, and WritableAcDbObject that point to a common object id X are designed to have stacking lifespans of object access, i.e. the instance last created (or to open an object) MUST be the first one destroyed (or close the object or overwrite it with an acquire()-based member). This occurs naturally when they are declared in nested code or function blocks; which is how they are intended to be used.
Links
ReadableAcDbObject Constructor, ReadableAcDbObject Methods, ReadableAcDbObject Operators
See Also
AcDbSmartObjectPointer, WritableAcDbObject
Previous Declaration
template <class ACDB_CLASS> class ReadableAcDbObject;
History
AutoCAD 2023
Removed the "For Internal Use Only" disclaimer.