Struct types define the fields (names and value types, as well as optional default values) of Structs with a name matching that of the Struct type. More...
Struct types define the fields (names and value types, as well as optional default values) of Structs with a name matching that of the Struct type.
A Struct type contains a String-type name, a list of field names (list of Strings), a list of field types (list of Type objects), and an optional list of Default values (list of Base objects). The Struct types should be added to the Type manager to be used for Struct validation on creation. Alternatively, if a Struct is created with no matching Struct type in the manager, a default Struct type is created based on the field names and types of the Created struct. Said Struct type is then added to the manager.
The field types are a list of Type objects. These determine the types of values that should be used to fill in the corresponding field value. The Type objects at the moment available in openDAQ are Simple types and Struct types. When adding any field other than a Struct type, the Simple type corresponding to the Core type of the value should be created. When adding Struct fields, a Struct type should be added to the field types.
A Struct can only have fields of Core type: ctBool
, ctInt
, ctFloat
, ctString
, ctList
, ctDict
, ctRatio
, ctComplexNumber
, ctStruct
, or ctUndefined
. Additionally, all Container types (ctList
, ctDict
) should only have values of the aforementioned types.
Public Member Functions | |
virtual ErrCode INTERFACE_FUNC | getFieldNames (IList **names)=0 |
Gets the list of field names. More... | |
virtual ErrCode INTERFACE_FUNC | getFieldDefaultValues (IList **defaultValues)=0 |
Gets the list of field default values. More... | |
virtual ErrCode INTERFACE_FUNC | getFieldTypes (IList **types)=0 |
Gets the list of field types. More... | |
![]() | |
virtual ErrCode INTERFACE_FUNC | getName (IString **typeName)=0 |
Gets the name of the Type. More... | |
![]() | |
virtual ErrCode INTERFACE_FUNC | borrowInterface (const IntfID &intfID, void **obj) const =0 |
Returns another interface which is supported by the object without incrementing the reference count. More... | |
virtual ErrCode INTERFACE_FUNC | dispose ()=0 |
Disposes all references held by the object. More... | |
virtual ErrCode INTERFACE_FUNC | getHashCode (SizeT *hashCode)=0 |
Returns hash code of the object. More... | |
virtual ErrCode INTERFACE_FUNC | equals (IBaseObject *other, Bool *equal) const =0 |
Compares object to another object for equality. More... | |
virtual ErrCode INTERFACE_FUNC | toString (CharPtr *str)=0 |
Returns a string representation of the object. More... | |
![]() | |
virtual ErrCode INTERFACE_FUNC | queryInterface (const IntfID &intfID, void **obj)=0 |
Returns another interface which is supported by the object and increments the reference count. More... | |
virtual int INTERFACE_FUNC | addRef ()=0 |
Increments the reference count for an interface on an object. More... | |
virtual int INTERFACE_FUNC | releaseRef ()=0 |
Decrements the reference count for an interface on an object. More... | |
Gets the list of field default values.
[out] | defaultValues | The list of field default values (Base objects) |
Gets the list of field names.
[out] | names | The list of field names (String objects) |