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