Classes | Public Member Functions | List of all members
ECEnabler Struct Reference

An ECEnabler is the interface between an ECClass and an ECInstance. More...

#include <ECEnabler.h>

Inheritance diagram for ECEnabler:
RefCountedBase RefCounted< IRefCounted > IRefCounted StandaloneECEnabler StandaloneECRelationshipEnabler

Classes

struct  IPropertyProcessor
 Interface of functor that wants to process text-valued properties. More...
 

Public Member Functions

WCharCP GetName () const
 Primarily for debugging/logging purposes. More...
 
ECClassCR GetClass () const
 Get the ECClass that this enabler 'enables'. More...
 
ECObjectsStatus GetPropertyIndex (uint32_t &propertyIndex, WCharCP propertyAccessString) const
 Obtain a propertyIndex given an access string. More...
 
ECObjectsStatus GetAccessString (WCharCP &propertyAccessString, uint32_t propertyIndex) const
 Given a propertyIndex, find the corresponding property access string. More...
 
uint32_t GetFirstPropertyIndex (uint32_t parentIndex) const
 Obtain the property index of the first property of this enabler's ECClass (if parentIndex == 0), or the first child property of the struct property indicated by parentIndex. More...
 
uint32_t GetNextPropertyIndex (uint32_t parentIndex, uint32_t inputIndex) const
 Get the next (after inputIndex) propertyIndex (used in conjunction with GetFirstPropertyIndex for efficiently looping over property values.) More...
 
bool HasChildProperties (uint32_t parentIndex) const
 Return true if the property associated with parentIndex has child properties. More...
 
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 it. More...
 
ECObjectsStatus GetPropertyIndices (bvector< uint32_t > &indices, uint32_t parentIndex) const
 Get vector of all property indices for property defined by parent index. More...
 
IStandaloneEnablerLocaterR GetStandaloneEnablerLocater ()
 Get the IStandaloneEnablerLocater for this enabler. More...
 
StandaloneECEnablerPtr GetEnablerForStructArrayMember (SchemaKeyCR schemaKey, WCharCP className)
 Returns an enabler for the given class from the given schema. More...
 
- Public Member Functions inherited from RefCounted< IRefCounted >
void * operator new (size_t size)
 
void operator delete (void *rawMemory, size_t size)
 
UInt32 AddRef () const
 
UInt32 Release () const
 
 RefCounted ()
 
 RefCounted (RefCounted const &rhs)
 
RefCountedoperator= (RefCounted const &rhs)
 
UInt32 GetRefCount () const
 

Additional Inherited Members

- Protected Member Functions inherited from RefCounted< IRefCounted >
virtual ~RefCounted ()
 
- Protected Member Functions inherited from IRefCounted
virtual ~IRefCounted ()
 
void * operator new (size_t size)
 
void operator delete (void *rawMemory, size_t size)
 

Detailed Description

An ECEnabler is the interface between an ECClass and an ECInstance.

Every ECInstance has an associated ECEnabler, typically shared among all ECInstances of that ECClass.

The ECEnabler's primary job is to convert access strings (based on property names defined in the ECClass) into integer property indices understood by the ECInstance. Property indices are opaque integers, each of which uniquely identify a single property of the ECClass. A property index of zero means "no such property index". In the case of struct properties, each property of the struct is assigned a property index unique among all property indices; the struct itself has its own property index which serves as the "parent" property index for its own properties.

Operations involving property indices are significantly more efficient than those involving access strings and should be preferred where possible.

Member Function Documentation

ECObjectsStatus GetAccessString ( WCharCP propertyAccessString,
uint32_t  propertyIndex 
) const

Given a propertyIndex, find the corresponding property access string.

Parameters
[out]propertyAccessStringWill be set to the corresponding access string
[in]propertyIndexProperty index for which to obtain an access string
Returns
ECOBJECTS_STATUS_Success if property index successfully converted, or an error code.
ECClassCR GetClass ( ) const

Get the ECClass that this enabler 'enables'.

Returns
the ECClass associated with this ECEnabler.
StandaloneECEnablerPtr GetEnablerForStructArrayMember ( SchemaKeyCR  schemaKey,
WCharCP  className 
)

Returns an enabler for the given class from the given schema.

Parameters
[in]schemaKeyThe SchemaKey defining the schema (schema name and version info) that the className ECClass comes from
[in]classNameThe name of the ECClass to retrieve the enabler for
Returns
A StandaloneECEnabler that enables the requested class
uint32_t GetFirstPropertyIndex ( uint32_t  parentIndex) const

Obtain the property index of the first property of this enabler's ECClass (if parentIndex == 0), or the first child property of the struct property indicated by parentIndex.

Parameters
[in]parentIndexThe property index of the parent struct property, or 0 if not a member of a struct.
Returns
The first property index, or 0 if no such property exists.
WCharCP GetName ( ) const

Primarily for debugging/logging purposes.

Should match your fully-qualified class name

Returns
An enabler name for debugging/logging purposes.
uint32_t GetNextPropertyIndex ( uint32_t  parentIndex,
uint32_t  inputIndex 
) const

Get the next (after inputIndex) propertyIndex (used in conjunction with GetFirstPropertyIndex for efficiently looping over property values.)

Parameters
[in]parentIndexProperty index of the parent struct property, or 0 if not a member of a struct.
[in]inputIndexIndex of the preceding property.
Returns
The index of the property following inputIndex, or 0 if no such property exists.
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 it.

Parameters
[in]childIndexThe index of the child property
Returns
The index of the parent property, or 0 if the child property has no parent (i.e. is not a member of a struct)
ECObjectsStatus GetPropertyIndex ( uint32_t propertyIndex,
WCharCP  propertyAccessString 
) const

Obtain a propertyIndex given an access string.

The propertyIndex can be used with ECInstances enabled by this enabler for more efficient property value access

Parameters
[out]propertyIndexWill be set to the corresponding property index
[in]propertyAccessStringAccess string for which to obtain the property index
Returns
ECOBJECTS_STATUS_Success if access string successfully converted, or an error code.
ECObjectsStatus GetPropertyIndices ( bvector< uint32_t > &  indices,
uint32_t  parentIndex 
) const

Get vector of all property indices for property defined by parent index.

Parameters
[out]indicesVector to hold the property indices.
[in]parentIndexProperty index of the parent struct property, or 0 if not a member of a struct.
Returns
ECOBJECTS_STATUS_Success if vector of indices populated, or an error code.
IStandaloneEnablerLocaterR GetStandaloneEnablerLocater ( )

Get the IStandaloneEnablerLocater for this enabler.

Returns
an IStandaloneEnablerLocater
bool HasChildProperties ( uint32_t  parentIndex) const

Return true if the property associated with parentIndex has child properties.

Parameters
[in]parentIndexProperty index of the parent struct property, or 0 if not a member of a struct.
Returns
True if the specified property has child properties (i.e., is a struct property)

The documentation for this struct was generated from the following file:

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