Generic hardware access library
|
Reads an ASCII file to map serialNumbers to typeIds and baseAddresses. More...
#include <ASCIIFileModuleMapper.hh>
Public Member Functions | |
ASCIIFileModuleMapper (std::string mapFile) throw ( NoSuchFileException ) | |
The constructor needs the fileName as argument. | |
virtual | ~ASCIIFileModuleMapper () |
std::string | getTypeId (std::string serialNumber) throw ( IllegalValueException ) |
This function maps the serialNumber to the TypeID. | |
uint32_t | getBaseaddress (std::string serialNumber) throw ( IllegalValueException ) |
Retrieve the baseAddress for a standard VME module. | |
Private Attributes | |
std::string | mapFile_ |
std::map< std::string, std::string > | typeIdMap_ |
std::map< std::string, uint32_t > | baseaddressMap_ |
Reads an ASCII file to map serialNumbers to typeIds and baseAddresses.
The format of the ASCII File is as follows:
******************************************************** * serialNumber typeId baseAddress(hex) ******************************************************** daqECAL_DCC-r1-001 ECAL-DCC 00000000 TTCve-0192 TTCvi 00900800 ********************************************************
The example contains two modules. The baseaddress for VME64x modules is ignored (but must be present in order to make this class work.)
No thorough testing of the input file format is done since it is expected that in the final system the module mapper will use a database (look at the DatabaseModuleMapper).
Definition at line 48 of file ASCIIFileModuleMapper.hh.
HAL::ASCIIFileModuleMapper::ASCIIFileModuleMapper | ( | std::string | mapFile | ) | throw ( NoSuchFileException ) |
The constructor needs the fileName as argument.
Definition at line 7 of file ASCIIFileModuleMapper.cc.
virtual HAL::ASCIIFileModuleMapper::~ASCIIFileModuleMapper | ( | ) | [inline, virtual] |
Definition at line 58 of file ASCIIFileModuleMapper.hh.
uint32_t HAL::ASCIIFileModuleMapper::getBaseaddress | ( | std::string | serialNumber | ) | throw ( IllegalValueException ) [virtual] |
Retrieve the baseAddress for a standard VME module.
Implements HAL::ModuleMapperInterface.
Definition at line 57 of file ASCIIFileModuleMapper.cc.
std::string HAL::ASCIIFileModuleMapper::getTypeId | ( | std::string | serialNumber | ) | throw ( IllegalValueException ) [virtual] |
This function maps the serialNumber to the TypeID.
If the mapping is unsuccessfull an exception is thrown.
Implements HAL::ModuleMapperInterface.
Definition at line 44 of file ASCIIFileModuleMapper.cc.
std::map<std::string,uint32_t> HAL::ASCIIFileModuleMapper::baseaddressMap_ [private] |
Definition at line 76 of file ASCIIFileModuleMapper.hh.
std::string HAL::ASCIIFileModuleMapper::mapFile_ [private] |
Definition at line 74 of file ASCIIFileModuleMapper.hh.
std::map<std::string,std::string> HAL::ASCIIFileModuleMapper::typeIdMap_ [private] |
Definition at line 75 of file ASCIIFileModuleMapper.hh.