openDAQ
Open data acquisition platform
IComparable Struct Referenceabstract

Enables comparison to another object. More...

+ Inheritance diagram for IComparable:
+ Collaboration diagram for IComparable:

Detailed Description

Enables comparison to another object.

Use this interface to compare the object to another object. his interface is implemented by types whose values can be ordered or sorted. It requires that implementing types define a single method, compareTo, that indicates whether the position of the current instance in the sort order is before, after, or the same as a second object of the same type.

Public Member Functions

virtual ErrCode INTERFACE_FUNC compareTo (IBaseObject *obj)=0
 Compares the object to another object. 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

◆ compareTo()

virtual ErrCode INTERFACE_FUNC compareTo ( IBaseObject obj)
pure virtual

Compares the object to another object.

Parameters
objObject for comparison.
Return values
OPENDAQ_LOWERThe object's value is lower than the value of the compared object.
OPENDAQ_HIGHERThe object's value is higher than the value of the compared object.
OPENDAQ_EQUALThe object's value is equal to the value of the compared object.

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.