Pigweed
C/C++ API Reference
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
pw::sync::NoOpLock Class Referencefinal
Inheritance diagram for pw::sync::NoOpLock:
pw::sync::VirtualBasicLockable

Public Member Functions

 NoOpLock (const NoOpLock &)=delete
 
 NoOpLock (NoOpLock &&)=delete
 
NoOpLockoperator= (const NoOpLock &)=delete
 
NoOpLockoperator= (NoOpLock &&)=delete
 
- Public Member Functions inherited from pw::sync::VirtualBasicLockable
void lock ()
 
void unlock ()
 

Static Public Member Functions

static NoOpLockInstance ()
 

Private Member Functions

void DoLockOperation (Operation) override
 

Additional Inherited Members

- Protected Types inherited from pw::sync::VirtualBasicLockable
enum class  Operation { kLock , kUnlock }
 

Detailed Description

The NoOpLock is a type of VirtualBasicLockable that does nothing, i.e. lock operations are no-ops.

Member Function Documentation

◆ DoLockOperation()

void pw::sync::NoOpLock::DoLockOperation ( Operation  operation)
inlineoverrideprivatevirtual

Uses a single virtual method with an enum to minimize the vtable cost per implementation of VirtualBasicLockable.

Implements pw::sync::VirtualBasicLockable.

◆ Instance()

static NoOpLock & pw::sync::NoOpLock::Instance ( )
inlinestatic

Gives access to a global NoOpLock instance. It is not necessary to have multiple NoOpLock instances since they have no state and do nothing.


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