The in-memory representation of an ECClass as defined by ECSchemaXML. More...
#include <ECSchema.h>
Public Member Functions | |
ECClassId | GetId () const |
Return unique id (May return 0 until it has been explicitly set by ECDb or a similar system) More... | |
StandaloneECEnablerP | GetDefaultStandaloneEnabler () const |
Returns the StandaloneECEnabler for this class. More... | |
ECRelationshipClassCP | GetRelationshipClassCP () const |
Used to avoid dynamic_cast. More... | |
ECRelationshipClassP | GetRelationshipClassP () |
Used to avoid dynamic_cast. More... | |
ECSchemaCR | GetSchema () const |
The ECSchema that this class is defined in. More... | |
WStringCR | GetName () const |
The name of this ECClass. More... | |
WCharCP | GetFullName () const |
{SchemaName}:{ClassName} The pointer will remain valid as long as the ECClass exists. More... | |
bool | GetIsDisplayLabelDefined () const |
Whether the display label is explicitly defined or not. More... | |
ECPropertyIterable | GetProperties () const |
Returns an iterable of all the ECProperties defined on this class. More... | |
size_t | GetPropertyCount (bool includeBaseProperties=true) const |
Returns the number of ECProperties in this class. More... | |
const ECBaseClassesList & | GetBaseClasses () const |
Returns a list of the classes this ECClass is derived from. More... | |
const ECDerivedClassesList & | GetDerivedClasses () const |
Returns a list of the classes that derive from this class. More... | |
ECObjectsStatus | SetDescription (WStringCR value) |
Sets the description of this ECClass. More... | |
WStringCR | GetDescription () const |
Gets the description of this ECClass. Returns the localized description if one exists. More... | |
WStringCR | GetInvariantDescription () const |
Gets the invariant description for this ECClass. More... | |
ECObjectsStatus | SetDisplayLabel (WStringCR value) |
Sets the display label of this ECClass. More... | |
WStringCR | GetDisplayLabel () const |
Gets the display label of this ECClass. If no display label has been set explicitly, it will return the name of the ECClass. More... | |
WStringCR | GetInvariantDisplayLabel () const |
Gets the invariant display label for this ECClass. More... | |
ECPropertyIterable | GetProperties (bool includeBaseProperties) const |
Returns a list of properties for this class. More... | |
ECObjectsStatus | SetIsStruct (WCharCP isStruct) |
Sets the bool value of whether this class can be used as a struct. More... | |
ECObjectsStatus | SetIsStruct (bool value) |
Sets the bool value of whether this class can be used as a struct. More... | |
bool | GetIsStruct () const |
Returns whether this class can be used as a struct. More... | |
ECObjectsStatus | SetIsCustomAttributeClass (WCharCP isCustomAttribute) |
Sets the bool value of whether this class can be used as a custom attribute. More... | |
ECObjectsStatus | SetIsCustomAttributeClass (bool value) |
Sets the bool value of whether this class can be used as a custom attribute. More... | |
bool | GetIsCustomAttributeClass () const |
Returns whether this class can be used as a custom attribute. More... | |
ECObjectsStatus | SetIsDomainClass (WCharCP isDomainClass) |
Sets the bool value of whether this class can be used as a domain object. More... | |
ECObjectsStatus | SetIsDomainClass (bool value) |
Sets the bool value of whether this class can be used as a domain object. More... | |
bool | GetIsDomainClass () const |
Gets whether this class can be used as a domain object. More... | |
ECObjectsStatus | SetIsFinal (WCharCP isFinal) |
Sets the bool value of whether this class is final and can't be subclassed. More... | |
ECObjectsStatus | SetIsFinal (bool value) |
Sets the bool value of whether this class is final and can't be subclassed. More... | |
bool | GetIsFinal () const |
Gets whether this class is final and can't be subclassed. More... | |
ECObjectsStatus | AddBaseClass (ECClassCR baseClass) |
Adds a base class You cannot add a base class if it creates a cycle. More... | |
bool | HasBaseClasses () const |
Returns whether there are any base classes for this class. More... | |
ECObjectsStatus | RemoveBaseClass (ECClassCR baseClass) |
Removes a base class. More... | |
bool | Is (ECClassCP targetClass) const |
Returns true if the class is the type specified or derived from it. More... | |
bool | Is (WCharCP name) const |
Returns true if the class name is of the type specified or derived from it. More... | |
bool | Is (WCharCP schemaName, WCharCP className) const |
Returns true if this class matches the specified schema and class name, or is derived from a matching class. More... | |
ECObjectsStatus | CreatePrimitiveProperty (PrimitiveECPropertyP &ecProperty, WStringCR name) |
If the given name is valid, creates a primitive property object with the default type of STRING. More... | |
ECObjectsStatus | CreatePrimitiveProperty (PrimitiveECPropertyP &ecProperty, WStringCR name, PrimitiveType primitiveType) |
If the given name is valid, creates a primitive property object with the given primitive type. More... | |
ECObjectsStatus | CreateStructProperty (StructECPropertyP &ecProperty, WStringCR name) |
If the given name is valid, creates a struct property object using the current class as the struct type. More... | |
ECObjectsStatus | CreateStructProperty (StructECPropertyP &ecProperty, WStringCR name, ECClassCR structType) |
If the given name is valid, creates a struct property object using the specified class as the struct type. More... | |
ECObjectsStatus | CreateArrayProperty (ArrayECPropertyP &ecProperty, WStringCR name) |
If the given name is valid, creates an array property object using the current class as the array type. More... | |
ECObjectsStatus | CreateArrayProperty (ArrayECPropertyP &ecProperty, WStringCR name, PrimitiveType primitiveType) |
If the given name is valid, creates an array property object using the specified primitive type as the array type. More... | |
ECObjectsStatus | CreateArrayProperty (ArrayECPropertyP &ecProperty, WStringCR name, ECClassCP structType) |
If the given name is valid, creates an array property object using the specified class as the array type. More... | |
ECObjectsStatus | RemoveProperty (WStringCR name) |
Remove the named property. More... | |
ECPropertyP | GetPropertyP (WCharCP name, bool includeBaseClasses=true) const |
Get a property by name within the context of this class and its base classes. More... | |
ECPropertyP | GetPropertyP (WStringCR name, bool includeBaseClasses=true) const |
Get a property by name within the context of this class and its base classes. More... | |
ECPropertyP | GetPropertyP (Utf8CP name, bool includeBaseClasses=true) const |
Get a property by name within the context of this class and its base classes. More... | |
![]() | |
bool | IsDefined (WStringCR schemaName, WStringCR className) const |
Returns true if the container has a custom attribute of a class of the specified name. More... | |
bool | IsDefined (ECClassCR classDefinition) const |
Returns true if the container has a custom attribute of a class of the specified class definition. More... | |
IECInstancePtr | GetCustomAttribute (WStringCR schemaName, WStringCR className) const |
Retrieves the custom attribute matching the class name. More... | |
IECInstancePtr | GetCustomAttribute (ECClassCR classDefinition) const |
Retrieves the custom attribute matching the class definition. More... | |
IECInstancePtr | GetCustomAttributeLocal (WStringCR schemaName, WStringCR className) const |
Retrieves the custom attribute matching the class name. More... | |
IECInstancePtr | GetCustomAttributeLocal (ECClassCR classDefinition) const |
Retrieves the custom attribute matching the class definition. More... | |
IECInstancePtr | GetPrimaryCustomAttribute (WStringCR schemaName, WStringCR className) const |
Retrieves the custom attribute matching the class name. More... | |
IECInstancePtr | GetPrimaryCustomAttribute (ECClassCR classDefinition) const |
Retrieves the custom attribute matching the class definition. More... | |
ECCustomAttributeInstanceIterable | GetCustomAttributes (bool includeBase) const |
Retrieves all custom attributes from the container including supplemental custom attributes. More... | |
ECCustomAttributeInstanceIterable | GetPrimaryCustomAttributes (bool includeBase) const |
Retrieves all custom attributes from the container NOT including supplemental custom attributes. More... | |
ECObjectsStatus | SetCustomAttribute (IECInstanceR customAttributeInstance) |
Adds a custom attribute to the container. More... | |
bool | RemoveCustomAttribute (WStringCR schemaName, WStringCR className) |
Removes a custom attribute from the container. More... | |
bool | RemoveCustomAttribute (ECClassCR classDefinition) |
Removes a custom attribute from the container. More... | |
bool | IsDefined (WStringCR className) const |
LEGECY METHODS. More... | |
IECInstancePtr | GetCustomAttribute (WStringCR className) const |
IECInstancePtr | GetCustomAttributeLocal (WStringCR className) const |
IECInstancePtr | GetPrimaryCustomAttribute (WStringCR className) const |
bool | RemoveCustomAttribute (WStringCR className) |
Static Public Member Functions | |
static ECObjectsStatus | ParseClassName (WStringR prefix, WStringR className, WStringCR qualifiedClassName) |
Given a qualified class name, will parse out the schema's namespace prefix and the class name. More... | |
static WString | GetQualifiedClassName (ECSchemaCR primarySchema, ECClassCR ecClass) |
Given a schema and a class, will return the fully qualified class name. More... | |
static bool | ClassesAreEqualByName (ECClassCP currentBaseClass, const void *arg) |
Given two ECClass's, checks to see if they are equal by name. More... | |
The in-memory representation of an ECClass as defined by ECSchemaXML.
ECObjectsStatus AddBaseClass | ( | ECClassCR | baseClass | ) |
Adds a base class You cannot add a base class if it creates a cycle.
For example, if A is a base class of B, and B is a base class of C, you cannot make C a base class of A. Attempting to do so will return an error. You also can't add a base class to final classes
[in] | baseClass | The class to derive from |
|
static |
Given two ECClass's, checks to see if they are equal by name.
[in] | currentBaseClass | The source class to check against |
[in] | arg | The target to compare to (this parameter must be an ECClassP) |
ECObjectsStatus CreateArrayProperty | ( | ArrayECPropertyP & | ecProperty, |
WStringCR | name | ||
) |
If the given name is valid, creates an array property object using the current class as the array type.
ECObjectsStatus CreateArrayProperty | ( | ArrayECPropertyP & | ecProperty, |
WStringCR | name, | ||
PrimitiveType | primitiveType | ||
) |
If the given name is valid, creates an array property object using the specified primitive type as the array type.
ECObjectsStatus CreateArrayProperty | ( | ArrayECPropertyP & | ecProperty, |
WStringCR | name, | ||
ECClassCP | structType | ||
) |
If the given name is valid, creates an array property object using the specified class as the array type.
ECObjectsStatus CreatePrimitiveProperty | ( | PrimitiveECPropertyP & | ecProperty, |
WStringCR | name | ||
) |
If the given name is valid, creates a primitive property object with the default type of STRING.
ECObjectsStatus CreatePrimitiveProperty | ( | PrimitiveECPropertyP & | ecProperty, |
WStringCR | name, | ||
PrimitiveType | primitiveType | ||
) |
If the given name is valid, creates a primitive property object with the given primitive type.
ECObjectsStatus CreateStructProperty | ( | StructECPropertyP & | ecProperty, |
WStringCR | name | ||
) |
If the given name is valid, creates a struct property object using the current class as the struct type.
ECObjectsStatus CreateStructProperty | ( | StructECPropertyP & | ecProperty, |
WStringCR | name, | ||
ECClassCR | structType | ||
) |
If the given name is valid, creates a struct property object using the specified class as the struct type.
const ECBaseClassesList& GetBaseClasses | ( | ) | const |
Returns a list of the classes this ECClass is derived from.
StandaloneECEnablerP GetDefaultStandaloneEnabler | ( | ) | const |
Returns the StandaloneECEnabler for this class.
const ECDerivedClassesList& GetDerivedClasses | ( | ) | const |
Returns a list of the classes that derive from this class.
WStringCR GetDescription | ( | ) | const |
Gets the description of this ECClass. Returns the localized description if one exists.
WStringCR GetDisplayLabel | ( | ) | const |
WCharCP GetFullName | ( | ) | const |
{SchemaName}:{ClassName} The pointer will remain valid as long as the ECClass exists.
ECClassId GetId | ( | ) | const |
Return unique id (May return 0 until it has been explicitly set by ECDb or a similar system)
bool GetIsCustomAttributeClass | ( | ) | const |
Returns whether this class can be used as a custom attribute.
bool GetIsDisplayLabelDefined | ( | ) | const |
Whether the display label is explicitly defined or not.
bool GetIsDomainClass | ( | ) | const |
Gets whether this class can be used as a domain object.
bool GetIsFinal | ( | ) | const |
Gets whether this class is final and can't be subclassed.
bool GetIsStruct | ( | ) | const |
Returns whether this class can be used as a struct.
ECPropertyIterable GetProperties | ( | ) | const |
Returns an iterable of all the ECProperties defined on this class.
ECPropertyIterable GetProperties | ( | bool | includeBaseProperties | ) | const |
Returns a list of properties for this class.
[in] | includeBaseProperties | If true, then will return properties that are contained in this class's base class(es) |
size_t GetPropertyCount | ( | bool | includeBaseProperties = true | ) | const |
Returns the number of ECProperties in this class.
ECPropertyP GetPropertyP | ( | WCharCP | name, |
bool | includeBaseClasses = true |
||
) | const |
Get a property by name within the context of this class and its base classes.
The pointer returned by this method is valid until the ECClass containing the property is destroyed or the property is removed from the class.
[in] | name | The name of the property to lookup. |
[in] | includeBaseClasses | Whether to look on base classes of the current class for the named property |
ECPropertyP GetPropertyP | ( | WStringCR | name, |
bool | includeBaseClasses = true |
||
) | const |
Get a property by name within the context of this class and its base classes.
The pointer returned by this method is valid until the ECClass containing the property is destroyed or the property is removed from the class.
[in] | name | The name of the property to lookup. |
[in] | includeBaseClasses | Whether to look on base classes of the current class for the named property |
ECPropertyP GetPropertyP | ( | Utf8CP | name, |
bool | includeBaseClasses = true |
||
) | const |
Get a property by name within the context of this class and its base classes.
The pointer returned by this method is valid until the ECClass containing the property is destroyed or the property is removed from the class.
[in] | name | The name of the property to lookup. |
[in] | includeBaseClasses | Whether to look on base classes of the current class for the named property |
|
static |
Given a schema and a class, will return the fully qualified class name.
If the class is part of the passed in schema, there is no namespace prefix. Otherwise, the class's schema must be a referenced schema in the passed in schema
[in] | primarySchema | The schema used to lookup the namespace prefix of the class's schema |
[in] | ecClass | The class whose schema should be searched for |
ECRelationshipClassCP GetRelationshipClassCP | ( | ) | const |
Used to avoid dynamic_cast.
ECRelationshipClassP GetRelationshipClassP | ( | ) |
Used to avoid dynamic_cast.
ECSchemaCR GetSchema | ( | ) | const |
The ECSchema that this class is defined in.
bool HasBaseClasses | ( | ) | const |
Returns whether there are any base classes for this class.
bool Is | ( | ECClassCP | targetClass | ) | const |
Returns true if the class is the type specified or derived from it.
bool Is | ( | WCharCP | name | ) | const |
Returns true if the class name is of the type specified or derived from it.
Returns true if this class matches the specified schema and class name, or is derived from a matching class.
|
static |
Given a qualified class name, will parse out the schema's namespace prefix and the class name.
[out] | prefix | The namespace prefix of the schema |
[out] | className | The name of the class |
[in] | qualifiedClassName | The qualified name of the class, in the format of ns:className |
ECObjectsStatus RemoveBaseClass | ( | ECClassCR | baseClass | ) |
Removes a base class.
ECObjectsStatus RemoveProperty | ( | WStringCR | name | ) |
Remove the named property.
[in] | name | The name of the property to be removed |
ECObjectsStatus SetIsCustomAttributeClass | ( | WCharCP | isCustomAttribute | ) |
Sets the bool value of whether this class can be used as a custom attribute.
[in] | isCustomAttribute | String representation of true/false |
ECObjectsStatus SetIsCustomAttributeClass | ( | bool | value | ) |
Sets the bool value of whether this class can be used as a custom attribute.
ECObjectsStatus SetIsDomainClass | ( | WCharCP | isDomainClass | ) |
Sets the bool value of whether this class can be used as a domain object.
[in] | isDomainClass | String representation of true/false |
ECObjectsStatus SetIsDomainClass | ( | bool | value | ) |
Sets the bool value of whether this class can be used as a domain object.
ECObjectsStatus SetIsFinal | ( | WCharCP | isFinal | ) |
Sets the bool value of whether this class is final and can't be subclassed.
[in] | isFinal | String representation of true/false |
ECObjectsStatus SetIsFinal | ( | bool | value | ) |
Sets the bool value of whether this class is final and can't be subclassed.
ECObjectsStatus SetIsStruct | ( | WCharCP | isStruct | ) |
Sets the bool value of whether this class can be used as a struct.
[in] | isStruct | String representation of true/false |
ECObjectsStatus SetIsStruct | ( | bool | value | ) |
Sets the bool value of whether this class can be used as a struct.