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