CFx SDK Documentation  2020SP3
RxDictionary.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 _RXDICTIONARY_INC_
28 #define _RXDICTIONARY_INC_
29 
30 
31 #include "RxObject.h"
32 #include "RxIterator.h"
33 #include "RxDefs.h"
34 #include "RxNames.h"
35 
36 class OdString;
37 
38 #include "TD_PackPush.h"
39 
61 {
62 public:
64 
71  virtual OdString getKey() const = 0;
72 
79  virtual OdUInt32 id() const = 0;
80 };
81 
86 
87 
114 {
115 public:
117 
129  virtual void reserve(
130  OdUInt32 minSize);
131 
148  const OdString& key) const = 0;
149 
166  OdUInt32 id) const = 0;
167 
187  const OdString& key,
188  OdRxObject* pObject,
189  OdUInt32* pRetId = 0) = 0;
190 
209  OdUInt32 id,
210  OdRxObject* pObject) = 0;
211 
227  virtual bool resetKey(
228  OdUInt32 id,
229  const OdString& newKey) = 0;
230 
247  const OdString& key) = 0;
248 
265  OdUInt32 id) = 0;
266 
267  void removeAll() { OdUInt32 n = numEntries(); while(n--) remove(n); }
268 
280  virtual bool has(
281  const OdString& key) const = 0;
282 
294  virtual bool has(
295  OdUInt32 id) const = 0;
296 
297 
312  virtual OdUInt32 idAt(
313  const OdString& key) const = 0;
314 
329  virtual OdString keyAt(
330  OdUInt32 id) const = 0;
331 
341  virtual OdUInt32 numEntries() const = 0;
342 
368  OdRx::DictIterType iterType = OdRx::kDictCollated) = 0;
369 
377  virtual bool isCaseSensitive() const = 0;
378 
379  inline OdSmartPtr<OdRxDictionary> subDict(const OdString* path, int numSteps, bool createIfNotFound);
380 
381  inline OdSmartPtr<OdRxDictionary> subDictCr(const OdString* path, int numSteps);
382 };
383 
389 
390 
395 
396 
406 
407 
412 
413 
419 
420 
426 
427 
428 inline OdRxDictionaryPtr OdRxDictionary::subDict(const OdString* path, int numSteps, bool createIfNotFound) {
429  OdRxDictionaryPtr dir(this);
430  for(int i=0; dir.get() && i<numSteps; ++i)
431  dir = dir->getAt(path[i]);
432  return dir;
433 }
434 inline OdRxDictionaryPtr OdRxDictionary::subDictCr(const OdString* path, int numSteps) {
435  return subDict(path, numSteps, true);
436 }
437 
438 #include "TD_PackPop.h"
439 
440 #endif // _RXDICTIONARY_INC_
441 
FIRSTDLL_EXPORT
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
OdRxDictionaryIteratorPtr
OdSmartPtr< OdRxDictionaryIterator > OdRxDictionaryIteratorPtr
Definition: RxDictionary.h:85
OdRxDictionary::isCaseSensitive
virtual bool isCaseSensitive() const =0
OdString
Definition: OdString.h:95
OdRxIterator
Definition: RxIterator.h:46
OdRxObjectPtr
Definition: RxObject.h:345
OdRxDictionary::subDictCr
OdSmartPtr< OdRxDictionary > subDictCr(const OdString *path, int numSteps)
Definition: RxDictionary.h:434
OdRxDictionaryIterator::id
virtual OdUInt32 id() const =0
OdRxDictionary::has
virtual bool has(const OdString &key) const =0
OdRxObject
Definition: RxObject.h:564
RxIterator.h
RxNames.h
OdRxDictionary::putAt
virtual OdRxObjectPtr putAt(const OdString &key, OdRxObject *pObject, OdUInt32 *pRetId=0)=0
TD_PackPop.h
odrxCreateSyncRxDictionary
FIRSTDLL_EXPORT OdRxDictionaryPtr odrxCreateSyncRxDictionary()
RxObject.h
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
odrxSysRegistry
FIRSTDLL_EXPORT OdRxDictionary * odrxSysRegistry()
OdRxDictionary::idAt
virtual OdUInt32 idAt(const OdString &key) const =0
OdRxDictionaryPtr
OdSmartPtr< OdRxDictionary > OdRxDictionaryPtr
Definition: RxDictionary.h:388
OdRxDictionary::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdRxDictionary)
OdRx::DictIterType
DictIterType
Definition: RxDefs.h:38
OdRxDictionary::getAt
virtual OdRxObjectPtr getAt(const OdString &key) const =0
RxDefs.h
OdSmartPtr< OdRxDictionaryIterator >
OdRxDictionary::getAt
virtual OdRxObjectPtr getAt(OdUInt32 id) const =0
OdRxDictionary::has
virtual bool has(OdUInt32 id) const =0
OdRxDictionary::subDict
OdSmartPtr< OdRxDictionary > subDict(const OdString *path, int numSteps, bool createIfNotFound)
Definition: RxDictionary.h:428
OdRxDictionary::newIterator
virtual OdRxDictionaryIteratorPtr newIterator(OdRx::DictIterType iterType=OdRx::kDictCollated)=0
OdSmartPtr::get
const T * get() const
Definition: SmartPtr.h:326
OdRx::kDictCollated
@ kDictCollated
Definition: RxDefs.h:40
OdRxDictionary
Definition: RxDictionary.h:114
OdRxDictionary::reserve
virtual void reserve(OdUInt32 minSize)
TD_PackPush.h
OdRxDictionary::keyAt
virtual OdString keyAt(OdUInt32 id) const =0
OdRxDictionary::putAt
virtual OdRxObjectPtr putAt(OdUInt32 id, OdRxObject *pObject)=0
OdRxDictionary::removeAll
void removeAll()
Definition: RxDictionary.h:267
OdRxDictionaryIterator::getKey
virtual OdString getKey() const =0
odrxClassDictionary
FIRSTDLL_EXPORT OdRxDictionaryPtr odrxClassDictionary()
OdRxDictionaryIterator
Definition: RxDictionary.h:61
odrxServiceDictionary
FIRSTDLL_EXPORT OdRxDictionaryPtr odrxServiceDictionary()
OdRxDictionary::numEntries
virtual OdUInt32 numEntries() const =0
OdRxDictionaryIterator::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdRxDictionaryIterator)
odrxCreateRxDictionary
FIRSTDLL_EXPORT OdRxDictionaryPtr odrxCreateRxDictionary()
OdRxDictionary::remove
virtual OdRxObjectPtr remove(OdUInt32 id)=0
OdRxDictionary::remove
virtual OdRxObjectPtr remove(const OdString &key)=0
OdRxDictionary::resetKey
virtual bool resetKey(OdUInt32 id, const OdString &newKey)=0