#include <pipelineCyclerBase.h>
Inheritance diagram for PipelineCyclerBase:
Public Member Functions | |
PipelineCyclerBase (CycleData *initial_data, Pipeline *pipeline=NULL) | |
PipelineCyclerBase (CycleData *initial_data, const PipelineCyclerBase ©) | |
void | operator= (const PipelineCyclerBase ©) |
~PipelineCyclerBase () | |
const CycleData * | read () const |
Returns a const CycleData pointer, filled with the data for the current stage of the pipeline as seen by this thread. | |
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 * | write () |
Returns a non-const CycleData pointer, filled with a unique copy of the data for the current stage of the pipeline as seen by this thread. | |
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. | |
CycleData * | write_stage (int n) |
Returns a pointer suitable for writing to the nth stage of the pipeline. | |
void | release_write_stage (int n, CycleData *pointer) |
Releases a pointer previously obtained via a call to write_stage(). | |
CycleData * | cheat () const |
Returns a pointer without counting it. | |
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 |
See PipelineCycler.
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 52 of file pipelineCyclerBase.h.
|
Definition at line 392 of file pipelineCyclerBase.I. |
|
Definition at line 418 of file pipelineCyclerBase.I. References _data. |
|
Definition at line 450 of file pipelineCyclerBase.I. References INLINE. |
|
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 in PipelineCycler< CycleDataType >, and PipelineCycler< CData >. Definition at line 670 of file pipelineCyclerBase.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. |
|
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. |
|
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 436 of file pipelineCyclerBase.I. References INLINE. |
|
Returns a const CycleData pointer, filled with the data for the current stage of the pipeline as seen by this thread. This pointer should eventually be released by calling release_read(). Reimplemented in PipelineCycler< CycleDataType >, and PipelineCycler< CData >. Definition at line 468 of file pipelineCyclerBase.I. |
|
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(). |
|
Returns a non-const CycleData pointer, filled with a unique copy of the data for the current stage of the pipeline as seen by this thread. This pointer may now be used to write to the data, and that copy of the data will be propagate to all later stages of the pipeline. This pointer should eventually be released by calling release_write(). There may only be one outstanding write pointer on a given stage at a time, and if there is a write pointer there may be no read pointers on the same stage (but see elevate_read). Reimplemented in PipelineCycler< CycleDataType >, and PipelineCycler< CData >. Definition at line 537 of file pipelineCyclerBase.I. |
|
Returns a pointer suitable for writing to the nth stage of the pipeline. This is for special applications that need to update the entire pipeline at once (for instance, to remove an invalid pointer). This pointer should later be released with release_write_stage(). Reimplemented in PipelineCycler< CycleDataType >, and PipelineCycler< CData >. Definition at line 633 of file pipelineCyclerBase.I. |
|
Definition at line 92 of file pipelineCyclerBase.h. Referenced by increment_read(), and PipelineCyclerBase(). |