DgnECManager.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 
10 #pragma managed(push, off)
11 
12 #include "DgnECProviders.h"
15 
33 
35  {
39  };
40 
41 
42 
48 {
49 private:
50  virtual void MakeClassAbstract() = 0;
51 public:
52 public:
55 
56 
63  DGNPLATFORM_EXPORT UInt32 AppendECInstancesToModel (bvector<ECN::StandaloneECInstancePtr> const& ecInstances, DgnModelR dgnModel);
64 
69  DGNPLATFORM_EXPORT BentleyStatus ReadECInstancesFromModel (bvector<ECN::IECInstancePtr>& ecInstances, DgnModelR dgnModel);
70 
78  DGNPLATFORM_EXPORT UInt32 RemoveECInstancesFromModel (DgnModelR model, WCharCP schemaName, WCharCP className, Int32 firstIndex, Int32 count);
79 
84  DGNPLATFORM_EXPORT UInt32 RemoveECInstancesFromModel (DgnModelR model, bvector<ECN::IECInstancePtr>& instancesToRemove);
85 
86 
88  DGNPLATFORM_EXPORT ECN::ECObjectsStatus CreateSchema (ECN::ECSchemaPtr& schemaHolder, WCharCP schemaName, UInt32 majorVersion, UInt32 minorVersion, DgnFileP file);
89 
95  DGNPLATFORM_EXPORT ECN::SchemaReadStatus ReadSchemaFromXmlString (ECN::ECSchemaPtr& schema, WCharCP schemaAsXml, DgnFileP dgnFile, bvector<WString>* searchPaths = NULL);
96 
102  DGNPLATFORM_EXPORT ECN::SchemaReadStatus ReadSchemaFromXmlFile (ECN::ECSchemaPtr& schemaHolder, WCharCP ecSchemaXmlFilename, DgnFileP dgnFile, bvector<WString>* searchPaths = NULL);
103 
108  DGNPLATFORM_EXPORT ECN::ECInstanceReadContextPtr CreateECInstanceReadContext (ECN::ECSchemaR schema, DgnFileR dgnFile);
109 
112  DGNPLATFORM_EXPORT IDgnECProviderP GetProviderById (UInt16 providerId) const;
113 
118  DGNPLATFORM_EXPORT DgnECInstanceEnablerP ObtainInstanceEnablerByName (WCharCP schemaName, WCharCP className, DgnFileR dgnFile);
119 
123  DGNPLATFORM_EXPORT DgnECInstanceEnablerP ObtainInstanceEnabler (ECN::ECClassCR ecClass, DgnFileR file);
124 
133  DGNPLATFORM_EXPORT DgnECInstanceIterable FindInstances (FindInstancesScopeR scope, ECQueryCR query, UInt32* count = NULL);
134 
140  DGNPLATFORM_EXPORT static InstanceCountIterable GetInstanceCounts(FindInstancesScopeR scope, const SearchClassList & requestedClasses, ECQueryProcessFlags searchFlags = ECQUERY_PROCESS_SearchAllClasses);
141 
147  DGNPLATFORM_EXPORT DgnElementECInstancePtr FindInstanceOnElement (ElementHandleCR el, ECN::ECClassCR ecClass, bool polymorphic=false) const;
148 
154  DGNPLATFORM_EXPORT DgnECInstanceIterable FindRelatedInstances (DgnECInstanceCR sourceInstance, QueryRelatedClassSpecifierCR relationshipClassSpecifier, DgnECInstanceCreateContextCR createContext) const;
155 
159  DGNPLATFORM_EXPORT void FindRelationshipEntriesOnElement(ElementRefP rootElement, RelationshipEntryVector& entries) const;
160 
164  DGNPLATFORM_EXPORT void FindECClassesOnElement(ElementRefP rootElement, ElementECClassInfo& infos) const;
165 
171  DGNPLATFORM_EXPORT void DiscoverSchemas (bvector<SchemaInfo>& infos, DgnFileR dgnFile, ECSchemaPersistence persistence = ECSCHEMAPERSISTENCE_Stored, DgnECHostType hostType = DgnECHostType::All);
172 
179  DGNPLATFORM_EXPORT void DiscoverSchemasForModel (bvector<SchemaInfo>& schemaInfoVector, DgnModelR dgnModel, ECSchemaPersistence persistence=ECSCHEMAPERSISTENCE_Stored, ReferencedModelScopeOption scopeOption = REFERENCED_MODEL_SCOPE_None);
180 
184  DGNPLATFORM_EXPORT bool IsSchemaContainedWithinFile(SchemaInfoR schemaInfo, ECN::SchemaMatchType matchType);
185 
192  DGNPLATFORM_EXPORT ECN::ECSchemaPtr LocateSchemaInDgnFile (SchemaInfoR schemaInfo, ECN::SchemaMatchType matchType, bool includeDeliveredSchemas = true);
193 
199  DGNPLATFORM_EXPORT DeleteDgnECInstanceStatus DeleteDgnECInstance (WCharCP instanceIdStringP, DgnModelRefP dependentModel, bool ignoreElementOwnership) const;
200 
207  DGNPLATFORM_EXPORT DeleteDgnECInstanceStatus DeleteDgnECInstance (ElementRefP elementRef, UInt32 localId, bool ignoreElementOwnership, UInt16 providerId=DgnECProviderId_ECXAttributes) const;
208 
215  DGNPLATFORM_EXPORT DeleteDgnECInstanceStatus ScheduleDeleteDgnECInstance (EditElementHandleR element, UInt32 localId, bool ignoreElementOwnership=false, UInt16 providerId=DgnECProviderId_ECXAttributes) const;
216 
217 
218 
226  DGNPLATFORM_EXPORT SchemaImportStatus ImportSchema (ECN::ECSchemaR schema, DgnFileR dgnFile, bool isExternalSchema=false, bool importReferencedSchemas=true);
227 
235  DGNPLATFORM_EXPORT SchemaUpdateStatus UpdateSchema (ECN::ECSchemaR schema, DgnFileR dgnFile, bool isExternalSchema=false);
236 
242  DGNPLATFORM_EXPORT ECN::StandaloneECRelationshipInstancePtr CreateWipRelationshipByName (WCharCP schemaName, WCharCP className, DgnFileR dgnFile);
243 
249  DGNPLATFORM_EXPORT DgnECRelationshipEnablerP ObtainDgnECRelationshipEnabler (WCharCP schemaName, WCharCP className, DgnFileR dgnFile);
250 
275  DGNPLATFORM_EXPORT BentleyStatus CreateRelationship (IDgnECRelationshipInstancePtr *createdRelationship, DgnECRelationshipEnablerCR relationshipEnabler,
277  DgnElementECInstanceCR instanceA, DgnElementECInstanceCR instanceB, DgnModelRefP hostModelRef=NULL, ElementRefP hostElementRef=NULL) const;
278 
301  DGNPLATFORM_EXPORT BentleyStatus CreateRelationship (IDgnECRelationshipInstancePtr *createdRelationship, DgnECRelationshipEnablerCR relationshipEnabler,
302  DgnElementECInstanceCR instanceA, DgnElementECInstanceCR instanceB, DgnModelRefP hostModelRef=NULL, ElementRefP hostElementRef=NULL) const;
303 
308  DGNPLATFORM_EXPORT BentleyStatus DeleteRelationship (DgnElementECInstanceCR sourceDgnInstance, DgnElementECInstanceCR targetDgnInstance, ECN::ECRelationshipClassCR relationshipClass);
309 
310 };
311 
314 
315 #pragma managed(pop)
struct DgnPlatform::ECQuery const & ECQueryCR
Definition: DgnPlatform.h:532
ECObjectsStatus
General purpose result codes.
Definition: ECObjects.h:128
bmap< ECN::SchemaNameClassNamePair, bool > ElementECClassInfo
Definition: DgnECProviders.h:221
bvector< RelationshipEntry > RelationshipEntryVector
Definition: DgnECProviders.h:241
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
Iterable for returning the number of instances for given classes within the given scope...
Definition: DgnECFinders.h:169
DgnECRelationshipEnabler is an abstract class.
Definition: DgnECInstance.h:542
RefCountedPtr< ECSchema > ECSchemaPtr
Definition: ECSchema.h:569
Definition: TextTableHandler.h:216
The in-memory representation of a schema as defined by ECSchemaXML.
Definition: ECSchema.h:1375
SchemaUpdateStatus
Definition: DgnECProviders.h:176
SchemaMatchType
Defines what sort of match should be used when locating a schema.
Definition: ECSchema.h:967
struct DgnPlatform::DgnECInstanceCreateContext const & DgnECInstanceCreateContextCR
Definition: DgnPlatform.h:540
uint16_t UInt16
Definition: Bentley.r.h:118
ECQueryProcessFlags
Definition: WhereCriterion.h:33
A writeable "handle" to an MSElement.
Definition: ElementHandle.h:470
bvector< SearchClass > SearchClassList
Definition: ECQuery.h:44
size_type count(const key_type &__x) const
Definition: stdcxx/bstdmap.h:277
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
A DgnFile is an in-memory representation of a physical file, regardless of its format.
Definition: DgnFile.h:308
wchar_t const * WCharCP
Definition: Bentley.h:224
uint32_t UInt32
Definition: Bentley.r.h:128
#define NULL
Definition: Bentley.h:157
StandaloneECRelationshipInstance is used to represent a relationship between two IECInstances.
Definition: StandaloneECRelationshipInstance.h:85
SchemaReadStatus
Result status for deserializing an ECSchema from Xml.
Definition: ECObjects.h:175
DeleteDgnECInstanceStatus
Definition: DgnECProviders.h:208
A DgnModel represents a DgnModel in memory.
Definition: DgnModel.h:236
struct DgnPlatform::DgnECRelationshipEnabler const & DgnECRelationshipEnablerCR
Definition: DgnPlatform.h:204
BentleyStatus
Definition: Bentley.h:208
A DgnModelRef provides access to a model in a Bentley::DgnPlatform::DgnFile.
Definition: DgnModelRef.h:172
int32_t Int32
Definition: Bentley.r.h:119
Include all attachments.
Definition: DgnECManager.h:37
IManager * GetManager()
Return a pointer to the one and only relationship manager.
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
ECClass const & ECClassCR
Definition: ECObjects.h:63
Interface that provides direct and efficient access to element data.
Definition: ElementRefBase.h:120
DgnECManager handles persistence of ECInstances including CRUD operations for ECN::Instances and EC:R...
Definition: DgnECManager.h:47
unsigned char byte
Definition: Bentley.r.h:144
Include only direct attachments.
Definition: DgnECManager.h:38
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
ECSchemaPersistence
Definition: DgnECProviders.h:63
SchemaImportStatus
Definition: DgnECProviders.h:162
Holds descriptive information about an ECSchema, particularly so that it can be examined before the E...
Definition: DgnECProviders.h:85
struct DgnPlatform::DgnElementECInstance const & DgnElementECInstanceCR
Definition: DgnPlatform.h:205
! Used to return results from DgnECManager::FindInstances.
Definition: DgnECInstance.h:601
struct DgnPlatform::ElementHandle const & ElementHandleCR
Definition: DgnPlatform.h:260
struct DgnPlatform::DgnECInstance const & DgnECInstanceCR
Definition: DgnPlatform.h:199
When we have not yet determined how an ECSchema is persisted.
Definition: DgnECProviders.h:66
A findinstances scope describes where to look for instances on a call to DgnECManager::FindInstances(...
Definition: DgnECFinders.h:108
DgnECHostType
Describes the underlying type on which an instance can be persisted.
Definition: DgnECInstance.h:78
struct DgnPlatform::QueryRelatedClassSpecifier const & QueryRelatedClassSpecifierCR
Definition: DgnPlatform.h:538
ReferencedModelScopeOption
Definition: DgnECManager.h:34
Implemented by ECEnablers which expose properties of DgnECInstances.
Definition: DgnECInstance.h:256
#define ENUM_UNDERLYING_TYPE(T)
Definition: Bentley.h:70
RefCountedPtr< StandaloneECRelationshipInstance > StandaloneECRelationshipInstancePtr
Definition: ECEnabler.h:22
Implemented for each "persistence technology" that can persist ECInstances and ECRelationships, e.g.
Definition: DgnECProviders.h:269
ECRelationshipClass const & ECRelationshipClassCR
Definition: ECObjects.h:64

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