ECContext.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 #include "ECObjects.h"
11 #include <Geom/GeomApi.h>
13 
17 
19 //=======================================================================================
21 //=======================================================================================
23 {
24  static const int CATEGORY_PARTITION_SIZE = 5000;
26  {
27  ReaderContext = -1* CATEGORY_PARTITION_SIZE, //Whatever we found is off highest priority
28  UserSpace = 0* CATEGORY_PARTITION_SIZE,
29  External = 1* CATEGORY_PARTITION_SIZE,
30  StandardPaths = 2* CATEGORY_PARTITION_SIZE,
31  Final = 3* CATEGORY_PARTITION_SIZE,
32  };
33 
34 private:
35  virtual void MakeClassAbstract() = 0;
36 public:
37 public:
38 
43  ECOBJECTS_EXPORT static ECSchemaReadContextPtr CreateContext (IStandaloneEnablerLocaterP standaloneEnablerLocater, bool acceptLegacyImperfectLatestCompatibleMatch = false);
44 
47  ECOBJECTS_EXPORT static ECSchemaReadContextPtr CreateContext (bool acceptLegacyImperfectLatestCompatibleMatch = false);
48 
52  ECOBJECTS_EXPORT void AddSchemaLocater (IECSchemaLocaterR locater, uint32_t priority = 0);
53 
56  ECOBJECTS_EXPORT void RemoveSchemaLocater (IECSchemaLocaterR locater);
57 
60  ECOBJECTS_EXPORT void AddSchemaPath (WCharCP path);
61 
65  ECOBJECTS_EXPORT void AddCulture(WCharCP culture);
66 
68  ECOBJECTS_EXPORT bvector<WString>* GetCultures();
69 
72  ECOBJECTS_EXPORT void SetFinalSchemaLocater (IECSchemaLocaterR locater);
73 
78  ECOBJECTS_EXPORT ECSchemaPtr LocateSchema (SchemaKeyR key, SchemaMatchType matchType);
79 
82  ECOBJECTS_EXPORT ECSchemaCacheR GetCache ();
83 };
84 
86 //=======================================================================================
88 //=======================================================================================
90 {
91  // InstanceXml does not contain primitive type information. An IPrimitiveTypeResolver can assist the
92  // ECInstanceReadContext in determining the type of a serialized primitive value.
93  // If no IPrimitiveTypeResolver is supplied, the primitive type defined for the ECProperty is used.
95  {
96  };
97 
98 private:
99  virtual void MakeClassAbstract() = 0;
100 public:
101 public:
102 
105 
107  ECOBJECTS_EXPORT static ECInstanceReadContextPtr CreateContext (ECSchemaReadContextR, ECSchemaCR fallBackSchema, ECSchemaPtr* foundSchema);
108 };
PriorityPartiion
Definition: ECContext.h:25
Interface to find a standalone enabler, typically for an embedded ECStruct in an ECInstance.
Definition: ECSchema.h:1291
An object that controls the lifetime of a set of ECSchemas.
Definition: ECSchema.h:1331
SchemaMatchType
Defines what sort of match should be used when locating a schema.
Definition: ECSchema.h:967
RefCountedPtr< ECInstanceReadContext > ECInstanceReadContextPtr
Definition: ECContext.h:85
Fully defines a schema with its name, major and minor versions, and a checksum.
Definition: ECSchema.h:983
wchar_t const * WCharCP
Definition: Bentley.h:224
Interface implemented by class that provides schema location services.
Definition: ECSchema.h:1310
ECSchema const & ECSchemaCR
Definition: ECObjects.h:53
#define NULL
Definition: Bentley.h:157
#define ECOBJECTS_EXPORT
Definition: ECObjects.h:20
GeomApi: Bentley::Rounding, Bentley::ValueSizeSize, Bentley::OrderedValueSizeSize, Bentley::IGeometry, Bentley::OrderedIGeometryPtr, Bentley::pointList.
Context object used for schema creation and deserialization.
Definition: ECContext.h:22
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
Context object used for instance creation and deserialization.
Definition: ECContext.h:89
#define END_BENTLEY_ECOBJECT_NAMESPACE
Definition: DgnPlatform.h:41
Concrete class that can be used to implement the reference-counting pattern.
Definition: RefCounted.h:109
RefCountedPtr< ECSchemaReadContext > ECSchemaReadContextPtr
Definition: ECContext.h:18
unsigned int uint32_t
Definition: Bentley.r.h:93
#define BEGIN_BENTLEY_ECOBJECT_NAMESPACE
Definition: DgnPlatform.h:40

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