Panda3D
|
This template class calls PipelineCycler::read() in the constructor and PipelineCycler::release_read() in the destructor. More...
#include "cycleDataLockedReader.h"
Public Member Functions | |
CycleDataLockedReader (const CycleDataLockedReader< CycleDataType > ©) | |
CycleDataLockedReader (const PipelineCycler< CycleDataType > &cycler, Thread *current_thread=Thread::get_current_thread()) | |
CycleDataLockedReader (CycleDataLockedReader< CycleDataType > &&from) noexcept | |
Thread * | get_current_thread () const |
Returns the Thread pointer of the currently-executing thread, as passed to the constructor of this object. More... | |
operator const CycleDataType * () const | |
This allows the CycleDataLockedReader to be passed to any function that expects a const CycleDataType pointer. More... | |
const CycleDataType * | operator-> () const |
This provides an indirect member access to the actual CycleData data. More... | |
void | operator= (const CycleDataLockedReader< CycleDataType > ©) |
void | operator= (CycleDataLockedReader< CycleDataType > &&from) noexcept |
const CycleDataType * | take_pointer () |
This is intended to be called only from CycleDataWriter when it elevates the pointer from read to write status. More... | |
This template class calls PipelineCycler::read() in the constructor and PipelineCycler::release_read() in the destructor.
In the interim, it provides a transparent read-only access to the CycleData.
Since a lock is held on the data while the instance of this class exists, no other thread may modify any stage of the pipeline during that time. Thus, this class is appropriate to use for cases in which you might want to read and then modify the data. It is possible to pass an instance of CycleDataLockedReader to the CycleDataWriter constructor, which automatically elevates the read lock into a write lock.
It exists as a syntactic convenience to access the data in the CycleData. It also allows the whole system to compile down to nothing if DO_PIPELINING is not defined.
Definition at line 40 of file cycleDataLockedReader.h.
|
inline |
Returns the Thread pointer of the currently-executing thread, as passed to the constructor of this object.
Definition at line 236 of file cycleDataLockedReader.I.
|
inline |
This allows the CycleDataLockedReader to be passed to any function that expects a const CycleDataType pointer.
Definition at line 214 of file cycleDataLockedReader.I.
|
inline |
This provides an indirect member access to the actual CycleData data.
Definition at line 204 of file cycleDataLockedReader.I.
|
inline |
This is intended to be called only from CycleDataWriter when it elevates the pointer from read to write status.
This function returns the reader's pointer and relinquishes ownership of the pointer, rendering the reader invalid for future reads.
Definition at line 226 of file cycleDataLockedReader.I.