00001 #ifndef BUFFERSTORE_INCLUDED
00002 #define BUFFERSTORE_INCLUDED
00003
00004 #include <odem.h>
00005 #include <cassert>
00006
00007 #include "Automation.h"
00008
00009 class PaletteFrame;
00010 class Vehicle;
00011 class Observer;
00012
00013 class BufferStore : public Discrete {
00014 protected:
00015 PaletteFrame *pos [6];
00016 Vehicle *inComeVehicle,
00017 *outComeVehicle;
00018
00019 Observer *observe;
00020
00021 bool left;
00022
00023 private:
00024 int entryPosN,
00025 exitPosN,
00026 startPosN,
00027 endPosN;
00028 int bufferNumber;
00029
00030 public:
00031 BufferStore(char *n, Vehicle *iV, Vehicle *oV, Observer* ob,
00032 int enPN, int exPN, int stPN, int edPN, int bNUM, bool isLeft);
00033
00034 static BufferStore* allBuffers[4];
00035
00036 virtual int main();
00037
00038 void shift();
00039
00040 int useCount() const;
00041 static int inBuffer();
00042 bool isEmpty() const;
00043 bool isFull() const;
00044 bool isBlocked() const;
00045
00046 const PaletteFrame* getPos(unsigned int n) const {assert(n<6); return pos[n];}
00047 Vehicle* getInVehicle() {return inComeVehicle;}
00048 Vehicle* getOutVehicle() {return outComeVehicle;}
00049
00050 Automation *automat;
00051
00052 protected:
00053 void _shift();
00054 };
00055
00056 #endif
00057