Share

AcApDataManager

Class Hierarchy

AcRxObject
    AcApDocManagerReactor
        AcApDataManager

C++

template <class T>
class AcApDataManager : public AcApDocManagerReactor;

File

AcApDMgr.h

Description

AcApDataManager is a template class that helps developers store data on a per-document, rather than a global, basis.

The AcApDataManager object is the container for per-document data objects. An application defines a class to contain its document data and then specializes the AcApDataManager template with that class. This specialized instance creates a document data object for each drawing that is opened in the AutoCAD editor. An application should create only one instance of the AcApDataManager class.

Use the docData() members to get the per-document data objects for a given DWG document. Note that an instance of the per-document data object is created when the object is first accessed, rather than when the document is created. Per-document data objects are destroyed when documents close.

In your application, declare the singleton object of this class as follows:

AcApDataManagermyPerDocDataClassInstance;

To access your application data use one of the following calls:

myPerDocDataClassInstance.docData().m_myMemberVariable
myPerDocDataClassInstance.docData(curDoc()).m_myMemberVariable

Links

AcApDataManager Methods

See Also

AcDbLongTransaction, AcDbLongTransWorkSetIterator, AcApLongTransactionReactor

Was this information helpful?