openDAQ
Open data acquisition platform
IEnumerationType Struct Referenceabstract

Enumeration types define the enumerator names and values of Enumerations with a name matching that of the Enumeration type. More...

+ Inheritance diagram for IEnumerationType:
+ Collaboration diagram for IEnumerationType:

Detailed Description

Enumeration types define the enumerator names and values of Enumerations with a name matching that of the Enumeration type.

An Enumeration type provides a String-type name, a list of enumerator names (list of Strings) and a list of enumerator values (list of Integer objects). To use Enumeration types for creating Enumeration objects, they must be added to the Type Manager. Alternatively, if an Enumeration is created without a matching Enumeration type in the manager, a default Enumeration type is generated based on the enumerator names and values of the created Enumeration object. This generated Enumeration type is then added to the Type Manager.

The enumerator values are represented as a list of Integer objects. These values can be explicitly specified during Enumeration type creation, or only the first enumerator value can be specified, with the rest automatically assigned in ascending order, starting from that value (or from the default '0' value if not specified).

Public Member Functions

virtual ErrCode INTERFACE_FUNC getEnumeratorNames (IList **names)=0
 Gets the list of enumerator names. More...
 
virtual ErrCode INTERFACE_FUNC getAsDictionary (IDict **dictionary)=0
 Gets the enumerator names and values as a Dictionary. More...
 
virtual ErrCode INTERFACE_FUNC getEnumeratorIntValue (IString *name, Int *value)=0
 Gets the value of enumerator with the specified name. More...
 
virtual ErrCode INTERFACE_FUNC getCount (SizeT *count)=0
 Gets the number of enumerators within the Enumeration Type. 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

◆ getAsDictionary()

virtual ErrCode INTERFACE_FUNC getAsDictionary ( IDict **  dictionary)
pure virtual

Gets the enumerator names and values as a Dictionary.

Parameters
[out]dictionaryThe Dictionary object with enumerator names as keys, and enumerator values as its values.

◆ getCount()

virtual ErrCode INTERFACE_FUNC getCount ( SizeT *  count)
pure virtual

Gets the number of enumerators within the Enumeration Type.

Parameters
[out]countThe number of enumerators within the Enumeration Type.

◆ getEnumeratorIntValue()

virtual ErrCode INTERFACE_FUNC getEnumeratorIntValue ( IString name,
Int *  value 
)
pure virtual

Gets the value of enumerator with the specified name.

Parameters
nameThe name of the enumerator (String object).
[out]valueThe integer value of the enumerator with the specified name.

◆ getEnumeratorNames()

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

Gets the list of enumerator names.

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