23 template<
class CycleDataType>
27 _current_thread(current_thread)
29 _pointer = _cycler->write(_current_thread);
30 nassertv(_pointer !=
nullptr);
40 template<
class CycleDataType>
45 _current_thread(current_thread)
47 _pointer = _cycler->write_upstream(force_to_0, _current_thread);
48 nassertv(_pointer !=
nullptr);
59 template<
class CycleDataType>
64 _current_thread(current_thread)
66 _pointer = locked_cdata;
67 nassertv(_pointer !=
nullptr);
73 template<
class CycleDataType>
76 _cycler(copy._cycler),
77 _current_thread(copy._current_thread),
78 _pointer(copy._pointer)
80 nassertv(_pointer !=
nullptr);
81 _cycler->increment_write(_pointer);
87 template<
class CycleDataType>
90 nassertv(_pointer ==
nullptr);
91 nassertv(_current_thread == copy._current_thread);
93 _cycler = copy._cycler;
94 _pointer = copy._pointer;
96 nassertv(_pointer !=
nullptr);
97 _cycler->increment_write(_pointer);
105 template<
class CycleDataType>
110 _current_thread(take_from.get_current_thread())
112 _pointer = _cycler->elevate_read(take_from.
take_pointer(), _current_thread);
121 template<
class CycleDataType>
127 _current_thread(take_from.get_current_thread())
129 _pointer = _cycler->elevate_read_upstream(take_from.
take_pointer(),
130 force_to_0, _current_thread);
136 template<
class CycleDataType>
139 _cycler(from._cycler),
140 _current_thread(from._current_thread),
141 _pointer(from._pointer)
143 from._pointer =
nullptr;
149 template<
class CycleDataType>
152 nassertv(_pointer ==
nullptr);
153 nassertv(_current_thread == from._current_thread);
155 _cycler = from._cycler;
156 _pointer = from._pointer;
158 from._pointer =
nullptr;
164 template<
class CycleDataType>
167 if (_pointer !=
nullptr) {
168 _cycler->release_write(_pointer);
175 template<
class CycleDataType>
178 nassertr(_pointer !=
nullptr, _cycler->cheat());
185 template<
class CycleDataType>
188 nassertr(_pointer !=
nullptr, _cycler->cheat());
196 template<
class CycleDataType>
198 operator CycleDataType * () {
199 nassertr(_pointer !=
nullptr, _cycler->cheat());
207 template<
class CycleDataType>
210 return _current_thread;
213 #else // !DO_PIPELINING 219 template<
class CycleDataType>
222 _pointer = cycler.
cheat();
228 template<
class CycleDataType>
231 _pointer = cycler.
cheat();
237 template<
class CycleDataType>
241 _pointer = locked_cdata;
247 template<
class CycleDataType>
250 _pointer(copy._pointer)
257 template<
class CycleDataType>
260 _pointer = copy._pointer;
268 template<
class CycleDataType>
272 _pointer((CycleDataType *)take_from.take_pointer())
282 template<
class CycleDataType>
287 _pointer((CycleDataType *)take_from.take_pointer())
294 template<
class CycleDataType>
302 template<
class CycleDataType>
311 template<
class CycleDataType>
321 template<
class CycleDataType>
323 operator CycleDataType * () {
331 template<
class CycleDataType>
334 return Thread::get_current_thread();
337 #endif // DO_PIPELINING This class maintains different copies of a page of data between stages of the graphics pipeline (or a...
Thread * get_current_thread() const
Returns the Thread pointer of the currently-executing thread, as passed to the constructor of this ob...
CycleDataType * cheat() const
Returns a pointer without counting it.
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(...
This template class calls PipelineCycler::write() in the constructor and PipelineCycler::release_writ...
CycleDataType * operator ->()
This provides an indirect member access to the actual CycleData data.
A thread; that is, a lightweight process.