00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef CYCLEDATASTAGEWRITER_H
00016 #define CYCLEDATASTAGEWRITER_H
00017
00018 #include "pandabase.h"
00019
00020 #include "cycleData.h"
00021 #include "pipelineCycler.h"
00022 #include "cycleDataLockedStageReader.h"
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 template<class CycleDataType>
00034 class CycleDataStageWriter {
00035 public:
00036
00037
00038 #ifndef CPPPARSER
00039 INLINE CycleDataStageWriter(PipelineCycler<CycleDataType> &cycler, int stage,
00040 Thread *current_thread = Thread::get_current_thread());
00041 INLINE CycleDataStageWriter(PipelineCycler<CycleDataType> &cycler, int stage,
00042 bool force_to_0, Thread *current_thread = Thread::get_current_thread());
00043
00044 INLINE CycleDataStageWriter(const CycleDataStageWriter<CycleDataType> ©);
00045 INLINE void operator = (const CycleDataStageWriter<CycleDataType> ©);
00046
00047 INLINE CycleDataStageWriter(PipelineCycler<CycleDataType> &cycler, int stage,
00048 CycleDataLockedStageReader<CycleDataType> &take_from);
00049 INLINE CycleDataStageWriter(PipelineCycler<CycleDataType> &cycler, int stage,
00050 CycleDataLockedStageReader<CycleDataType> &take_from,
00051 bool force_to_0);
00052
00053 INLINE ~CycleDataStageWriter();
00054
00055 INLINE CycleDataType *operator -> ();
00056 INLINE const CycleDataType *operator -> () const;
00057
00058 INLINE operator CycleDataType * ();
00059
00060 INLINE Thread *get_current_thread() const;
00061
00062 private:
00063 #ifdef DO_PIPELINING
00064
00065 PipelineCycler<CycleDataType> *_cycler;
00066 Thread *_current_thread;
00067 CycleDataType *_pointer;
00068 int _stage;
00069 #else // !DO_PIPELINING
00070
00071 CycleDataType *_pointer;
00072 #endif // DO_PIPELINING
00073 #endif // CPPPARSER
00074 };
00075
00076 #include "cycleDataStageWriter.I"
00077
00078 #endif