Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
BodyLockInterface Class Referenceabstract

Base class interface for locking a body. Usually you will use BodyLockRead / BodyLockWrite / BodyLockMultiRead / BodyLockMultiWrite instead. More...

#include <BodyLockInterface.h>

Inheritance diagram for BodyLockInterface:
NonCopyable BodyLockInterfaceLocking BodyLockInterfaceNoLock

Public Types

using MutexMask = BodyManager::MutexMask
 Redefine MutexMask.
 

Public Member Functions

 BodyLockInterface (BodyManager &inBodyManager)
 Constructor.
 
virtual ~BodyLockInterface ()=default
 
MutexMask GetAllBodiesMutexMask () const
 Get the mask needed to lock all bodies.
 
BodyTryGetBody (const BodyID &inBodyID) const
 Convert body ID to body.
 
Locking functions
virtual SharedMutexLockRead (const BodyID &inBodyID) const =0
 
virtual void UnlockRead (SharedMutex *inMutex) const =0
 
virtual SharedMutexLockWrite (const BodyID &inBodyID) const =0
 
virtual void UnlockWrite (SharedMutex *inMutex) const =0
 
Batch locking functions
virtual MutexMask GetMutexMask (const BodyID *inBodies, int inNumber) const =0
 
virtual void LockRead (MutexMask inMutexMask) const =0
 
virtual void UnlockRead (MutexMask inMutexMask) const =0
 
virtual void LockWrite (MutexMask inMutexMask) const =0
 
virtual void UnlockWrite (MutexMask inMutexMask) const =0
 
- Public Member Functions inherited from NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
void operator= (const NonCopyable &)=delete
 

Protected Attributes

BodyManagermBodyManager
 

Detailed Description

Base class interface for locking a body. Usually you will use BodyLockRead / BodyLockWrite / BodyLockMultiRead / BodyLockMultiWrite instead.

Member Typedef Documentation

◆ MutexMask

Constructor & Destructor Documentation

◆ BodyLockInterface()

BodyLockInterface::BodyLockInterface ( BodyManager inBodyManager)
inlineexplicit

Constructor.

◆ ~BodyLockInterface()

virtual BodyLockInterface::~BodyLockInterface ( )
virtualdefault

Member Function Documentation

◆ GetAllBodiesMutexMask()

MutexMask BodyLockInterface::GetAllBodiesMutexMask ( ) const
inline

Get the mask needed to lock all bodies.

◆ GetMutexMask()

virtual MutexMask BodyLockInterface::GetMutexMask ( const BodyID inBodies,
int  inNumber 
) const
pure virtual

◆ LockRead() [1/2]

virtual SharedMutex * BodyLockInterface::LockRead ( const BodyID inBodyID) const
pure virtual

◆ LockRead() [2/2]

virtual void BodyLockInterface::LockRead ( MutexMask  inMutexMask) const
pure virtual

◆ LockWrite() [1/2]

virtual SharedMutex * BodyLockInterface::LockWrite ( const BodyID inBodyID) const
pure virtual

◆ LockWrite() [2/2]

virtual void BodyLockInterface::LockWrite ( MutexMask  inMutexMask) const
pure virtual

◆ TryGetBody()

Body * BodyLockInterface::TryGetBody ( const BodyID inBodyID) const
inline

Convert body ID to body.

◆ UnlockRead() [1/2]

virtual void BodyLockInterface::UnlockRead ( MutexMask  inMutexMask) const
pure virtual

◆ UnlockRead() [2/2]

virtual void BodyLockInterface::UnlockRead ( SharedMutex inMutex) const
pure virtual

◆ UnlockWrite() [1/2]

virtual void BodyLockInterface::UnlockWrite ( MutexMask  inMutexMask) const
pure virtual

◆ UnlockWrite() [2/2]

virtual void BodyLockInterface::UnlockWrite ( SharedMutex inMutex) const
pure virtual

Member Data Documentation

◆ mBodyManager

BodyManager& BodyLockInterface::mBodyManager
protected

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