00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef PIPELINECYCLERDUMMYIMPL_H
00016 #define PIPELINECYCLERDUMMYIMPL_H
00017
00018 #include "pandabase.h"
00019
00020 #if defined(DO_PIPELINING) && !defined(HAVE_THREADS)
00021
00022 #include "cycleData.h"
00023 #include "pipeline.h"
00024 #include "pointerTo.h"
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 struct EXPCL_PANDA_PIPELINE PipelineCyclerDummyImpl {
00045 public:
00046 INLINE PipelineCyclerDummyImpl(CycleData *initial_data, Pipeline *pipeline = NULL);
00047 INLINE PipelineCyclerDummyImpl(const PipelineCyclerDummyImpl ©);
00048 INLINE void operator = (const PipelineCyclerDummyImpl ©);
00049 INLINE ~PipelineCyclerDummyImpl();
00050
00051 INLINE void acquire(Thread *current_thread = NULL);
00052 INLINE void release();
00053
00054 INLINE const CycleData *read_unlocked(Thread *current_thread) const;
00055 INLINE const CycleData *read(Thread *current_thread) const;
00056 INLINE void increment_read(const CycleData *pointer) const;
00057 INLINE void release_read(const CycleData *pointer) const;
00058
00059 INLINE CycleData *write(Thread *current_thread);
00060 INLINE CycleData *write_upstream(bool force_to_0, Thread *current_thread);
00061 INLINE CycleData *elevate_read(const CycleData *pointer, Thread *current_thread);
00062 INLINE CycleData *elevate_read_upstream(const CycleData *pointer, bool force_to_0, Thread *current_thread);
00063 INLINE void increment_write(CycleData *pointer) const;
00064 INLINE void release_write(CycleData *pointer);
00065
00066 INLINE int get_num_stages();
00067 INLINE const CycleData *read_stage_unlocked(int pipeline_stage) const;
00068 INLINE const CycleData *read_stage(int pipeline_stage, Thread *current_thread) const;
00069 INLINE void release_read_stage(int pipeline_stage, const CycleData *pointer) const;
00070 INLINE CycleData *write_stage(int pipeline_stage, Thread *current_thread);
00071 INLINE CycleData *write_stage_upstream(int pipeline_stage, bool force_to_0, Thread *current_thread);
00072 INLINE CycleData *elevate_read_stage(int pipeline_stage, const CycleData *pointer, Thread *current_thread);
00073 INLINE CycleData *elevate_read_stage_upstream(int pipeline_stage, const CycleData *pointer,
00074 bool force_to_0, Thread *current_thread);
00075 INLINE void release_write_stage(int pipeline_stage, CycleData *pointer);
00076
00077 INLINE TypeHandle get_parent_type() const;
00078
00079 INLINE CycleData *cheat() const;
00080 INLINE int get_read_count() const;
00081 INLINE int get_write_count() const;
00082
00083 private:
00084 PT(CycleData) _data;
00085 Pipeline *_pipeline;
00086 short _read_count, _write_count;
00087 short _locked;
00088 };
00089
00090 #include "pipelineCyclerDummyImpl.I"
00091
00092 #endif // DO_PIPELINING && !HAVE_THREADS
00093
00094 #endif
00095