00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PIPELINECYCLERBASE_H
00020 #define PIPELINECYCLERBASE_H
00021
00022 #include "pandabase.h"
00023
00024 #include "cycleData.h"
00025 #include "pipeline.h"
00026 #include "pointerTo.h"
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 struct EXPCL_PANDA PipelineCyclerBase {
00040 public:
00041 INLINE PipelineCyclerBase(CycleData *initial_data, Pipeline *pipeline = NULL);
00042 INLINE PipelineCyclerBase(CycleData *initial_data, const PipelineCyclerBase ©);
00043 INLINE void operator = (const PipelineCyclerBase ©);
00044 INLINE ~PipelineCyclerBase();
00045
00046 INLINE const CycleData *read() const;
00047 INLINE void increment_read(const CycleData *pointer) const;
00048 INLINE void release_read(const CycleData *pointer) const;
00049
00050 INLINE CycleData *write();
00051 INLINE CycleData *elevate_read(const CycleData *pointer);
00052 INLINE void release_write(CycleData *pointer);
00053
00054 INLINE int get_num_stages();
00055 INLINE bool is_stage_unique(int n) const;
00056 INLINE CycleData *write_stage(int n);
00057 INLINE void release_write_stage(int n, CycleData *pointer);
00058
00059 INLINE CycleData *cheat() const;
00060 INLINE int get_read_count() const;
00061 INLINE int get_write_count() const;
00062
00063 #ifdef DO_PIPELINING
00064
00065
00066
00067
00068 private:
00069 PT(CycleData) _data;
00070 Pipeline *_pipeline;
00071 short _read_count, _write_count;
00072
00073 #else // !DO_PIPELINING
00074
00075
00076
00077
00078 #ifndef SIMPLE_STRUCT_POINTERS
00079 CycleData *_data;
00080 #endif // SIMPLE_STRUCT_POINTERS
00081
00082 #endif // DO_PIPELINING
00083 };
00084
00085 #include "pipelineCyclerBase.I"
00086
00087 #endif
00088