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