mn::ILockObject Class Referenceabstract

#include <mn_lock.hpp>

+ Inheritance diagram for mn::ILockObject:
+ Collaboration diagram for mn::ILockObject:

Public Types

using this_type = ILockObject
 

Public Member Functions

 ILockObject ()
 
virtual int lock (unsigned int timeout=0)=0
 
virtual int time_lock (const struct timespec *timeout)=0
 
virtual int unlock ()=0
 
virtual bool try_lock ()
 
virtual bool is_initialized () const =0
 
virtual bool is_locked () const =0
 Is locked? More...
 

Detailed Description

Interface for all lock types in this library This is an abstract base class. To use this, you need to subclass it. All of your LockObjetcs should be derived from the ILockObject class. Then implement the virtual lock, unlock and is_initialized functions.

Member Typedef Documentation

◆ this_type

Constructor & Destructor Documentation

◆ ILockObject()

mn::ILockObject::ILockObject ( )
inline

Member Function Documentation

◆ is_initialized()

virtual bool mn::ILockObject::is_initialized ( ) const
pure virtual

Is the ILockObject created (initialized) ?

Returns
true if the ILockObject created (initialized) and false when not

Implemented in mn::basic_null_lock, mn::basic_semaphore, and mn::atomic_spinlock< T >.

◆ is_locked()

virtual bool mn::ILockObject::is_locked ( ) const
pure virtual

Is locked?

Returns
True if locked and false when not.

Implemented in mn::basic_semaphore.

◆ lock()

virtual int mn::ILockObject::lock ( unsigned int  timeout = 0)
pure virtual

◆ time_lock()

virtual int mn::ILockObject::time_lock ( const struct timespec *  timeout)
pure virtual

◆ try_lock()

virtual bool mn::ILockObject::try_lock ( )
inlinevirtual

Try to lock the ILockObject

Note
call lock with timeout from 0
Returns
true if the Lock was acquired, false when not

Reimplemented in mn::system::basic_critical_section_timedout, and mn::atomic_spinlock< T >.

◆ unlock()


The documentation for this class was generated from the following file: