![]() | InDesign SDK 20.5 |
#include <UIDRef.h>
Public Types | |
| typedef base_type | data_type |
Public Member Functions | |
| UIDRef (IDataBase *db, UID id) | |
| IDataBase * | GetDataBase () const |
| UID | GetUID () const |
| void | ResetUID (UID newUID) |
| bool16 | operator== (const UIDRef &other) const |
| bool16 | operator!= (const UIDRef &other) const |
| bool16 | operator< (const UIDRef &other) const |
| bool16 | operator! () const |
| operator void * () const | |
| bool16 | ExistsInDB () const |
| IPMUnknown * | Instantiate (PMIID iid) const |
Static Public Attributes | |
| static const UIDRef | gNull |
A UIDRef is a reference to a persistent object. Persistent objects are created in databases, by creating new UIDs. An open InDesign document is associated with a database, and the persistent objects stored with the document are managed and maintained by the database. If you have a pointer to the object in memory (for instance, a pointer to an interface of the object), that pointer is only good as long as the object is in memory. When it's released, the pointer can no longer be used to refer to the object. A UID is a persistent reference to an object that is good across instantations, and can be stored in the document as well. A UIDRef is a pair of <database, UID> that gives us a way to refer to an object as long as the document it is in is open.
| typedef base_type UIDRef::data_type |
This declares that UIDRef's have binary copy semantics. This means they can be copied byte-wise if necessary for performance reasons.
Create a new UIDRef to the specified object in the database.
| inline |
---- This function returns kTrue if the UIDRef is valid
and the UID exists in its database. Else returns kFalse
Common usage is to check and see if a UID can be
instantiated.
e.g.
<pre>
UID myUIDRef(aDB, aUID);
if (myUIDRef.IsExistsInDB() {
OK to instantiate UIDRef InterfacePtr<ISomeInterface> theIFace(myUIDRef, IID_ISOMEINTERFACE); theIFace->DoWork(); } else { UID ref is invalid or does not exist myUIDRef = UIDRef::gNull }
| inline |
Get the database.
| inline |
Get a pointer to the object in memory, reading it from disk if necessary.
| iid | which interface of the object to return (use IID_IUNKNOWN if you don't care). |
| inline |
| inline |
| inline |
Compare two UIDRefs for inequality
| other | the UIDRef to compare to |
| inline |
Compare two UIDRefs for inequality
| other | the UIDRef to compare to |
| inline |
Compare two UIDRefs for equality
| other | the UIDRef to compare to |