00001
00002 #ifndef _BOARD_HH_
00003 #define _BOARD_HH_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "mTypes.h"
00015 #include <map>
00016 #include <sstream>
00017 class Chip;
00018 class Channel;
00019
00020
00021
00022
00023 class Board {
00024 friend std::ostream& operator <<(std::ostream& out, const Board& x);
00025 friend class Chamber;
00026 protected :
00027 Board(const Chamber& _chamber, const ui32 aCol, const ui32 aRow, const ui32 nbColumns, const ui32 nbRows, const i32 aId);
00028 Board(const Board &source);
00029 Board& operator = (const Board &source);
00030 virtual ~Board();
00031 std::ostream& operator << (std::ostream& out) const;
00032
00033
00034
00035 public :
00036 inline const Chamber &getChamber() const { return(chamber); };
00037 inline const i32 getId() const { return(id); };
00038
00039 const i32 getX(void) const;
00040 const i32 getY(void) const;
00041
00042 const ui32 getXLength() const;
00043 const ui32 getYLength() const;
00044
00045 virtual const ui32 getXGap() const = 0;
00046 virtual const ui32 getYGap() const = 0;
00047
00048 void addChip(Chip *chip);
00049 inline ChipMap_t getChips(void) const { return chips; };
00050
00051 void setDif(Dif *aDif);
00052 inline const Dif * getDif()const { return dif; } ;
00053
00054
00055 Channel &getChannelById(const i32 channelId, const i32 chipId = -1);
00056 Chip &getChipById(const i32 chipId);
00057
00058 protected :
00059 const Chamber& chamber;
00060 i32 id;
00061 ui32 column, row;
00062 std::map<i32, Chip *> chips;
00063 ui32 nbColumns, nbRows;
00064 Dif *dif;
00065 };
00066
00067 #endif // _BOARD_HH_
00068