23template<
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);
38template<
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);
53template<
class CycleDataType>
56 _cycler(from._cycler),
57 _current_thread(from._current_thread),
58 _pointer(from._pointer),
61 from._pointer =
nullptr;
67template<
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);
84template<
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;
100template<
class CycleDataType>
103 if (_pointer !=
nullptr) {
104 _cycler->release_read_stage(_stage, _pointer);
111template<
class CycleDataType>
114 nassertr(_pointer !=
nullptr, _cycler->cheat());
122template<
class CycleDataType>
124operator
const CycleDataType * ()
const {
125 nassertr(_pointer !=
nullptr, _cycler->cheat());
135template<
class CycleDataType>
138 const CycleDataType *pointer = _pointer;
140 nassertr(pointer !=
nullptr, _cycler->cheat());
148template<
class CycleDataType>
151 return _current_thread;
160template<
class CycleDataType>
164 _pointer = cycler.
cheat();
170template<
class CycleDataType>
173 _pointer(copy._pointer)
180template<
class CycleDataType>
183 _pointer(from._cycler)
185 from._pointer =
nullptr;
191template<
class CycleDataType>
194 _pointer = copy._pointer;
200template<
class CycleDataType>
203 nassertv(_pointer ==
nullptr);
205 _pointer = from._pointer;
206 from._pointer =
nullptr;
212template<
class CycleDataType>
220template<
class CycleDataType>
230template<
class CycleDataType>
232operator
const CycleDataType * ()
const {
242template<
class CycleDataType>
252template<
class CycleDataType>
This class is similar to CycleDataLockedReader, except it allows reading from a particular stage of t...
const CycleDataType * operator->() const
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...
const CycleDataType * take_pointer()
This is intended to be called only from CycleDataStageWriter when it elevates the pointer from read t...
A thread; that is, a lightweight process.
get_current_thread
Returns a pointer to the currently-executing Thread object.
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.