openDAQ
Open data acquisition platform
IStructType Struct Referenceabstract

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...

+ Inheritance diagram for IStructType:
+ Collaboration diagram for IStructType:

Detailed Description

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...
 
- Public Member Functions inherited from IType
virtual ErrCode INTERFACE_FUNC getName (IString **typeName)=0
 Gets the name of the Type. More...
 
- Public Member Functions inherited from IBaseObject
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...
 
- Public Member Functions inherited from IUnknown
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...
 

Member Function Documentation

◆ getFieldDefaultValues()

virtual ErrCode INTERFACE_FUNC getFieldDefaultValues ( IList **  defaultValues)
pure virtual

Gets the list of field default values.

Parameters
[out]defaultValuesThe list of field default values (Base objects)

◆ getFieldNames()

virtual ErrCode INTERFACE_FUNC getFieldNames ( IList **  names)
pure virtual

Gets the list of field names.

Parameters
[out]namesThe list of field names (String objects)

◆ getFieldTypes()

virtual ErrCode INTERFACE_FUNC getFieldTypes ( IList **  types)
pure virtual

Gets the list of field types.

Parameters
[out]typesThe list of field types (Type objects)