26 template<
class CycleDataType>
31 _current_thread(current_thread),
34 _pointer = _cycler->write_stage(_stage, _current_thread);
35 nassertv(_pointer != (CycleDataType *)NULL);
43 template<
class CycleDataType>
46 bool force_to_0,
Thread *current_thread) :
48 _current_thread(current_thread),
51 _pointer = _cycler->write_stage_upstream(_stage, force_to_0, _current_thread);
52 nassertv(_pointer != (CycleDataType *)NULL);
60 template<
class CycleDataType>
63 _cycler(copy._cycler),
64 _current_thread(copy._current_thread),
65 _pointer(copy._pointer),
68 nassertv(_pointer != (CycleDataType *)NULL);
69 _cycler->increment_write(_pointer);
77 template<
class CycleDataType>
80 nassertv(_pointer == (CycleDataType *)NULL);
81 nassertv(_current_thread == copy._current_thread);
83 _cycler = copy._cycler;
84 _pointer = copy._pointer;
87 nassertv(_pointer != (CycleDataType *)NULL);
88 _cycler->increment_write(_pointer);
98 template<
class CycleDataType>
103 _current_thread(take_from.get_current_thread()),
106 _pointer = _cycler->elevate_read_stage(_stage, take_from.
take_pointer(),
117 template<
class CycleDataType>
123 _current_thread(take_from.get_current_thread()),
126 _pointer = _cycler->elevate_read_stage_upstream(_stage, take_from.
take_pointer(),
127 force_to_0, _current_thread);
135 template<
class CycleDataType>
138 if (_pointer != (CycleDataType *)NULL) {
139 _cycler->release_write_stage(_stage, _pointer);
149 template<
class CycleDataType>
152 nassertr(_pointer != (CycleDataType *)NULL, _cycler->cheat());
162 template<
class CycleDataType>
165 nassertr(_pointer != (CycleDataType *)NULL, _cycler->cheat());
175 template<
class CycleDataType>
177 operator CycleDataType * () {
178 nassertr(_pointer != (CycleDataType *)NULL, _cycler->cheat());
188 template<
class CycleDataType>
191 return _current_thread;
194 #else // !DO_PIPELINING
202 template<
class CycleDataType>
205 _pointer = cycler.
cheat();
213 template<
class CycleDataType>
216 _pointer = cycler.
cheat();
224 template<
class CycleDataType>
227 _pointer(copy._pointer)
236 template<
class CycleDataType>
239 _pointer = copy._pointer;
249 template<
class CycleDataType>
253 _pointer((CycleDataType *)take_from.take_pointer())
264 template<
class CycleDataType>
269 _pointer((CycleDataType *)take_from.take_pointer())
278 template<
class CycleDataType>
289 template<
class CycleDataType>
301 template<
class CycleDataType>
313 template<
class CycleDataType>
315 operator CycleDataType * () {
325 template<
class CycleDataType>
331 #endif // DO_PIPELINING
This class maintains different copies of a page of data between stages of the graphics pipeline (or a...
This class is similar to CycleDataWriter, except it allows writing to a particular stage of the pipel...
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.
Thread * get_current_thread() const
Returns the Thread pointer of the currently-executing thread, as passed to the constructor of this ob...
CycleDataType * operator->()
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.