MTBoard Class Reference

#include <MTBoard.hh>

Inheritance diagram for MTBoard:

Inheritance graph
[legend]
Collaboration diagram for MTBoard:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MTBoard ()
 MTBoard (const Board &aBoard)
virtual ~MTBoard ()
MTBoardoperator= (const Board &aBoard)
void Info (void) const
UInt_t GetId (void) const
void SetId (UInt_t value)
const std::map< UInt_t, MTChip * > & GetChips (void) const
MTChipGetChip (UInt_t id) const

Private Attributes

Int_t id
std::map< UInt_t, MTChip * > chips

Detailed Description

CLASS MTBoard(containing board configuration)

Definition at line 20 of file MTBoard.hh.


Constructor & Destructor Documentation

MTBoard::MTBoard (  ) 

MTBoard::MTBoard ( const Board aBoard  ) 

Definition at line 33 of file MTBoard.cpp.

00034  {
00035      (*this) = aBoard; // appelle operator=
00036  }

MTBoard::~MTBoard (  )  [virtual]

Definition at line 38 of file MTBoard.cpp.

00039 {
00040     for( map<UInt_t,MTChip*>::const_iterator iiChip=this->chips.begin(); iiChip!=this->chips.end(); ++iiChip)
00041     {
00042                         MTChip *foo =(*iiChip).second ; 
00043         delete foo;
00044     }
00045 //      }
00046 }


Member Function Documentation

MTBoard & MTBoard::operator= ( const Board aBoard  ) 

Definition at line 48 of file MTBoard.cpp.

00049 {
00050         try
00051         {
00052                 id  = aBoard.getId();
00053 
00054                 MTChip* mtChip = NULL;
00055                 const ChipMap_t& boardChips = aBoard.getChips();
00056                         
00057                 for (ChipMap_t::const_iterator chipIt = boardChips.begin(); chipIt != boardChips.end(); ++chipIt)
00058                 {
00059                         Chip& chip = *(chipIt->second);
00060                         try {
00061                                          DiracChip &diracChip = dynamic_cast<DiracChip &> (chip);
00062                                          mtChip = new MTDiracChip(diracChip);
00063                         }
00064                         catch (...) {}
00065                         try {
00066                                          Hardroc1Chip &hr1Chip = dynamic_cast<Hardroc1Chip &> (chip);
00067                                          mtChip = new MTHardroc1Chip(hr1Chip);
00068                         }
00069                         catch (...) {}
00070                         try {
00071                                          Hardroc2Chip &hr2Chip = dynamic_cast<Hardroc2Chip &> (chip);
00072                                          mtChip = new MTHardroc2Chip(hr2Chip);
00073                         }
00074                         catch (...) {}
00075                         try {
00076                                          MicrorocChip &microChip = dynamic_cast<MicrorocChip &> (chip);
00077                                          mtChip = new MTMicrorocChip(microChip);
00078                         }
00079                         catch (...) {}
00080                                 
00081                         
00082                         if ( mtChip != NULL)
00083                         {
00084                                 //mtChip->SetBoard(*this);
00085                                 chips[chip.getId()] = mtChip;
00086                         //      if ( id == 14 )
00087                 //              {
00088         //                              cout << "Board id[" << id << "] adr[" << this << "] add chip id[" << chip.getId() << "]  chip adr[" << mtChip << "]" << endl;
00089         //                      }
00090                         }
00091                 }
00092         }
00093         catch (MicroException e)
00094         {
00095                 throw MicroException(e.getMessage());
00096         }
00097         return *this;
00098 }

void MTBoard::Info ( void   )  const

Definition at line 101 of file MTBoard.cpp.

00102 {
00103   cout << "**** Board informations ****"    << endl << endl ;
00104   cout << "    Id: " << dec <<  id << "    " << endl ;
00105 }

UInt_t MTBoard::GetId ( void   )  const [inline]

Definition at line 29 of file MTBoard.hh.

00029 { return id; } ;

void MTBoard::SetId ( UInt_t  value  )  [inline]

Definition at line 30 of file MTBoard.hh.

00030 { id = value; } ;

const std::map<UInt_t,MTChip*>& MTBoard::GetChips ( void   )  const [inline]

Definition at line 33 of file MTBoard.hh.

Referenced by MTRun::GetOneChip().

00033 { return chips; } ;

MTChip& MTBoard::GetChip ( UInt_t  id  )  const [inline]

Definition at line 34 of file MTBoard.hh.

00034 { return *(chips.find(id)->second); };


Member Data Documentation

Int_t MTBoard::id [private]

Definition at line 34 of file MTBoard.hh.

Referenced by GetId().

std::map<UInt_t,MTChip*> MTBoard::chips [private]

Definition at line 43 of file MTBoard.hh.

Referenced by GetChips(), operator=(), and ~MTBoard().


The documentation for this class was generated from the following files:
Generated on Mon Jan 7 13:18:48 2013 for MicromegasFramework by  doxygen 1.4.7