Generic hardware access library
|
Retrieves AddressTables for a given SerialNumber. More...
#include <ASCIIFileAddressTableContainer.hh>
Public Member Functions | |
ASCIIFileAddressTableContainer (ASCIIFileModuleMapper &moduleMapper, std::string addressTableMapFile, std::string addressTablePrefix="") throw ( NoSuchFileException, IllegalValueException, XMLProcessingException ) | |
The constructor of the ASCIIFileAddressTableContainer. | |
virtual | ~ASCIIFileAddressTableContainer () |
VMEAddressTable & | getVMETableFromSerialNumber (std::string serialNumber) throw ( IllegalValueException ) |
Retrieves the AddressTable of a module with a given seralNumber. | |
Private Attributes | |
ASCIIFileModuleMapper & | moduleMapper_ |
std::string | mappingTable_ |
std::map< std::string, VMEAddressTable * > | vmeAddressTableMap_ |
std::map< std::string, PCIAddressTable * > | pciAddressTableMap_ |
Retrieves AddressTables for a given SerialNumber.
The class reads an ASCII file which maps typeIds to pathnames of AddressTable files. It then uses the ModuleMapper in order to retrieve the AddressTables for a given SerialNumber. AddressTables are constructed the first time they are requested. They are then stored in a map with the typeId as a key. Therefore they can be shared by all modules with the same typeId (but different serialNumbers).
Addresstables can be either in xml format or in ASCII format. If the file extension of the AddressTable is ".xml" or ".XML" the file is interpreted as an XML AddressTable. In all other cases the file is interpreted as an ASCII AddressTable.
The format of the ASCII File is as follows:
******************************************************** * typeId technology addressTableFileName ******************************************************** ECAL-DCC vme /home/data/dccAddressTable.xml TTCvi vme /home/data/ttcviAddressTable.xml gIIIFed pci /home/data/gIIIFedAddressTable.xml ********************************************************
The technology column might have the values 'vme' or 'pci'.
Definition at line 62 of file ASCIIFileAddressTableContainer.hh.
HAL::ASCIIFileAddressTableContainer::ASCIIFileAddressTableContainer | ( | HAL::ASCIIFileModuleMapper & | moduleMapper, |
std::string | addressTableMapFile, | ||
std::string | addressTablePrefix = "" |
||
) | throw ( NoSuchFileException, IllegalValueException, XMLProcessingException ) |
The constructor of the ASCIIFileAddressTableContainer.
moduleMapper | is a ASCIIFileModuleMapper in order to map the serialNumber of a module to its typeId, and to retrieve the baseaddress if the module is a standard VME module (not VME64x plug and play) |
addressTableMapFile | is the path to the ASCII file described above. |
addressTablePrefix | allows the user to define a base-directory which will be prefixed to all address table file strings found in the map file. |
Definition at line 7 of file ASCIIFileAddressTableContainer.cc.
Definition at line 109 of file ASCIIFileAddressTableContainer.cc.
HAL::VMEAddressTable & HAL::ASCIIFileAddressTableContainer::getVMETableFromSerialNumber | ( | std::string | serialNumber | ) | throw ( IllegalValueException ) [virtual] |
Retrieves the AddressTable of a module with a given seralNumber.
Implements HAL::AddressTableContainerInterface.
Definition at line 123 of file ASCIIFileAddressTableContainer.cc.
std::string HAL::ASCIIFileAddressTableContainer::mappingTable_ [private] |
Definition at line 95 of file ASCIIFileAddressTableContainer.hh.
Definition at line 94 of file ASCIIFileAddressTableContainer.hh.
std::map< std::string, PCIAddressTable* > HAL::ASCIIFileAddressTableContainer::pciAddressTableMap_ [private] |
Definition at line 97 of file ASCIIFileAddressTableContainer.hh.
std::map< std::string, VMEAddressTable* > HAL::ASCIIFileAddressTableContainer::vmeAddressTableMap_ [private] |
Definition at line 96 of file ASCIIFileAddressTableContainer.hh.