26 template<
class CycleDataType>
29 int stage,
Thread *current_thread) :
31 _current_thread(current_thread),
34 _pointer = _cycler->read_stage(_stage, _current_thread);
35 nassertv(_pointer != (
const CycleDataType *)NULL);
43 template<
class CycleDataType>
46 _cycler(copy._cycler),
47 _current_thread(copy._current_thread),
48 _pointer(copy._pointer),
51 nassertv(_pointer != (
const CycleDataType *)NULL);
52 _cycler->increment_read(_pointer);
60 template<
class CycleDataType>
63 nassertv(_pointer == (CycleDataType *)NULL);
64 nassertv(_current_thread == copy._current_thread);
66 _cycler = copy._cycler;
67 _pointer = copy._pointer;
70 nassertv(_pointer != (
const CycleDataType *)NULL);
71 _cycler->increment_read(_pointer);
79 template<
class CycleDataType>
82 if (_pointer != NULL) {
83 _cycler->release_read_stage(_stage, _pointer);
93 template<
class CycleDataType>
96 nassertr(_pointer != (
const CycleDataType *)NULL, _cycler->cheat());
106 template<
class CycleDataType>
108 operator
const CycleDataType * ()
const {
109 nassertr(_pointer != (
const CycleDataType *)NULL, _cycler->cheat());
123 template<
class CycleDataType>
126 const CycleDataType *pointer = _pointer;
127 _pointer = (CycleDataType *)NULL;
128 nassertr(pointer != (
const CycleDataType *)NULL, _cycler->cheat());
138 template<
class CycleDataType>
141 return _current_thread;
144 #else // !DO_PIPELINING
152 template<
class CycleDataType>
156 _pointer = cycler.
cheat();
164 template<
class CycleDataType>
167 _pointer(copy._pointer)
176 template<
class CycleDataType>
179 _pointer = copy._pointer;
187 template<
class CycleDataType>
198 template<
class CycleDataType>
210 template<
class CycleDataType>
212 operator
const CycleDataType * ()
const {
226 template<
class CycleDataType>
238 template<
class CycleDataType>
244 #endif // DO_PIPELINING
This class maintains different copies of a page of data between stages of the graphics pipeline (or a...
const CycleDataType * take_pointer()
This is intended to be called only from CycleDataStageWriter when it elevates the pointer from read t...
static Thread * get_current_thread()
Returns a pointer to the currently-executing Thread object.
const CycleDataType * operator->() const
This provides an indirect member access to the actual CycleData data.
CycleDataType * cheat() const
Returns a pointer without counting it.
This class is similar to CycleDataLockedReader, except it allows reading from a particular stage of t...
A thread; that is, a lightweight process.
Thread * get_current_thread() const
Returns the Thread pointer of the currently-executing thread, as passed to the constructor of this ob...