![]() |
Safir SDK Core
|
Operations on DOB types. More...
Functions | |
Type information operations | |
DOTS_CPP_API Dob::Typesystem::Int32 | GetNumberOfTypeIds () |
Get the number of type id's defined in the system. | |
DOTS_CPP_API Dob::Typesystem::Int32 | GetNumberOfClasses () |
Get the number of classes defined in the system. | |
DOTS_CPP_API Dob::Typesystem::Int32 | GetNumberOfProperties () |
Get the number of properties defined in the system. | |
DOTS_CPP_API Dob::Typesystem::Int32 | GetNumberOfEnumerations () |
Get the number of enum types defined in the system. | |
DOTS_CPP_API TypeIdVector | GetAllTypeIds () |
Get all type id's that exists in the system. | |
DOTS_CPP_API bool | Exists (const Dob::Typesystem::TypeId typeId) |
Check if class with specified type id exist. | |
DOTS_CPP_API bool | IsClass (const Dob::Typesystem::TypeId typeId) |
Check if a type represented by a type id is a class. | |
DOTS_CPP_API bool | IsProperty (const Dob::Typesystem::TypeId typeId) |
Check if a type represented by a type id is a property. | |
DOTS_CPP_API bool | IsEnumeration (const Dob::Typesystem::TypeId typeId) |
Check if a type represented by a type id is an enumeration. | |
DOTS_CPP_API bool | IsException (const Dob::Typesystem::TypeId typeId) |
Check if a type represented by a type id is an exception. | |
DOTS_CPP_API Dob::Typesystem::TypeId | GetTypeId (const std::wstring &typeName) |
Calculates the type id for the given name. | |
DOTS_CPP_API std::wstring | GetName (const Dob::Typesystem::TypeId typeId) |
Gets the name associated with the specified type id. | |
DOTS_CPP_API Dob::Typesystem::Int32 | GetNumberOfEnumerationValues (const Dob::Typesystem::TypeId enumId) |
Get the number of enumeration values the specified enumeration type has. | |
DOTS_CPP_API std::wstring | GetEnumerationValueName (const Dob::Typesystem::TypeId enumId, const Dob::Typesystem::EnumerationValue enumVal) |
Get the string representation of the specified value for a enumeration type. | |
DOTS_CPP_API EnumerationValue | GetEnumerationValue (const Dob::Typesystem::TypeId enumId, const std::wstring &enumValueName) |
Get integer value associated with the enumeration value for the specified enumeration type. | |
DOTS_CPP_API Dob::Typesystem::TypeId | GetEnumerationChecksum (const Dob::Typesystem::TypeId enumId) |
Get the Checksum over all enumeration members for an enumeration type. | |
Type compatibility | |
DOTS_CPP_API bool | IsOfType (const Dob::Typesystem::TypeId type, const Dob::Typesystem::TypeId ofType) |
Checks if type is ofType or a subclass of ofType. | |
DOTS_CPP_API TypeIdVector | GetClassTree (const Dob::Typesystem::TypeId rootClass) |
Returns a list of all type id's that is of the given type by inheritance. | |
DOTS_CPP_API Dob::Typesystem::TypeId | GetParentType (const Dob::Typesystem::TypeId type) |
Returns the typeId of the base class to the argument type. | |
DOTS_CPP_API bool | HasProperty (const Dob::Typesystem::TypeId classType, const Dob::Typesystem::TypeId propertyType) |
Checks if the a class has a property. | |
DOTS_CPP_API void | HasProperty (const Dob::Typesystem::TypeId classType, const Dob::Typesystem::TypeId propertyType, bool &hasProperty, bool &isInherited) |
Checks if the a class has a property and if it is inherited. | |
Operations on DOB types.
DOTS_CPP_API bool Safir::Dob::Typesystem::Operations::Exists | ( | const Dob::Typesystem::TypeId | typeId | ) |
Check if class with specified type id exist.
typeId | [in] - Type id of class. |
DOTS_CPP_API TypeIdVector Safir::Dob::Typesystem::Operations::GetAllTypeIds | ( | ) |
Get all type id's that exists in the system.
DOTS_CPP_API TypeIdVector Safir::Dob::Typesystem::Operations::GetClassTree | ( | const Dob::Typesystem::TypeId | rootClass | ) |
Returns a list of all type id's that is of the given type by inheritance.
The type 'rootClass' will also be inserted in the list. If for example type A is the base class for type B and type C, GetClassTree(A::ClassTypeId) will return a list with A, B and C.
rootClass | [in] - The base type. |
DOTS_CPP_API Dob::Typesystem::TypeId Safir::Dob::Typesystem::Operations::GetEnumerationChecksum | ( | const Dob::Typesystem::TypeId | enumId | ) |
Get the Checksum over all enumeration members for an enumeration type.
enumId | [in] - Type id of enum type. |
IllegalValueException | There is no such type defined or it is not an enumeration. |
DOTS_CPP_API EnumerationValue Safir::Dob::Typesystem::Operations::GetEnumerationValue | ( | const Dob::Typesystem::TypeId | enumId, |
const std::wstring & | enumValueName ) |
Get integer value associated with the enumeration value for the specified enumeration type.
enumId | [in] - Type id of enum type. |
enumValueName | [in] - String representation of the desired value. |
IllegalValueException | There is no such type defined or it is not an enumeration. |
DOTS_CPP_API std::wstring Safir::Dob::Typesystem::Operations::GetEnumerationValueName | ( | const Dob::Typesystem::TypeId | enumId, |
const Dob::Typesystem::EnumerationValue | enumVal ) |
Get the string representation of the specified value for a enumeration type.
enumId | [in] - Type id of enum type. |
enumVal | [in] - The enumeration value. |
IllegalValueException | There is no such type defined or it is not an enumeration. |
DOTS_CPP_API std::wstring Safir::Dob::Typesystem::Operations::GetName | ( | const Dob::Typesystem::TypeId | typeId | ) |
Gets the name associated with the specified type id.
typeId | [in] - The type id to get the real name of. |
IllegalValueException | There is no such type defined. |
DOTS_CPP_API Dob::Typesystem::Int32 Safir::Dob::Typesystem::Operations::GetNumberOfClasses | ( | ) |
Get the number of classes defined in the system.
DOTS_CPP_API Dob::Typesystem::Int32 Safir::Dob::Typesystem::Operations::GetNumberOfEnumerations | ( | ) |
Get the number of enum types defined in the system.
DOTS_CPP_API Dob::Typesystem::Int32 Safir::Dob::Typesystem::Operations::GetNumberOfEnumerationValues | ( | const Dob::Typesystem::TypeId | enumId | ) |
Get the number of enumeration values the specified enumeration type has.
enumId | [in] - Type id of enum type. |
IllegalValueException | There is no such type defined or it is not an enumeration. |
DOTS_CPP_API Dob::Typesystem::Int32 Safir::Dob::Typesystem::Operations::GetNumberOfProperties | ( | ) |
Get the number of properties defined in the system.
DOTS_CPP_API Dob::Typesystem::Int32 Safir::Dob::Typesystem::Operations::GetNumberOfTypeIds | ( | ) |
Get the number of type id's defined in the system.
This is equal to GetNumberOfClasses() + GetNumberOfProperties() + GetNumberOfEnumerations().
DOTS_CPP_API Dob::Typesystem::TypeId Safir::Dob::Typesystem::Operations::GetParentType | ( | const Dob::Typesystem::TypeId | type | ) |
DOTS_CPP_API Dob::Typesystem::TypeId Safir::Dob::Typesystem::Operations::GetTypeId | ( | const std::wstring & | typeName | ) |
Calculates the type id for the given name.
Note that this is a pure mathematical function and will always return the correct typeId for a class with the specified name. This function does not give any information about whether a class with the specified name actually exist in the system. Use Exists to check if a class with the typeId returned from this function exists. TypeIds for classes and properties are based on namespaces and class name like this: typeName="MyNamespace1.MyNamespace2.MyClass" However for enumeration types the type id also contains the enum values, like this: typeName="MyNamespace1.MyNamespace2.MyEnumType.EnumValue1.EnumValue2.EnumValue3"
typeName | [in] - The name shall contain namespaces and class name with '.' as separator, example "MyNamespace1.MyNamespace2.MyClass" |
DOTS_CPP_API bool Safir::Dob::Typesystem::Operations::HasProperty | ( | const Dob::Typesystem::TypeId | classType, |
const Dob::Typesystem::TypeId | propertyType ) |
Checks if the a class has a property.
classType | [in] - The type id of the class to check if it has a specific property. |
propertyType | [in] - The type id of the property. |
DOTS_CPP_API void Safir::Dob::Typesystem::Operations::HasProperty | ( | const Dob::Typesystem::TypeId | classType, |
const Dob::Typesystem::TypeId | propertyType, | ||
bool & | hasProperty, | ||
bool & | isInherited ) |
Checks if the a class has a property and if it is inherited.
classType | [in] - The type id of the class to check if it has a specific property. |
propertyType | [in] - The type id of the property. |
hasProperty | [out] - True if the class has the property. |
isInherited | [out] - Indicates whether the property is set on the class itself or whether it was inherited from a parent class. |
DOTS_CPP_API bool Safir::Dob::Typesystem::Operations::IsClass | ( | const Dob::Typesystem::TypeId | typeId | ) |
Check if a type represented by a type id is a class.
Using this function on a typeid that does not exist at all in the system will give false as return value.
typeId | [in] - Type id to check. |
DOTS_CPP_API bool Safir::Dob::Typesystem::Operations::IsEnumeration | ( | const Dob::Typesystem::TypeId | typeId | ) |
Check if a type represented by a type id is an enumeration.
Using this function on a typeid that does not exist at all in the system will give false as return value.
typeId | [in] - Type id to check. |
DOTS_CPP_API bool Safir::Dob::Typesystem::Operations::IsException | ( | const Dob::Typesystem::TypeId | typeId | ) |
Check if a type represented by a type id is an exception.
Using this function on a typeid that does not exist at all in the system will give false as return value.
typeId | [in] - Type id to check. |
DOTS_CPP_API bool Safir::Dob::Typesystem::Operations::IsOfType | ( | const Dob::Typesystem::TypeId | type, |
const Dob::Typesystem::TypeId | ofType ) |
Checks if type is ofType or a subclass of ofType.
type | [in] - The type to check if it is of another type. |
ofType | [in] - The type to compare to. |
DOTS_CPP_API bool Safir::Dob::Typesystem::Operations::IsProperty | ( | const Dob::Typesystem::TypeId | typeId | ) |
Check if a type represented by a type id is a property.
Using this function on a typeid that does not exist at all in the system will give false as return value.
typeId | [in] - Type id to check. |