CFx SDK Documentation  2023 SP0
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 
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdSmartPtr< OdDbIndex > OdDbIndexPtr
Definition: DbIndex.h:394
void processBTRIndexObjects(OdDbBlockTableRecord *pBlock, int indexCtlVal, OdDbBlockChangeIterator *pBlkChgIter, OdDbIndexUpdateData *pIdxUpdData)
OdSmartPtr< OdDbFilteredBlockIterator > OdDbFilteredBlockIteratorPtr
Definition: DbIndex.h:44
unsigned int OdUInt32
unsigned char OdUInt8
OdResult
Definition: OdResult.h:29
void setCurIdInfo(OdUInt8 flags, OdUInt32 data)
OdDbIndexUpdateData * updateData() const
void curIdInfo(OdDbObjectId &currentId, OdUInt8 &flags, OdUInt32 &data) const
OdDbObjectId id() const
virtual void rebuildFull(OdDbIndexUpdateData *pIdxData)
void setLastUpdatedAt(const OdDbDate &time)
ODDB_DECLARE_MEMBERS(OdDbIndex)
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
bool isUptoDate() const
friend void processBTRIndexObjects(OdDbBlockTableRecord *pBTR, int indexCtlVal, OdDbBlockChangeIterator *pBlkChgIter, OdDbIndexUpdateData *pIdxUpdData)
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
void setLastUpdatedAtU(const OdDbDate &time)
virtual void rebuildModified(OdDbBlockChangeIterator *iterator)
OdDbDate lastUpdatedAtU() const
OdDbDate lastUpdatedAt() const
virtual OdDbFilteredBlockIteratorPtr newIterator(const OdDbFilter *pFilter) const
bool setIdData(OdDbObjectId objectId, OdUInt32 data)
bool setIdFlags(OdDbObjectId objectId, OdUInt8 flags)
bool getIdFlags(OdDbObjectId objectId, OdUInt8 &flags) const
bool getIdData(OdDbObjectId objectId, OdUInt32 &data) const
void addId(OdDbObjectId objectId)
OdDbObjectId objectBeingIndexedId() const
bool getFlagsAndData(OdDbObjectId objectId, OdUInt8 &flags, OdUInt32 &data) const
OdDbObjectId id() const
void currentData(OdDbObjectId &currentId, OdUInt8 &flags, OdUInt32 &data) const
OdDbIndexUpdateDataIterator(const OdDbIndexUpdateData *pIndexUpdateData)
GLint GLenum GLsizei GLsizei GLint GLsizei const void * data
Definition: gles2_ext.h:110
OpenMode
Definition: DbObjectId.h:54
@ kForRead
Definition: DbObjectId.h:56
TOOLKIT_EXPORT void addIndex(OdDbBlockTableRecord *pBTR, OdDbIndex *pIndex)
TOOLKIT_EXPORT OdDbFilterPtr getFilter(const OdDbBlockReference *pBlkRef, const OdRxClass *key, OdDb::OpenMode readOrWrite)
TOOLKIT_EXPORT OdDbIndexPtr getIndex(const OdDbBlockTableRecord *pBTR, const OdRxClass *key, OdDb::OpenMode readOrWrite=OdDb::kForRead)
TOOLKIT_EXPORT void addFilter(OdDbBlockReference *pBlkRef, OdDbFilter *pFilter)
TOOLKIT_EXPORT int numFilters(const OdDbBlockReference *pBlkRef)
TOOLKIT_EXPORT void removeIndex(OdDbBlockTableRecord *pBTR, const OdRxClass *key)
TOOLKIT_EXPORT void removeFilter(OdDbBlockReference *pBlkRef, const OdRxClass *key)
TOOLKIT_EXPORT void updateIndexes(OdDbDatabase *pDb)
TOOLKIT_EXPORT int numIndexes(const OdDbBlockTableRecord *pBTR)