26 template<
class CycleDataType>
31 _current_thread(current_thread)
33 _pointer = _cycler->read(_current_thread);
34 nassertv(_pointer != (
const CycleDataType *)NULL);
42 template<
class CycleDataType>
45 _cycler(copy._cycler),
46 _current_thread(copy._current_thread),
47 _pointer(copy._pointer)
49 nassertv(_pointer != (
const CycleDataType *)NULL);
50 _cycler->increment_read(_pointer);
58 template<
class CycleDataType>
61 nassertv(_pointer == (CycleDataType *)NULL);
62 nassertv(_current_thread == copy._current_thread);
64 _cycler = copy._cycler;
65 _pointer = copy._pointer;
67 nassertv(_pointer != (
const CycleDataType *)NULL);
68 _cycler->increment_read(_pointer);
76 template<
class CycleDataType>
79 if (_pointer != NULL) {
80 _cycler->release_read(_pointer);
90 template<
class CycleDataType>
93 nassertr(_pointer != (
const CycleDataType *)NULL, _cycler->cheat());
103 template<
class CycleDataType>
105 operator
const CycleDataType * ()
const {
106 nassertr(_pointer != (
const CycleDataType *)NULL, _cycler->cheat());
120 template<
class CycleDataType>
123 const CycleDataType *pointer = _pointer;
124 _pointer = (CycleDataType *)NULL;
125 nassertr(pointer != (
const CycleDataType *)NULL, _cycler->cheat());
135 template<
class CycleDataType>
138 return _current_thread;
141 #else // !DO_PIPELINING 149 template<
class CycleDataType>
152 _pointer = cycler.
cheat();
160 template<
class CycleDataType>
163 _pointer(copy._pointer)
172 template<
class CycleDataType>
175 _pointer = copy._pointer;
183 template<
class CycleDataType>
194 template<
class CycleDataType>
206 template<
class CycleDataType>
208 operator
const CycleDataType * ()
const {
222 template<
class CycleDataType>
234 template<
class CycleDataType>
240 #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.
static Thread * get_current_thread()
Returns a pointer to the currently-executing Thread object.
const CycleDataType * operator->() const
This provides an indirect member access to the actual CycleData data.
const CycleDataType * take_pointer()
This is intended to be called only from CycleDataWriter when it elevates the pointer from read to wri...
Thread * get_current_thread() const
Returns the Thread pointer of the currently-executing thread, as passed to the constructor of this ob...
This template class calls PipelineCycler::read() in the constructor and PipelineCycler::release_read(...
A thread; that is, a lightweight process.