CFx SDK Documentation  2022 SP0
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 
unsigned int OdUInt32
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
OdSmartPtr< OdRxDictionaryIterator > OdRxDictionaryIteratorPtr
Definition: RxDictionary.h:85
FIRSTDLL_EXPORT OdRxDictionaryPtr odrxServiceDictionary()
FIRSTDLL_EXPORT OdRxDictionaryPtr odrxClassDictionary()
FIRSTDLL_EXPORT OdRxDictionary * odrxSysRegistry()
FIRSTDLL_EXPORT OdRxDictionaryPtr odrxCreateRxDictionary()
FIRSTDLL_EXPORT OdRxDictionaryPtr odrxCreateSyncRxDictionary()
OdSmartPtr< OdRxDictionary > OdRxDictionaryPtr
Definition: RxDictionary.h:388
virtual OdUInt32 idAt(const OdString &key) const =0
virtual OdRxObjectPtr getAt(OdUInt32 id) const =0
virtual OdRxObjectPtr remove(OdUInt32 id)=0
virtual OdRxObjectPtr getAt(const OdString &key) const =0
OdSmartPtr< OdRxDictionary > subDictCr(const OdString *path, int numSteps)
Definition: RxDictionary.h:434
virtual OdRxObjectPtr putAt(OdUInt32 id, OdRxObject *pObject)=0
virtual OdRxObjectPtr remove(const OdString &key)=0
virtual bool isCaseSensitive() const =0
virtual OdUInt32 numEntries() const =0
OdSmartPtr< OdRxDictionary > subDict(const OdString *path, int numSteps, bool createIfNotFound)
Definition: RxDictionary.h:428
virtual bool has(OdUInt32 id) const =0
ODRX_DECLARE_MEMBERS(OdRxDictionary)
virtual bool resetKey(OdUInt32 id, const OdString &newKey)=0
virtual OdRxDictionaryIteratorPtr newIterator(OdRx::DictIterType iterType=OdRx::kDictCollated)=0
virtual OdRxObjectPtr putAt(const OdString &key, OdRxObject *pObject, OdUInt32 *pRetId=0)=0
virtual bool has(const OdString &key) const =0
virtual void reserve(OdUInt32 minSize)
virtual OdString keyAt(OdUInt32 id) const =0
virtual OdUInt32 id() const =0
virtual OdString getKey() const =0
ODRX_DECLARE_MEMBERS(OdRxDictionaryIterator)
const T * get() const
Definition: SmartPtr.h:326
DictIterType
Definition: RxDefs.h:38
@ kDictCollated
Definition: RxDefs.h:40