openDAQ
Open data acquisition platform
Factories
+ Collaboration diagram for Factories:

Detailed Description

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

Function Documentation

◆ Struct()

StructPtr Struct ( const StringPtr name,
const DictPtr< IString, IBaseObject > &  fields,
const TypeManagerPtr typeManager 
)
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.

Parameters
nameThe name of the struct and its corresponding Struct type.
fieldsThe dictionary of field names as keys, and corresponding field values as dictionary values.
typeManagerThe 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.

◆ StructType() [1/2]

StructTypePtr StructType ( const StringPtr name,
const ListPtr< IString > &  fieldNames,
const ListPtr< IBaseObject > &  defaultValues,
const ListPtr< IType > &  fieldTypes 
)
inline

Creates a Struct type with a given name, fieldn ames, default values, and field types.

Parameters
nameThe name of the Struct type
fieldNamesThe list of field names (String objects)
defaultValuesThe list of default values (Base objects)
fieldTypesThe 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.

◆ StructType() [2/2]

StructTypePtr StructType ( const StringPtr name,
const ListPtr< IString > &  fieldNames,
const ListPtr< IType > &  fieldTypes 
)
inline

Creates a Struct type with a given name, field names and field types.

Parameters
nameThe name of the Struct type
fieldNamesThe list of field names (String objects)
fieldTypesThe 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.