ECEnabler.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/ECObjects.h>
11 #include <ECObjects/ECInstance.h>
12 #include <ECObjects/ECSchema.h>
13 #include <Bentley/RefCounted.h>
14 #include <Bentley/bset.h>
15 
19 
23 
24 #define INVALID_PROPERTY_INDEX 0;
25 
26 //=======================================================================================
40 //=======================================================================================
41 struct ECEnabler : RefCountedBase
42  {
45  {
48  virtual bool _ProcessPrimitiveProperty (IECInstance const& instance, WCharCP propName, ECValue const& propValue) const = 0;
49  };
50 
51 #if defined (EXPERIMENTAL_TEXT_FILTER)
52  enum PropertyProcessingResult {PROPERTY_PROCESSING_RESULT_Miss=0, PROPERTY_PROCESSING_RESULT_Hit=1, PROPERTY_PROCESSING_RESULT_NoCandidates=3};
53  enum PropertyProcessingOptions {PROPERTY_PROCESSING_OPTIONS_SingleType=0, PROPERTY_PROCESSING_OPTIONS_AllTypes=1};
54 #endif
55 
56 public:
60 
64 
69  ECOBJECTS_EXPORT ECObjectsStatus GetPropertyIndex (uint32_t& propertyIndex, WCharCP propertyAccessString) const;
70 
75  ECOBJECTS_EXPORT ECObjectsStatus GetAccessString (WCharCP& propertyAccessString, uint32_t propertyIndex) const;
76 
82 
87  ECOBJECTS_EXPORT uint32_t GetNextPropertyIndex (uint32_t parentIndex, uint32_t inputIndex) const;
88 
92  ECOBJECTS_EXPORT bool HasChildProperties (uint32_t parentIndex) const;
93 
98 
104 
108 
114 
115 #if defined (EXPERIMENTAL_TEXT_FILTER)
116  // also add the class to \a failedClasses.
127  ECOBJECTS_EXPORT PropertyProcessingResult ProcessPrimitiveProperties (bset<ECClassCP>& failedClasses, IECInstanceCR instance, ECN::PrimitiveType primitiveType, IPropertyProcessor const& proc, PropertyProcessingOptions opts = PROPERTY_PROCESSING_OPTIONS_SingleType) const;
128 #endif
129  };
130 
131 
132 //=======================================================================================
134 //=======================================================================================
135  struct IECRelationshipEnabler
136  {
137 protected:
140 
143 
144  public:
149  };
150 
ECObjectsStatus GetPropertyIndices(bvector< uint32_t > &indices, uint32_t parentIndex) const
Get vector of all property indices for property defined by parent index.
ECObjectsStatus
General purpose result codes.
Definition: ECObjects.h:128
bool HasChildProperties(uint32_t parentIndex) const
Return true if the property associated with parentIndex has child properties.
SchemaKey const & SchemaKeyCR
Definition: ECObjects.h:54
Provides Bentley specific set implementation (Bentley/bset.h).
virtual bool _ProcessPrimitiveProperty(IECInstance const &instance, WCharCP propName, ECValue const &propValue) const =0
Callback for primitive property on instance.
uint32_t GetFirstPropertyIndex(uint32_t parentIndex) const
Obtain the property index of the first property of this enabler's ECClass (if parentIndex == 0)...
ECClassCR GetClass() const
Get the ECClass that this enabler 'enables'.
uint32_t GetParentPropertyIndex(uint32_t childIndex) const
If childIndex refers to a member of a struct, returns the index of the struct property which contains...
uint32_t GetNextPropertyIndex(uint32_t parentIndex, uint32_t inputIndex) const
Get the next (after inputIndex) propertyIndex (used in conjunction with GetFirstPropertyIndex for eff...
wchar_t const * WCharCP
Definition: Bentley.h:224
#define ECOBJECTS_EXPORT
Definition: ECObjects.h:20
PrimitiveType
Enumeration of primitive datatypes supported by native "ECObjects" implementation.
Definition: ECObjects.h:322
RefCountedPtr< ECEnabler > ECEnablerPtr
Definition: ECEnabler.h:21
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
virtual StandaloneECRelationshipInstancePtr _CreateWipRelationshipInstance() const =0
Get a WipRelationshipInstance that is used to set relationship name and order Ids.
IECInstance const & IECInstanceCR
Definition: ECObjects.h:67
ECN::ECRelationshipClassCR GetRelationshipClass() const
Returns the relationship class that this enabler 'enables'.
ECClass const & ECClassCR
Definition: ECObjects.h:63
Variant-like object used to set and retrieve property values in ECInstances.
Definition: ECValue.h:73
Interface of functor that wants to process text-valued properties.
Definition: ECEnabler.h:44
#define END_BENTLEY_ECOBJECT_NAMESPACE
Definition: DgnPlatform.h:41
IStandaloneEnablerLocaterR GetStandaloneEnablerLocater()
Get the IStandaloneEnablerLocater for this enabler.
Concrete class that can be used to implement the reference-counting pattern.
Definition: RefCounted.h:109
ECObjectsStatus GetAccessString(WCharCP &propertyAccessString, uint32_t propertyIndex) const
Given a propertyIndex, find the corresponding property access string.
ECObjectsStatus GetPropertyIndex(uint32_t &propertyIndex, WCharCP propertyAccessString) const
Obtain a propertyIndex given an access string.
StandaloneECRelationshipInstancePtr CreateWipRelationshipInstance() const
Get a WipRelationshipInstance that is used to set relationship name and order Ids.
virtual ECN::ECRelationshipClassCR _GetRelationshipClass() const =0
Returns the relationship class that this enabler 'enables'.
unsigned int uint32_t
Definition: Bentley.r.h:93
WCharCP GetName() const
Primarily for debugging/logging purposes.
RefCountedPtr< StandaloneECRelationshipInstance > StandaloneECRelationshipInstancePtr
Definition: ECEnabler.h:22
#define BEGIN_BENTLEY_ECOBJECT_NAMESPACE
Definition: DgnPlatform.h:40
IStandaloneEnablerLocater & IStandaloneEnablerLocaterR
Definition: ECObjects.h:80
StandaloneECEnablerPtr GetEnablerForStructArrayMember(SchemaKeyCR schemaKey, WCharCP className)
Returns an enabler for the given class from the given schema.
ECRelationshipClass const & ECRelationshipClassCR
Definition: ECObjects.h:64
RefCountedPtr< StandaloneECEnabler > StandaloneECEnablerPtr
Definition: ECEnabler.h:20

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