Inherits IUnknown.
Inherited by IAddressInfoBuilder, IAddressInfoPrivate, IAllocator, IArgumentInfo, IAuthenticationProvider, IAwaitable, IBinaryData, IBlockReaderBuilder, IBoolean, ICallableInfo, ICloneable, ICoercer, IComparable, IComplexNumber, IComponentDeserializeContext, IComponentHolder, IComponentPrivate, IComponentStatusContainer, IComponentStatusContainerPrivate, IComponentType, IComponentTypeBuilder, IComponentUpdateContext, IConfigProvider, IConnection, IConnectionInternal, IContext, IContextInternal, IConvertible, ICoreType, IDataDescriptor, IDataDescriptorBuilder, IDataRule, IDataRuleBuilder, IDataRuleCalcPrivate, IDeleter, IDeserializeComponent, IDeserializer, IDeviceDomain, IDeviceInfoInternal, IDevicePrivate, IDict, IDictElementType, IDimension, IDimensionBuilder, IDimensionRule, IDimensionRuleBuilder, IDiscoveryServer, IEnumeration, IErrorInfo, IEvalValue, IEvent, IEventArgs, IEventHandler, IFloat, IFreezable, IFunction, IFunctionBlockWrapper, IGraphVisualization, IInputPortNotifications, IInputPortPrivate, IInspectable, IInstanceBuilder, IInteger, IIterable, IIterator, ILastMessageLoggerSinkPrivate, IList, IListElementType, ILogFileInfo, ILogFileInfoBuilder, ILogger, ILoggerComponent, ILoggerSink, ILoggerSinkBasePrivate, ILoggerThreadPool, ILoggerThreadPoolPrivate, IMirroredSignalPrivate, IMockChannel, IMockDefaultDevice, IModule, IModuleManager, IModuleManagerUtils, IMultiReaderBuilder, INumber, IOwnable, IPacket, IPacketDestructCallback, IPermissionManager, IPermissionManagerInternal, IPermissionMaskBuilder, IPermissions, IPermissionsBuilder, IPermissionsInternal, IProcedure, IProperty, IPropertyBuilder, IPropertyInternal, IPropertyObject, IPropertyObjectClassBuilder, IPropertyObjectInternal, IPropertyObjectProtected, IRange, IRatio, IReader, IReaderConfig, IReaderStatus, IRecursiveSearch, IReferenceDomainInfo, IReferenceDomainInfoBuilder, IRemovable, IReusableDataPacket, IRulePrivate, IScaling, IScalingBuilder, IScalingCalcPrivate, IScheduler, ISearchFilter, ISerializable, ISerializedList, ISerializedObject, ISerializer, ISignalEvents, ISignalPrivate, IStreaming, IStreamingPrivate, IStreamReaderBuilder, IString, IStruct, IStructBuilder, ISupportsWeakRef, ISyncComponentPrivate, ITags, ITagsPrivate, ITailReaderBuilder, ITask, ITaskInternal, IType, ITypeManager, ITypeManagerPrivate, IUnit, IUnitBuilder, IUpdatable, IUser, IUserInternal, IUserLock, IValidator, IVersionInfo, IWeakRef, and IWork.
Extends IUnknown
by providing additional methods for borrowing interfaces, hashing, and equality comparison. All openDAQ objects implement IBaseObject
interface or its descendants. Hashing and equality comparison provides the ability to use the object as an element in dictionaries and lists. Classes that implement any interface derived from IBaseObject
should be derived from ImplementationOf
class, which provides the default implementation of IBaseObject
interface methods.
Available factories:
Public Member Functions | |
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... | |
![]() | |
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... | |
|
pure virtual |
Returns another interface which is supported by the object without incrementing the reference count.
intfID | Interface ID of requested interface. | |
[out] | obj | Pointer to the new interface. |
This method is similar to queryInterface
, however, it does not increment the reference count. Use this method if you need to get another interface to the object and the lifetime of the new interface is shorter than the lifetime of the original interface.
Typical scenario is when an interface is passed as a parameter to a function and in this function you need another interface to the object, but only within the scope of this function call. The object will not be destroyed before the function is exited, because the caller is responsible for holding the reference to the object.
Example:
|
pure virtual |
Disposes all references held by the object.
An object that holds references to other interfaces must reset these references to null in dispose
. This method is called automatically when the reference count drops to zero.
Call this method manually to break cycle references. If two objects have reference to each other, calling dispose
will break cycle references.
After dispose
is called, the object should not be accessed again, except by calling releaseRef
function.
|
pure virtual |
Compares object to another object for equality.
other | Interface to another object for comparison. |
equal | Value indicating if the other is equivalent to this one. |
For reference objects, it compares the address of the object. For value objects, such as numbers and strings, it compares values.
ImplementationOf
which provides default implementation of IBaseObject
uses pointer address to compare for equality.
|
pure virtual |
Returns hash code of the object.
[out] | hashCode | Hash code. |
The object should calculate and return the hash code. For reference objects, it is usually calculated from pointer address. For value objects, such as numbers and strings, it is calculated from value.
ImplementationOf
object which provides default implementation of IBaseObject
uses pointer address to calculate hash code.
If the object calculates the hash code from some value stored in the object, it is mandatory to make this value (or the object) immutable. The hash code of the object should not change. If a dictionary stores the object as a key, it will corrupt the hash table.
|
pure virtual |
Returns a string representation of the object.
[out] | str | String representation of the object. |
Call this method to convert the object to its string representation.
ImplementationOf
object which provides default implementation of IBaseObject
uses pointer address for string representation.
Return value str
should be de-allocated by the caller using daqFreeMemory
function.