ElementRefBase.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
11 #include "DgnElements.h"
12 #include "DgnAppData.h"
13 
15 DGNPLATFORM_TYPEDEFS (ElementRefVec);
16 
18 
23 {
28 };
29 
34 {
42 };
43 
44 //=======================================================================================
46 //=======================================================================================
48 {
53 };
54 
55 //=======================================================================================
60 //=======================================================================================
62 {
63  virtual ~ElementRefAppData() {}
64 
65  //=======================================================================================
70  //=======================================================================================
71  struct Key : AppDataKey {};
72 
76  virtual WCharCP _GetName () {return NULL;}
77 
86  virtual void _OnCleanup (ElementRefP host, bool unloadingModel, HeapZoneR zone) = 0;
87 
94  virtual bool _OnElemChanged (ElementRefP host, bool qvCacheDeleted, ElemRefChangeReason reason) {return false;}
95 
96 private:
97  virtual bool _Dummy3(void*) {return false;}
98  virtual bool _Dummy2(void*) {return false;}
99  virtual bool _Dummy1(void*) {return false;}
100 };
101 
102 typedef bvector<ElementRefP> T_StdElementRefVector;
103 
104 //=======================================================================================
105 // @bsiclass Bentley Systems
106 //=======================================================================================
107 struct ElementRefVec : bvector<ElementRefBase*>
108 {
109 };
110 
111 //=======================================================================================
119 //=======================================================================================
121  {
122 private:
123  virtual void MakeClassAbstract() = 0;
124 public:
125 public:
127 
128  DGNPLATFORM_EXPORT HeapZoneR GetHeapZone ();
130 
137  DGNPLATFORM_EXPORT StatusInt AddAppData (ElementRefAppData::Key const& key, ElementRefAppData* appData, HeapZoneR heapZone, bool allowOnDeleted=false);
138 
142  DGNPLATFORM_EXPORT StatusInt DropAppData (ElementRefAppData::Key const& key);
143 
149 
151  DGNPLATFORM_EXPORT ElementRefP GetParentElementRef ();
152 
155  DGNPLATFORM_EXPORT DgnModelP GetDgnModelP ();
156 
158  DGNPLATFORM_EXPORT DependentElm* GetFirstDependent ();
159 
164  DGNPLATFORM_EXPORT int GetDependents (ElementRefP* depRefs, int maxDependents);
165 
170  DGNPLATFORM_EXPORT bool IsDependent (ElementRefP isThisDependent, bool recurse);
171 
173  DGNPLATFORM_EXPORT ElementId GetElementId () const;
174 
176  DGNPLATFORM_EXPORT int GetElementType () const;
177 
179  DGNPLATFORM_EXPORT UInt32 GetLevel () const;
180 
182  DGNPLATFORM_EXPORT T_Adouble GetLastModified () const;
183 
185  DGNPLATFORM_EXPORT bool IsComplexComponent () const;
186 
188  DGNPLATFORM_EXPORT bool IsGraphics () const;
189 
200  DGNPLATFORM_EXPORT ElementRefP ValidateElementRef ();
201  };
202 
204 
Definition: ElementRefBase.h:40
Definition: ElementRefBase.h:38
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
defined (DGN_PLATFORM_MT)
Definition: HeapZone.h:22
A unique identifier for this type of ElementRefAppData.
Definition: ElementRefBase.h:71
virtual ~ElementRefAppData()
Definition: ElementRefBase.h:63
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
wchar_t const * WCharCP
Definition: Bentley.h:224
uint32_t UInt32
Definition: Bentley.r.h:128
#define NULL
Definition: Bentley.h:157
Definition: ElementRefBase.h:35
A DgnModel represents a DgnModel in memory.
Definition: DgnModel.h:236
#define CLRPUBLIC
Definition: DgnPlatform/ExportMacros.h:12
Definition: ElementRefBase.h:39
virtual bool _OnElemChanged(ElementRefP host, bool qvCacheDeleted, ElemRefChangeReason reason)
Called to allow app data to react to changes to the persisent element it was added to...
Definition: ElementRefBase.h:94
#define BENTLEY_TYPEDEFS(_name_)
Definition: Bentley.h:152
A unique (for this session) key to identify this AppData type.
Definition: DgnAppData.h:21
virtual WCharCP _GetName()
Return a name for this type of app data.
Definition: ElementRefBase.h:76
Interface that provides direct and efficient access to element data.
Definition: ElementRefBase.h:120
Definition: ElementRefBase.h:36
DGNPLATFORM_TYPEDEFS(ElementRefVec)
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
Definition: ElementRefBase.h:37
int StatusInt
Definition: Bentley.h:222
UInt64 ElementId
Definition: DgnPlatformBaseType.r.h:83
bvector< ElementRefP > T_StdElementRefVector
Definition: ElementRefBase.h:102
Definition: ElementRefBase.h:41
Definition: ElementRefBase.h:107
ElemRefChangeReason
*//* Bentley Systems
Definition: ElementRefBase.h:47
Class used to cache non-persistent information specific to a persistent element.
Definition: ElementRefBase.h:61
ElementHiliteState
The current Hilite state of the element.
Definition: ElementRefBase.h:33
ElementRefType
Types of ElementRefs.
Definition: ElementRefBase.h:22

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.