openDAQ
Open data acquisition platform
IUserLock Struct Referenceabstract

This class manages the lock state of an object, usually a device. A device can be locked either with a specific user or without one. If the device is locked with a specific user, only that user can unlock it. If the device is locked without a user, any user can unlock it. More...

+ Inheritance diagram for IUserLock:
+ Collaboration diagram for IUserLock:

Detailed Description

This class manages the lock state of an object, usually a device. A device can be locked either with a specific user or without one. If the device is locked with a specific user, only that user can unlock it. If the device is locked without a user, any user can unlock it.

Public Member Functions

virtual ErrCode INTERFACE_FUNC lock (IUser *user=nullptr)=0
 Lock the object. Only the user who locked the object can unlock it. If the object was locked without a specific user, or with an anonymous user, any user can unlock it. More...
 
virtual ErrCode INTERFACE_FUNC unlock (IUser *user=nullptr)=0
 Unlock the object. Only the user who locked the object can unlock it. If the object was locked without a specific user, or with an anonymous user, any user can unlock it. More...
 
virtual ErrCode INTERFACE_FUNC forceUnlock ()=0
 Forcefully unlock the object. A force unlock will always succeed, regardless of which user initially locked the object.
 
virtual ErrCode INTERFACE_FUNC isLocked (Bool *isLockedOut)=0
 Returns true if the object is locked. 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

◆ isLocked()

virtual ErrCode INTERFACE_FUNC isLocked ( Bool *  isLockedOut)
pure virtual

Returns true if the object is locked.

Parameters
isLockedOut[out]True if the object is locked.

◆ lock()

virtual ErrCode INTERFACE_FUNC lock ( IUser user = nullptr)
pure virtual

Lock the object. Only the user who locked the object can unlock it. If the object was locked without a specific user, or with an anonymous user, any user can unlock it.

Parameters
userUser performing the lock action.

◆ unlock()

virtual ErrCode INTERFACE_FUNC unlock ( IUser user = nullptr)
pure virtual

Unlock the object. Only the user who locked the object can unlock it. If the object was locked without a specific user, or with an anonymous user, any user can unlock it.

Parameters
userUser performing the unlock action.