26 template<
class CycleDataType>
30 _current_thread(current_thread)
32 _pointer = _cycler->write(_current_thread);
33 nassertv(_pointer != (CycleDataType *)NULL);
47 template<
class CycleDataType>
52 _current_thread(current_thread)
54 _pointer = _cycler->write_upstream(force_to_0, _current_thread);
55 nassertv(_pointer != (CycleDataType *)NULL);
70 template<
class CycleDataType>
75 _current_thread(current_thread)
77 _pointer = locked_cdata;
78 nassertv(_pointer != (CycleDataType *)NULL);
86 template<
class CycleDataType>
89 _cycler(copy._cycler),
90 _current_thread(copy._current_thread),
91 _pointer(copy._pointer)
93 nassertv(_pointer != (CycleDataType *)NULL);
94 _cycler->increment_write(_pointer);
102 template<
class CycleDataType>
105 nassertv(_pointer == (CycleDataType *)NULL);
106 nassertv(_current_thread == copy._current_thread);
108 _cycler = copy._cycler;
109 _pointer = copy._pointer;
111 nassertv(_pointer != (CycleDataType *)NULL);
112 _cycler->increment_write(_pointer);
122 template<
class CycleDataType>
127 _current_thread(take_from.get_current_thread())
129 _pointer = _cycler->elevate_read(take_from.
take_pointer(), _current_thread);
141 template<
class CycleDataType>
147 _current_thread(take_from.get_current_thread())
149 _pointer = _cycler->elevate_read_upstream(take_from.
take_pointer(),
150 force_to_0, _current_thread);
158 template<
class CycleDataType>
161 if (_pointer != (CycleDataType *)NULL) {
162 _cycler->release_write(_pointer);
172 template<
class CycleDataType>
175 nassertr(_pointer != (CycleDataType *)NULL, _cycler->cheat());
185 template<
class CycleDataType>
188 nassertr(_pointer != (CycleDataType *)NULL, _cycler->cheat());
198 template<
class CycleDataType>
200 operator CycleDataType * () {
201 nassertr(_pointer != (CycleDataType *)NULL, _cycler->cheat());
211 template<
class CycleDataType>
214 return _current_thread;
217 #else // !DO_PIPELINING
225 template<
class CycleDataType>
228 _pointer = cycler.
cheat();
236 template<
class CycleDataType>
239 _pointer = cycler.
cheat();
247 template<
class CycleDataType>
251 _pointer = locked_cdata;
259 template<
class CycleDataType>
262 _pointer(copy._pointer)
271 template<
class CycleDataType>
274 _pointer = copy._pointer;
284 template<
class CycleDataType>
288 _pointer((CycleDataType *)take_from.take_pointer())
301 template<
class CycleDataType>
306 _pointer((CycleDataType *)take_from.take_pointer())
315 template<
class CycleDataType>
326 template<
class CycleDataType>
338 template<
class CycleDataType>
350 template<
class CycleDataType>
352 operator CycleDataType * () {
362 template<
class CycleDataType>
368 #endif // DO_PIPELINING
This class maintains different copies of a page of data between stages of the graphics pipeline (or a...
CycleDataType * operator->()
This provides an indirect member access to the actual CycleData data.
Thread * get_current_thread() const
Returns the Thread pointer of the currently-executing thread, as passed to the constructor of this ob...
static Thread * get_current_thread()
Returns a pointer to the currently-executing Thread object.
const CycleDataType * take_pointer()
This is intended to be called only from CycleDataWriter when it elevates the pointer from read to wri...
This template class calls PipelineCycler::read() in the constructor and PipelineCycler::release_read(...
CycleDataType * cheat() const
Returns a pointer without counting it.
This template class calls PipelineCycler::write() in the constructor and PipelineCycler::release_writ...
A thread; that is, a lightweight process.