23 template<
class CycleDataType>
26 int stage,
Thread *current_thread) :
28 _current_thread(current_thread),
31 _pointer = _cycler->read_stage(_stage, _current_thread);
32 nassertv(_pointer !=
nullptr);
38 template<
class CycleDataType>
41 _cycler(copy._cycler),
42 _current_thread(copy._current_thread),
43 _pointer(copy._pointer),
46 nassertv(_pointer !=
nullptr);
47 _cycler->increment_read(_pointer);
53 template<
class CycleDataType>
56 _cycler(from._cycler),
57 _current_thread(from._current_thread),
58 _pointer(from._pointer),
61 from._pointer =
nullptr;
67 template<
class CycleDataType>
70 nassertv(_pointer ==
nullptr);
71 nassertv(_current_thread == copy._current_thread);
73 _cycler = copy._cycler;
74 _pointer = copy._pointer;
77 nassertv(_pointer !=
nullptr);
78 _cycler->increment_read(_pointer);
84 template<
class CycleDataType>
87 nassertv(_pointer ==
nullptr);
88 nassertv(_current_thread == from._current_thread);
90 _cycler = from._cycler;
91 _pointer = from._pointer;
94 from._pointer =
nullptr;
100 template<
class CycleDataType>
103 if (_pointer !=
nullptr) {
104 _cycler->release_read_stage(_stage, _pointer);
111 template<
class CycleDataType>
114 nassertr(_pointer !=
nullptr, _cycler->cheat());
122 template<
class CycleDataType>
124 operator
const CycleDataType * ()
const {
125 nassertr(_pointer !=
nullptr, _cycler->cheat());
135 template<
class CycleDataType>
138 const CycleDataType *pointer = _pointer;
140 nassertr(pointer !=
nullptr, _cycler->cheat());
148 template<
class CycleDataType>
151 return _current_thread;
154 #else // !DO_PIPELINING 160 template<
class CycleDataType>
164 _pointer = cycler.
cheat();
170 template<
class CycleDataType>
173 _pointer(copy._pointer)
180 template<
class CycleDataType>
183 _pointer(from._cycler)
185 from._pointer =
nullptr;
191 template<
class CycleDataType>
194 _pointer = copy._pointer;
200 template<
class CycleDataType>
203 nassertv(_pointer ==
nullptr);
205 _pointer = from._pointer;
206 from._pointer =
nullptr;
212 template<
class CycleDataType>
220 template<
class CycleDataType>
230 template<
class CycleDataType>
232 operator
const CycleDataType * ()
const {
242 template<
class CycleDataType>
252 template<
class CycleDataType>
255 return Thread::get_current_thread();
258 #endif // DO_PIPELINING This class maintains different copies of a page of data between stages of the graphics pipeline (or a...
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...
const CycleDataType * operator ->() const
This provides an indirect member access to the actual CycleData data.
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...