Functions | |
StructPtr | Struct (const StringPtr &name, const DictPtr< IString, IBaseObject > &fields, const TypeManagerPtr &typeManager) |
Creates a new Struct with a given name and fields. The field names and values must match the Struct type definition of with the given name that's present in the Type manager. If no such Struct type is present, a new one is created and added to the Type manager. More... | |
StructTypePtr | StructType (const StringPtr &name, const ListPtr< IString > &fieldNames, const ListPtr< IBaseObject > &defaultValues, const ListPtr< IType > &fieldTypes) |
Creates a Struct type with a given name, fieldn ames, default values, and field types. More... | |
StructTypePtr | StructType (const StringPtr &name, const ListPtr< IString > &fieldNames, const ListPtr< IType > &fieldTypes) |
Creates a Struct type with a given name, field names and field types. More... | |
|
inline |
Creates a new Struct with a given name and fields. The field names and values must match the Struct type definition of with the given name that's present in the Type manager. If no such Struct type is present, a new one is created and added to the Type manager.
name | The name of the struct and its corresponding Struct type. |
fields | The dictionary of field names as keys, and corresponding field values as dictionary values. |
typeManager | The type manager that holds various Struct types (and other openDAQ types). |
Construction of the struct will fail if the field names do not match the corresponding type available in the Type manager. Similarly, construction will fail if the field values are of different types than those defined in the Type manager. If a field that is part of the Struct type is missing from the dictionary of fields, if available, the default value will be used. Otherwise, the value of the field will be set to nullptr
.
Fields of Core type ctUndefined
can have any type value.
|
inline |
Creates a Struct type with a given name, fieldn ames, default values, and field types.
name | The name of the Struct type |
fieldNames | The list of field names (String objects) |
defaultValues | The list of default values (Base objects) |
fieldTypes | The list of field types (Type objects) |
Struct type construction follows the standard rules of Structs. The three lists must be of equal size, and the field types must be of types supported in Structs.
|
inline |
Creates a Struct type with a given name, field names and field types.
name | The name of the Struct type |
fieldNames | The list of field names (String objects) |
fieldTypes | The list of field types (Type objects) |
Struct type construction follows the standard rules of Structs. The two lists must be of equal size, and the field types must be of types supported in Structs.