openDAQ
Open data acquisition platform
ITypeManager Struct Referenceabstract

Container for Type objects. The Type manager is used when creating certain types of objects (eg. Structs and Property object classes). The Types stored within the manager contain pre-defined fields, as well as constraints specifying how objects should look. More...

+ Inheritance diagram for ITypeManager:
+ Collaboration diagram for ITypeManager:

Detailed Description

Container for Type objects. The Type manager is used when creating certain types of objects (eg. Structs and Property object classes). The Types stored within the manager contain pre-defined fields, as well as constraints specifying how objects should look.

The currently available types in openDAQ that should be added to the Type manager are the Struct type and the Property object class. The former is used to validate Structs when they are created, while the latter contains pre-defined properties that are added to Property objects on construction.

When adding a Property object class to the manager, they can form inheritance chains with one-another. Thus, a parent of a given class must be added to the manager before any of its children. Likewise, a class cannot be removed before its children are removed.

Public Member Functions

virtual ErrCode INTERFACE_FUNC addType (IType *type)=0
 Adds a type to the manager. More...
 
virtual ErrCode INTERFACE_FUNC removeType (IString *typeName)=0
 Removes the type from the manager. More...
 
virtual ErrCode INTERFACE_FUNC getType (IString *typeName, IType **type)=0
 Gets an added Type by name. More...
 
virtual ErrCode INTERFACE_FUNC getTypes (IList **types)=0
 Gets a list of all added Types. More...
 
virtual ErrCode INTERFACE_FUNC hasType (IString *typeName, Bool *hasType)=0
 Checks if a type with the specified name is already added. 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

◆ addType()

virtual ErrCode INTERFACE_FUNC addType ( IType type)
pure virtual

Adds a type to the manager.

Parameters
typeThe Type to be added.
Return values
OPENDAQ_ERR_ALREADYEXISTSif a type with the same name is already added.
OPENDAQ_ERR_INVALIDPARAMETERif either the type name is an empty string.

The type name must be unique and. If a Property object class specifies a parent class, then the parent class must be added before it.

◆ getType()

virtual ErrCode INTERFACE_FUNC getType ( IString typeName,
IType **  type 
)
pure virtual

Gets an added Type by name.

Parameters
typeNameThe Type's name.
[out]typeThe Type with name equal to name.
Return values
OPENDAQ_ERR_NOTFOUNDif a Type with the specified name is not added.

◆ getTypes()

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

Gets a list of all added Types.

Parameters
[out]typesThe list of all added Types.

◆ hasType()

virtual ErrCode INTERFACE_FUNC hasType ( IString typeName,
Bool *  hasType 
)
pure virtual

Checks if a type with the specified name is already added.

Parameters
typeNameThe name of the checked type.
[out]hasTypeTrue if the type is aready added to the manager; False otherwise.

◆ removeType()

virtual ErrCode INTERFACE_FUNC removeType ( IString typeName)
pure virtual

Removes the type from the manager.

Parameters
typeNameThe type's name.
Return values
OPENDAQ_ERR_NOTFOUNDif the class is not registered.

The removed class must not be a parent of another added class. If it is, those classes must be removed before it.