CFx SDK Documentation 2024 SP0
|
#include <DbDictionary.h>
Protected Member Functions | |
OdDbDictionary () | |
Protected Member Functions inherited from OdDbObject | |
OdDbObject () | |
virtual OdResult | subGetClassID (void *pClsid) const |
virtual OdDbObjectPtr | subDeepClone (OdDbIdMapping &ownerIdMap, OdDbObject *pOwner, bool bPrimary) const |
virtual OdDbObjectPtr | subWblockClone (OdDbIdMapping &ownerIdMap, OdDbObject *pOwner, bool bPrimary) const |
Protected Member Functions inherited from OdGiDrawable | |
OdGiDrawable () | |
virtual OdUInt32 | subSetAttributes (OdGiDrawableTraits *traits) const =0 |
virtual bool | subWorldDraw (OdGiWorldDraw *wd) const =0 |
virtual void | subViewportDraw (OdGiViewportDraw *vd) const =0 |
virtual OdUInt32 | subViewportDrawLogicalFlags (OdGiViewportDraw *vd) const |
virtual OdUInt32 | subRegenSupportFlags () const |
Additional Inherited Members | |
Static Public Member Functions inherited from OdRxObject | |
static OdRxObjectPtr | cast (const OdRxObject *pointer) |
static OdRxClass * | desc () |
Protected Attributes inherited from OdDbObject | |
OdDbObjectImpl * | m_pImpl |
This class implements database -resident object dictionaries.
Corresponding C++ library: TD_Db <group OdDb_Classes>
Each instance of OdDbDictionary is a single container object, in which entries are searched, added, modified, and deleted.
Each OdDbDictionary entry associates a unique name (key) string with a unique OdDbObject. Anonymous names are signified by specifying a name starting with an asterisk; e.g., *U. A unique name (also starting with an asterisk) will be constructed for the entry. Entry names honor the rules of Symbol names: Names may be any length. Names are case-insensitive. Names may not contain any of the following characters: | * \ : ; < > ? " , equals.
Definition at line 134 of file DbDictionary.h.
anonymous enum |
Enumerator | |
---|---|
kMaxSuggestNameSize |
Definition at line 299 of file DbDictionary.h.
|
protected |
|
virtual |
Notification function called each time an Undo operation is performed this object is using partial Undo.
pUndoFiler | [in] A pointer to the undo filer with the partial undo information. |
pClassObj | [in] A pointer to the OdRxClass object for the class that will handle the Undo. |
This member function must know which types of fields to scan, and must stop after reading what it it needs.
If the class type specified by pClassObj does not matches the class of this object, this member function must call the parent class's applyPartialUndo() and return whatever it returns.
If it does match the class of this object, this member function must use pUndoFiler to read the undo data, then typically use this object's set() method.
Throws:
Cause eNotThatKindOfClass pClassObj != OdDbObject::desc()
Reimplemented from OdDbObject.
|
virtual |
Reads the .dwg file data of this object.
pFiler | [in] Filer object from which data are read. |
This function is called by dwgIn() to allow the object to read its data.
When overriding this function:
1) Call assertWriteEnabled(). 2) Call the parent class's dwgInFields(pFiler). 3) If it returns eOK, continue; otherwise return whatever the parent's dwgInFields(pFiler) returned. 4) Call the OdDbDwgFiler(pFiler) methods to read each of the object's data items in the order they were written. 5) Return pFiler->filerStatus().
Reimplemented from OdDbObject.
Reimplemented in OdDbDictionaryWithDefault.
|
virtual |
Writes the .dwg file data of this object.
pFiler | [in] Pointer to the filer to which data are written. |
This function is called by dwgIn() to allow the object to write its data.
When overriding this function:
1) Call assertReadEnabled(). 2) Call the parent class's dwgOutFields(pFiler). 3) Call the OdDbDwgFiler(pFiler) methods to write each of the object's data items in the order they were written.
Reimplemented from OdDbObject.
Reimplemented in OdDbDictionaryWithDefault.
|
virtual |
Reads the DXF data of this object.
pFiler | [in] Pointer to the filer from which data are read. |
This function is called by dxfIn() to allow the object to read its data.
When overriding this function:
1) Call assertWriteEnabled(). 2) Call the parent class's dwgInFields(pFiler). 3) If it returns eOK, continue; otherwise return whatever the parent's dxfInFields(pFiler) returned. 4) Call the OdDbDxfFiler(pFiler) methods to read each of the object's data items in the order they were written. 5) Return pFiler->filerStatus().
Reimplemented from OdDbObject.
Reimplemented in OdDbDictionaryWithDefault.
|
virtual |
Writes the DXF data of this object.
pFiler | [in] Pointer to the filer to which data are to be written. |
This function is called by dxfOut() to allow the object to write its data.
When overriding this function:
1) Call assertReadEnabled(). 2) Call the parent class's dxfOutFields(pFiler). 4) Use pFiler to call the OdDbDxfFiler methods to write each of the object's data items in the order they were written.
Reimplemented from OdDbObject.
Reimplemented in OdDbDictionaryWithDefault.
|
virtual |
Notification function called whenever an object has been erased or unerased.
pObject | [in] Pointer to the object that was erased/unerased. |
erasing | [in] True if and only if this object is being erased. |
Reimplemented from OdDbObject.
OdDbObjectPtr OdDbDictionary::getAt | ( | const OdString & | name, |
OdDb::OpenMode | mode | ||
) | const |
Returns the OdDbObject associated with the specified name (key) in this Dictionary object.
name | [in] Entry name. |
mode | [in] Mode in which to open the object. |
Returns a null SmartPointer if the specified entry could not be opened.
OdDbObjectId OdDbDictionary::getAt | ( | const OdString & | name, |
OdResult * | pStatus = 0 |
||
) | const |
Returns the OdDbObject associated with the specified name (key) in this Dictionary object.
name | [in] Entry name. |
pStatus | [out] Receives eOk if successful, or an appropriate error code if not. |
Returns a null Object ID if the specified entry could not be opened.
|
virtual |
Notification function called just before an object is deleted from memory.
pObject | [in] Pointer to the object that is being deleted. |
The default implementation of this function does nothing. This function can be overridden in custom classes.
Reimplemented from OdDbObject.
bool OdDbDictionary::has | ( | const OdDbObjectId & | objectId | ) | const |
Returns true if and only if this Dictionary object has an entry with the specified Object ID.
objectId | [in] Object ID. |
bool OdDbDictionary::has | ( | const OdString & | name | ) | const |
Returns true if and only if this Dictionary object has an entry with the specified name (key).
name | [in] Entry name. |
bool OdDbDictionary::isTreatElementsAsHard | ( | ) | const |
Returns true if and only if this Dictionary object is the hard owner of its elements.
|
virtual |
Returns the merge style for this dictionary object.
Reimplemented from OdDbObject.
OdString OdDbDictionary::nameAt | ( | const OdDbObjectId & | objectId | ) | const |
Returns the entry name (key) of the specified object in this Dictionary object.
objectId | [in] Object ID. |
OdDbDictionaryIteratorPtr OdDbDictionary::newIterator | ( | OdRx::DictIterType | iterType = OdRx::kDictCollated | ) | const |
Returns a new interator that can be used to traverse the entries in this Dictionary object.
iterType | [in] Type of Iterator. |
Description OdRx::kDictCollated Traverses the entries in the order they were added to the dictionary. OdRx::kDictSorted Traverses the entries in alphabetical order by key value.
OdUInt32 OdDbDictionary::numEntries | ( | ) | const |
Returns the number of entries in this Dictionary object.
void OdDbDictionary::remove | ( | const OdDbObjectId & | objectId | ) |
Removes the entry with the specified Object ID from this Dictionary object, and returns the Object ID of the removed entry.
name | [in] Entry name. |
objectId | [in] Object ID. |
OdDbObjectId OdDbDictionary::remove | ( | const OdString & | name | ) |
Removes the entry with the specified name (key) from this Dictionary object, and returns the Object ID of the removed entry.
name | [in] Entry name. |
OdDbObjectId OdDbDictionary::setAt | ( | const OdString & | name, |
OdDbObject * | newValue | ||
) |
Sets the value for the specified entry in this Dictionary object.
If an entry the specified name exists in the dictionary, it is erased, and a new entry created.
If an entry for this name does not exist in this dictionary, a new entry is created.
name | [in] Name of entry to be changed. |
newValue | [in] Database object to be added. |
|
virtual |
Sets the merge style for this dictionary object.
mergeStyle | [in] Merge style. |
Changes the name (key) of the specified entry in this Dictionary object.
oldName | [in] Name of entry to change. |
newName | [in] New name for the entry. |
void OdDbDictionary::setTreatElementsAsHard | ( | bool | doIt | ) |
Sets the hard ownership property for this Dictionary object.
hard | [in] Controls ownership. |
|
virtual |
Called as the first operation as this object is being closed, for database -resident objects only.
When overriding this function:
1) If the OdDbObject's state is incorrect, throw exception.
2) Call parent class's subClose().
3) If other actions are required before close, do them.
The default implementation of this function does nothing. This function can be overridden in custom classes.
Reimplemented from OdDbObject.
Reimplemented from OdDbObject.
OdString OdDbDictionary::suggestName | ( | const OdString & | strFilePath, |
const int | nMaxLength = kMaxSuggestNameSize |
||
) | const |
Returns a string suitable to be used as dictionary Key for this dictionary object. The string is unique for this dictionary object and is as close to file name as possible.
strFilePath | [in] File path. |
nMaxLength | [in] Maximum length of name generated. |