23 template<
class CycleDataType>
28 _current_thread(current_thread),
31 _pointer = _cycler->write_stage(_stage, _current_thread);
32 nassertv(_pointer !=
nullptr);
38 template<
class CycleDataType>
41 bool force_to_0,
Thread *current_thread) :
43 _current_thread(current_thread),
46 _pointer = _cycler->write_stage_upstream(_stage, force_to_0, _current_thread);
47 nassertv(_pointer !=
nullptr);
53 template<
class CycleDataType>
56 _cycler(copy._cycler),
57 _current_thread(copy._current_thread),
58 _pointer(copy._pointer),
61 nassertv(_pointer !=
nullptr);
62 _cycler->increment_write(_pointer);
70 template<
class CycleDataType>
75 _current_thread(take_from.get_current_thread()),
78 _pointer = _cycler->elevate_read_stage(_stage, take_from.
take_pointer(),
87 template<
class CycleDataType>
93 _current_thread(take_from.get_current_thread()),
96 _pointer = _cycler->elevate_read_stage_upstream(_stage, take_from.
take_pointer(),
97 force_to_0, _current_thread);
103 template<
class CycleDataType>
106 _cycler(from._cycler),
107 _current_thread(from._current_thread),
108 _pointer(from._pointer),
111 from._pointer =
nullptr;
117 template<
class CycleDataType>
120 nassertv(_pointer ==
nullptr);
121 nassertv(_current_thread == copy._current_thread);
123 _cycler = copy._cycler;
124 _pointer = copy._pointer;
125 _stage = copy._stage;
127 nassertv(_pointer !=
nullptr);
128 _cycler->increment_write(_pointer);
134 template<
class CycleDataType>
137 nassertv(_pointer ==
nullptr);
138 nassertv(_current_thread == from._current_thread);
140 _cycler = from._cycler;
141 _pointer = from._pointer;
142 _stage = from._stage;
144 from._pointer =
nullptr;
150 template<
class CycleDataType>
153 if (_pointer !=
nullptr) {
154 _cycler->release_write_stage(_stage, _pointer);
161 template<
class CycleDataType>
164 nassertr(_pointer !=
nullptr, _cycler->cheat());
171 template<
class CycleDataType>
174 nassertr(_pointer !=
nullptr, _cycler->cheat());
182 template<
class CycleDataType>
184 operator CycleDataType * () {
185 nassertr(_pointer !=
nullptr, _cycler->cheat());
193 template<
class CycleDataType>
196 return _current_thread;
199 #else // !DO_PIPELINING 205 template<
class CycleDataType>
208 _pointer = cycler.
cheat();
214 template<
class CycleDataType>
217 _pointer = cycler.
cheat();
223 template<
class CycleDataType>
226 _pointer(copy._pointer)
233 template<
class CycleDataType>
236 _pointer(from._pointer)
238 from._pointer =
nullptr;
244 template<
class CycleDataType>
247 _pointer = copy._pointer;
253 template<
class CycleDataType>
256 nassertv(_pointer ==
nullptr);
258 _pointer = from._pointer;
259 from._pointer =
nullptr;
267 template<
class CycleDataType>
271 _pointer((CycleDataType *)take_from.take_pointer())
280 template<
class CycleDataType>
285 _pointer((CycleDataType *)take_from.take_pointer())
292 template<
class CycleDataType>
300 template<
class CycleDataType>
309 template<
class CycleDataType>
319 template<
class CycleDataType>
321 operator CycleDataType * () {
329 template<
class CycleDataType>
332 return Thread::get_current_thread();
335 #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...
CycleDataType * cheat() const
Returns a pointer without counting it.
const CycleDataType * take_pointer()
This is intended to be called only from CycleDataStageWriter when it elevates the pointer from read t...
This class is similar to CycleDataLockedReader, except it allows reading from a particular stage of t...
A thread; that is, a lightweight process.
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...