Safir SDK Core
Loading...
Searching...
No Matches
Safir::Dob::Typesystem::Members Namespace Reference

Functions for getting member information from types. More...

Functions

DOTS_CPP_API Dob::Typesystem::Int32 GetNumberOfMembers (const Dob::Typesystem::TypeId typeId)
 Get the number of members for a class or property.
 
DOTS_CPP_API Dob::Typesystem::MemberIndex GetIndex (const Dob::Typesystem::TypeId typeId, const std::wstring &memberName)
 Get the member index of a named member.
 
DOTS_CPP_API std::wstring GetName (const Dob::Typesystem::TypeId typeId, const Dob::Typesystem::MemberIndex member)
 Get the name of the specified member as it was defined in the xml description.
 
DOTS_CPP_API std::wstring GetTypeName (const Dob::Typesystem::TypeId typeId, const Dob::Typesystem::MemberIndex member)
 Get the type name of the specified member as it was defined in the xml description.
 
DOTS_CPP_API Dob::Typesystem::TypeId GetTypeId (const Dob::Typesystem::TypeId typeId, const Dob::Typesystem::MemberIndex member)
 Get type id of object or enumeration member.
 
DOTS_CPP_API void GetInfo (const Dob::Typesystem::TypeId typeId, const Dob::Typesystem::MemberIndex member, Dob::Typesystem::MemberType &memberType, Dob::Typesystem::MemberType &keyType, const char *&memberName, Dob::Typesystem::TypeId &memberTypeId, Dob::Typesystem::TypeId &keyTypeId, Dob::Typesystem::Int32 &stringLength, Dob::Typesystem::CollectionType &collectionType, Dob::Typesystem::Int32 &arrayLength)
 Get information about a specific class member.
 
DOTS_CPP_API Dob::Typesystem::Int32 GetArraySize (const Dob::Typesystem::TypeId typeId, const Dob::Typesystem::MemberIndex member)
 Get the array size of a member.
 
DOTS_CPP_API Dob::Typesystem::Int32 GetMaxStringLength (const Dob::Typesystem::TypeId typeId, const Dob::Typesystem::MemberIndex member)
 Get the maximum string length of a member.
 

Detailed Description

Functions for getting member information from types.

With these operations you can get information on types regarding their members. You can get member names and indexes. You can get TypeIds of members etc.

Function Documentation

◆ GetArraySize()

DOTS_CPP_API Dob::Typesystem::Int32 Safir::Dob::Typesystem::Members::GetArraySize ( const Dob::Typesystem::TypeId typeId,
const Dob::Typesystem::MemberIndex member )

Get the array size of a member.

Parameters
typeId[in] - TypeId of class.
member[in] - Index of member.
Returns
The array size of the member.
Exceptions
IllegalValueExceptionThere is no such class defined or there is no such member in the type.

◆ GetIndex()

DOTS_CPP_API Dob::Typesystem::MemberIndex Safir::Dob::Typesystem::Members::GetIndex ( const Dob::Typesystem::TypeId typeId,
const std::wstring & memberName )

Get the member index of a named member.

Parameters
typeId[in] - TypeId of class or property.
memberName[in] - name of member as specified in xml description, case sensitive.
Returns
Member index of the member.
Exceptions
IllegalValueExceptionThere is no such type defined or there is no such member in the type.

◆ GetInfo()

DOTS_CPP_API void Safir::Dob::Typesystem::Members::GetInfo ( const Dob::Typesystem::TypeId typeId,
const Dob::Typesystem::MemberIndex member,
Dob::Typesystem::MemberType & memberType,
Dob::Typesystem::MemberType & keyType,
const char *& memberName,
Dob::Typesystem::TypeId & memberTypeId,
Dob::Typesystem::TypeId & keyTypeId,
Dob::Typesystem::Int32 & stringLength,
Dob::Typesystem::CollectionType & collectionType,
Dob::Typesystem::Int32 & arrayLength )

Get information about a specific class member.

Parameters
typeId[in] - TypeId of class or property.
member[in] - Index of member.
memberType[out] - The type of the member.
keyType[out] - The type of the key if the member is a dictionary, otherwise undefined.
memberName[out] - The name of the member.
memberTypeId[out] - if memberType is object or enumeration, this is the typeId of that type. If memberType is something else the value is -1.
keyTypeId[out] - if the member is a dictionary and the key type is an enumeration this is the type id of the enumeration. Otherwise undefined. If memberType is something else the value is -1.
stringLength[out] - If memberType is string and the type is a class (not property) then this is the length of the string.
collectionType[out] - The member collection type, can be single value, array, sequence or dictionary.
arrayLength[out] - Maximum capacity of array if the member collection type is an array (1 if not an array). Not applicable if type id is a property.
Exceptions
IllegalValueExceptionThere is no such type defined or there is no such member in the type.

◆ GetMaxStringLength()

DOTS_CPP_API Dob::Typesystem::Int32 Safir::Dob::Typesystem::Members::GetMaxStringLength ( const Dob::Typesystem::TypeId typeId,
const Dob::Typesystem::MemberIndex member )

Get the maximum string length of a member.

Parameters
typeId[in] - TypeId of class.
member[in] - Index of member.
Returns
The maximum length of the string member.
Exceptions
IllegalValueExceptionThere is no such class defined or there is no such member in the type or the member is not a string.

◆ GetName()

DOTS_CPP_API std::wstring Safir::Dob::Typesystem::Members::GetName ( const Dob::Typesystem::TypeId typeId,
const Dob::Typesystem::MemberIndex member )

Get the name of the specified member as it was defined in the xml description.

Parameters
typeId[in] - TypeId of class or property.
member[in] - Index of member.
Returns
Name of member.
Exceptions
IllegalValueExceptionThere is no such type defined or there is no such member in the type.

◆ GetNumberOfMembers()

DOTS_CPP_API Dob::Typesystem::Int32 Safir::Dob::Typesystem::Members::GetNumberOfMembers ( const Dob::Typesystem::TypeId typeId)

Get the number of members for a class or property.

Parameters are not included.

Parameters
typeId[in] - TypeId of class or property.
Returns
Number of members in the class.
Exceptions
IllegalValueExceptionThere is no such type defined.

◆ GetTypeId()

DOTS_CPP_API Dob::Typesystem::TypeId Safir::Dob::Typesystem::Members::GetTypeId ( const Dob::Typesystem::TypeId typeId,
const Dob::Typesystem::MemberIndex member )

Get type id of object or enumeration member.

If a member is of type object or enumeration, this method can be used to get the typeId for the class or enum that the member is of.

Parameters
typeId[in] - TypeId of class or property.
member[in] - Index of member.
Returns
The TypeId for the object or enumeration member.
Exceptions
IllegalValueExceptionThere is no such type defined or there is no such member in the type or the member is not an enum or object.

◆ GetTypeName()

DOTS_CPP_API std::wstring Safir::Dob::Typesystem::Members::GetTypeName ( const Dob::Typesystem::TypeId typeId,
const Dob::Typesystem::MemberIndex member )

Get the type name of the specified member as it was defined in the xml description.

Parameters
typeId[in] - TypeId of class or property.
member[in] - Index of member.
Returns
Member type name.
Exceptions
IllegalValueExceptionThere is no such type defined or there is no such member in the type.