CFx SDK Documentation  2020SP3
DbIndex.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 
25 
26 
27 #ifndef OD_DBINDEX_H
28 #define OD_DBINDEX_H
29 
30 #include "TD_PackPush.h"
31 
32 class OdDbDate;
33 class OdDbIndexIterator;
34 class OdDbFilter;
37 class OdDbFilter;
41 class OdDbBlockChangeIteratorImpl;
42 class OdDbIndexUpdateDataImpl;
43 class OdDbIndexUpdateDataIteratorImpl;
45 
50 
51 #include "DbFilter.h"
52 
54  OdDbBlockTableRecord* pBlock,
55  int indexCtlVal,
56  OdDbBlockChangeIterator* pBlkChgIter,
57  OdDbIndexUpdateData* pIdxUpdData);
58 
59 
69 {
70 private:
71  friend class OdDbBlockChangeIteratorImpl;
72  OdDbBlockChangeIteratorImpl* m_pImpl;
73  OdDbBlockChangeIterator() : m_pImpl(0) {}
76 public:
77 
84  void start();
85 
89  OdDbObjectId id() const;
90 
94  void next();
95 
99  bool done();
100 
109  void curIdInfo(
110  OdDbObjectId& currentId,
111  OdUInt8& flags,
112  OdUInt32& data) const;
113 
121  OdUInt8 flags,
122  OdUInt32 data);
123 
128 
133 };
134 
144 {
145  friend class OdDbIndexUpdateDataImpl;
146  OdDbIndexUpdateDataImpl* m_pImpl;
147  OdDbIndexUpdateData() : m_pImpl(0) {}
149  const OdDbIndexUpdateData&);
150 public:
152  {
153  kModified = 1, // Modified RO
154  kDeleted = 2, // Deleted RO
155  kProcessed = 4, // Processed RW
156  kUnknownKey = 8 // Unknown key
157  };
162 
163 
169  void addId(
170  OdDbObjectId objectId);
171 
182  OdDbObjectId objectId,
183  OdUInt8 flags);
184 
194  bool setIdData(
195  OdDbObjectId objectId,
196  OdUInt32 data);
197 
207  bool getIdData(
208  OdDbObjectId objectId,
209  OdUInt32& data) const;
210 
221  OdDbObjectId objectId,
222  OdUInt8& flags) const;
223 
235  OdDbObjectId objectId,
236  OdUInt8& flags,
237  OdUInt32& data) const;
238 };
239 
249 {
250  friend class OdDbIndexUpdateDataIteratorImpl;
251  OdDbIndexUpdateDataIteratorImpl* m_pImpl;
252 public:
254  const OdDbIndexUpdateData* pIndexUpdateData);
255 
262  void start();
263 
267  OdDbObjectId id() const;
268 
272  void next();
273 
277  bool done();
278 
288  OdDbObjectId& currentId,
289  OdUInt8& flags,
290  OdUInt32& data) const;
291 };
292 
293 
303 {
304 public:
306 
308 
309 
316  const OdDbFilter* pFilter) const;
317 
322  virtual void rebuildFull(
323  OdDbIndexUpdateData* pIdxData);
324 
331  const OdDbDate& time);
332 
337 
344  const OdDbDate& time);
345 
350 
354  bool isUptoDate() const;
355 
357  OdDbDwgFiler* pFiler);
358 
359  virtual void dwgOutFields(
360  OdDbDwgFiler* pFiler) const;
361 
363  OdDbDxfFiler* pFiler);
364 
365  virtual void dxfOutFields(
366  OdDbDxfFiler* pFiler) const;
367 
368 protected:
369 
381  virtual void rebuildModified(
382  OdDbBlockChangeIterator* iterator);
383 
384  friend class OdDbIndexImpl;
386  OdDbBlockTableRecord* pBTR,
387  int indexCtlVal,
388  OdDbBlockChangeIterator* pBlkChgIter,
389  OdDbIndexUpdateData* pIdxUpdData );
390 };
395 
397 class OdDbBlockReference;
398 
408 {
416  OdDbDatabase* pDb);
417 
428  OdDbBlockTableRecord* pBTR,
429  OdDbIndex* pIndex);
430 
438  OdDbBlockTableRecord* pBTR,
439  const OdRxClass* key);
440 
441 
450  const OdDbBlockTableRecord* pBTR,
451  const OdRxClass* key,
452  OdDb::OpenMode readOrWrite = OdDb::kForRead);
453 
457  const OdDbBlockTableRecord* pBTR,
458  int btrIndex,
459  OdDb::OpenMode readOrWrite = OdDb::kForRead);
460 
467  const OdDbBlockTableRecord* pBTR);
468 
479  OdDbBlockReference* pBlkRef,
480  OdDbFilter* pFilter);
481 
489  OdDbBlockReference* pBlkRef,
490  const OdRxClass* key);
491 
500  const OdDbBlockReference* pBlkRef,
501  const OdRxClass* key,
502  OdDb::OpenMode readOrWrite);
503 
507  const OdDbBlockReference* pBlkRef,
508  int btrIndex,
509  OdDb::OpenMode readOrWrite);
510 
517  const OdDbBlockReference* pBlkRef);
518 }
519 
520 #include "TD_PackPop.h"
521 
522 #endif // OD_DBINDEX_H
523 
OdResult
OdResult
Definition: OdResult.h:29
OdDbIndexUpdateData::addId
void addId(OdDbObjectId objectId)
OdDbIndexUpdateDataIterator
Definition: DbIndex.h:249
OdDbIndex::setLastUpdatedAt
void setLastUpdatedAt(const OdDbDate &time)
OdDbIndexUpdateDataIterator::next
void next()
OdDbDatabase
Definition: DbDatabase.h:421
OdDbBlockReference
Definition: DbBlockReference.h:57
OdUInt8
unsigned char OdUInt8
Definition: OdPlatformSettings.h:759
OdDbBlockChangeIterator::id
OdDbObjectId id() const
OdDbFilteredBlockIteratorPtr
OdSmartPtr< OdDbFilteredBlockIterator > OdDbFilteredBlockIteratorPtr
Definition: DbIndex.h:44
OdDbIndex::dxfInFields
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
OdDbDate
Definition: DbDate.h:45
OdDbBlockChangeIterator::done
bool done()
OdDbIndex::lastUpdatedAt
OdDbDate lastUpdatedAt() const
OdDbObjectId
Definition: DbObjectId.h:99
OdDbIndex::isUptoDate
bool isUptoDate() const
OdDbBlockChangeIterator::curIdInfo
void curIdInfo(OdDbObjectId &currentId, OdUInt8 &flags, OdUInt32 &data) const
OdDbBlockChangeIterator::updateData
OdDbIndexUpdateData * updateData() const
OdDbIndex::dwgInFields
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
OdDbIndex::rebuildModified
virtual void rebuildModified(OdDbBlockChangeIterator *iterator)
OdDbIndexPtr
OdSmartPtr< OdDbIndex > OdDbIndexPtr
Definition: DbIndex.h:394
OdDbFilter
Definition: DbFilter.h:54
TD_PackPop.h
OdDbBlockChangeIterator
Definition: DbIndex.h:69
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
data
GLint GLenum GLsizei GLsizei GLint GLsizei const void * data
Definition: gles2_ext.h:110
OdDbIndexFilterManager::updateIndexes
TOOLKIT_EXPORT void updateIndexes(OdDbDatabase *pDb)
OdDb::kForRead
@ kForRead
Definition: DbObjectId.h:56
OdDbIndexUpdateData::setIdFlags
bool setIdFlags(OdDbObjectId objectId, OdUInt8 flags)
OdRxClass
Definition: RxObject.h:865
OdDbBlockChangeIterator::next
void next()
OdSmartPtr
Definition: SmartPtr.h:58
OdDbIndex::newIterator
virtual OdDbFilteredBlockIteratorPtr newIterator(const OdDbFilter *pFilter) const
OdDbIndexUpdateData
Definition: DbIndex.h:144
OdDbIndex::dwgOutFields
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
OdDbIndexFilterManager::getFilter
TOOLKIT_EXPORT OdDbFilterPtr getFilter(const OdDbBlockReference *pBlkRef, const OdRxClass *key, OdDb::OpenMode readOrWrite)
OdDbBlockChangeIterator::start
void start()
OdDbIndexFilterManager::getIndex
TOOLKIT_EXPORT OdDbIndexPtr getIndex(const OdDbBlockTableRecord *pBTR, const OdRxClass *key, OdDb::OpenMode readOrWrite=OdDb::kForRead)
OdDbIndexFilterManager::numFilters
TOOLKIT_EXPORT int numFilters(const OdDbBlockReference *pBlkRef)
OdDbIndexUpdateDataIterator::id
OdDbObjectId id() const
OdDbIndexFilterManager::addIndex
TOOLKIT_EXPORT void addIndex(OdDbBlockTableRecord *pBTR, OdDbIndex *pIndex)
OdDbIndexFilterManager::numIndexes
TOOLKIT_EXPORT int numIndexes(const OdDbBlockTableRecord *pBTR)
OdDbDxfFiler
Definition: DbFiler.h:194
OdDbIndex::lastUpdatedAtU
OdDbDate lastUpdatedAtU() const
TD_PackPush.h
OdDbIndexFilterManager::addFilter
TOOLKIT_EXPORT void addFilter(OdDbBlockReference *pBlkRef, OdDbFilter *pFilter)
OdDbIndexFilterManager
Definition: DbIndex.h:408
OdDbIndexUpdateData::getFlagsAndData
bool getFlagsAndData(OdDbObjectId objectId, OdUInt8 &flags, OdUInt32 &data) const
OdDbIndexUpdateData::setIdData
bool setIdData(OdDbObjectId objectId, OdUInt32 data)
OdDbIndexUpdateData::getIdFlags
bool getIdFlags(OdDbObjectId objectId, OdUInt8 &flags) const
processBTRIndexObjects
void processBTRIndexObjects(OdDbBlockTableRecord *pBlock, int indexCtlVal, OdDbBlockChangeIterator *pBlkChgIter, OdDbIndexUpdateData *pIdxUpdData)
OdDbBlockChangeIterator::clearProcessedFlags
void clearProcessedFlags()
OdDb::OpenMode
OpenMode
Definition: DbObjectId.h:54
OdDbIndexUpdateData::getIdData
bool getIdData(OdDbObjectId objectId, OdUInt32 &data) const
OdDbIndexUpdateData::UpdateFlags
UpdateFlags
Definition: DbIndex.h:152
OdDbBlockTableRecord
Definition: DbBlockTableRecord.h:57
OdDbIndex::setLastUpdatedAtU
void setLastUpdatedAtU(const OdDbDate &time)
OdDbIndexUpdateDataIterator::OdDbIndexUpdateDataIterator
OdDbIndexUpdateDataIterator(const OdDbIndexUpdateData *pIndexUpdateData)
DbFilter.h
OdDbIndex::rebuildFull
virtual void rebuildFull(OdDbIndexUpdateData *pIdxData)
OdDbIndexUpdateDataIterator::start
void start()
FacetModeler::kProcessed
@ kProcessed
Definition: FMSliceEngine.h:165
OdDbIndex::dxfOutFields
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
OdDbIndexFilterManager::removeFilter
TOOLKIT_EXPORT void removeFilter(OdDbBlockReference *pBlkRef, const OdRxClass *key)
TOOLKIT_EXPORT
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdDbIndex::processBTRIndexObjects
friend void processBTRIndexObjects(OdDbBlockTableRecord *pBTR, int indexCtlVal, OdDbBlockChangeIterator *pBlkChgIter, OdDbIndexUpdateData *pIdxUpdData)
OdDbIndexUpdateDataIterator::currentData
void currentData(OdDbObjectId &currentId, OdUInt8 &flags, OdUInt32 &data) const
OdDbIndexUpdateData::objectBeingIndexedId
OdDbObjectId objectBeingIndexedId() const
OdDbObject
Definition: DbObject.h:211
OdDbFilteredBlockIterator
Definition: DbBlockIterator.h:128
OdDbDwgFiler
Definition: DbFiler.h:1031
OdDbIndex
Definition: DbIndex.h:303
OdDbIndexFilterManager::removeIndex
TOOLKIT_EXPORT void removeIndex(OdDbBlockTableRecord *pBTR, const OdRxClass *key)
OdDbIndex::OdDbIndex
OdDbIndex()
OdDbIndex::ODDB_DECLARE_MEMBERS
ODDB_DECLARE_MEMBERS(OdDbIndex)
OdDbBlockChangeIterator::setCurIdInfo
void setCurIdInfo(OdUInt8 flags, OdUInt32 data)
OdDbIndexUpdateDataIterator::done
bool done()