#include <pipelineCycler.h>
Inheritance diagram for PipelineCycler< CycleDataType >:
Public Member Functions | |
PipelineCycler (Pipeline *pipeline=NULL) | |
PipelineCycler (const PipelineCycler< CycleDataType > ©) | |
void | operator= (const PipelineCycler< CycleDataType > ©) |
const CycleDataType * | read () const |
See PipelineCyclerBase::read(). | |
CycleDataType * | write () |
See PipelineCyclerBase::write(). | |
CycleDataType * | elevate_read (const CycleDataType *pointer) |
See PipelineCyclerBase::elevate_read(). | |
CycleDataType * | write_stage (int n) |
See PipelineCyclerBase::write_stage(). | |
CycleDataType * | cheat () const |
Returns a pointer without counting it. | |
void | increment_read (const CycleData *pointer) const |
Increments the count on a pointer previously retrieved by read(); now the pointer will need to be released twice. | |
void | release_read (const CycleData *pointer) const |
Releases a pointer previously obtained via a call to read(). | |
CycleData * | elevate_read (const CycleData *pointer) |
Elevates a currently-held read pointer into a write pointer. | |
void | release_write (CycleData *pointer) |
Releases a pointer previously obtained via a call to write(). | |
int | get_num_stages () |
Returns the number of stages in the pipeline. | |
bool | is_stage_unique (int n) const |
Returns true if the nth stage is a different pointer than the previous stage, or false if its pointer is shared with the previous one. | |
void | release_write_stage (int n, CycleData *pointer) |
Releases a pointer previously obtained via a call to write_stage(). | |
int | get_read_count () const |
Returns the number of handles currently outstanding to read the current stage of the data. | |
int | get_write_count () const |
Returns the number of handles currently outstanding to read the current stage of the data. | |
Public Attributes | |
CycleData * | _data |
Private Attributes | |
CycleDataType | _typed_data |
The class object maintains up to n copies of a CycleData structure, one for each stage of the pipeline. The head of the pipeline is responsible for making changes to its copy, which are then cycled through the pipeline at each frame.
To access the data, you must first ask for a readable pointer. In order to make changes to the data, you must ask for a writable pointer. Both kinds of pointers should be released when you are done, as a sanity check. The CycleDataReader and CycleDataWriter classes transparently handle this.
If pipelining support is not enabled at compile time (that is, SUPPORT_PIPELINING is not defined), this object compiles to a minimum object that presents the same interface but with minimal runtime overhead. (Actually, this isn't true yet, but it will be one day.)
We define this as a struct instead of a class to guarantee byte placement within the object, so that (particularly for the trivial implementation) the inherited struct's data is likely to be placed by the compiler at the "this" pointer.
Definition at line 93 of file pipelineCycler.h.
|
Definition at line 167 of file pipelineCycler.I. References PipelineCycler< CycleDataType >::_typed_data, and INLINE. |
|
Definition at line 182 of file pipelineCycler.I. |
|
Returns a pointer without counting it. This is only intended for use as the return value for certain nassertr() functions, so the application can recover after a failure to manage the read and write pointers correctly. You should never call this function directly. Reimplemented from PipelineCyclerBase. Definition at line 279 of file pipelineCycler.I. |
|
Elevates a currently-held read pointer into a write pointer. This may or may not change the value of the pointer. It is only valid to do this if this is the only currently-outstanding read pointer on the current stage. Definition at line 562 of file pipelineCyclerBase.I. |
|
See PipelineCyclerBase::elevate_read().
Definition at line 241 of file pipelineCycler.I. |
|
Returns the number of stages in the pipeline.
Definition at line 593 of file pipelineCyclerBase.I. Referenced by PandaNode::parents_changed(). |
|
Returns the number of handles currently outstanding to read the current stage of the data. This should only be used for debugging purposes. Definition at line 691 of file pipelineCyclerBase.I. |
|
Returns the number of handles currently outstanding to read the current stage of the data. This will normally only be either 0 or 1. This should only be used for debugging purposes. Definition at line 710 of file pipelineCyclerBase.I. |
|
Increments the count on a pointer previously retrieved by read(); now the pointer will need to be released twice.
Definition at line 489 of file pipelineCyclerBase.I. References PipelineCyclerBase::_data, and INLINE. |
|
Returns true if the nth stage is a different pointer than the previous stage, or false if its pointer is shared with the previous one.
Definition at line 610 of file pipelineCyclerBase.I. Referenced by PandaNode::parents_changed(). |
|
Definition at line 198 of file pipelineCycler.I. References PipelineCycler< CycleDataType >::_typed_data, and INLINE. |
|
See PipelineCyclerBase::read().
Reimplemented from PipelineCyclerBase. Definition at line 213 of file pipelineCycler.I. References PipelineCycler< CycleDataType >::_typed_data, and INLINE. |
|
Releases a pointer previously obtained via a call to read().
Definition at line 503 of file pipelineCyclerBase.I. References INLINE. |
|
Releases a pointer previously obtained via a call to write().
Definition at line 581 of file pipelineCyclerBase.I. |
|
Releases a pointer previously obtained via a call to write_stage().
Definition at line 648 of file pipelineCyclerBase.I. Referenced by PandaNode::parents_changed(). |
|
See PipelineCyclerBase::write().
Reimplemented from PipelineCyclerBase. Definition at line 227 of file pipelineCycler.I. |
|
See PipelineCyclerBase::write_stage().
Reimplemented from PipelineCyclerBase. Definition at line 255 of file pipelineCycler.I. |
|
Definition at line 92 of file pipelineCyclerBase.h. Referenced by PipelineCyclerBase::increment_read(), and PipelineCyclerBase::PipelineCyclerBase(). |
|
Definition at line 110 of file pipelineCycler.h. Referenced by PipelineCycler< CycleDataType >::operator=(), PipelineCycler< CycleDataType >::PipelineCycler(), and PipelineCycler< CycleDataType >::read(). |