Generic hardware access library
HAL::ASCIIFileModuleMapper Class Reference

Reads an ASCII file to map serialNumbers to typeIds and baseAddresses. More...

#include <ASCIIFileModuleMapper.hh>

Inheritance diagram for HAL::ASCIIFileModuleMapper:
HAL::ModuleMapperInterface

List of all members.

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_

Detailed Description

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).

See also:
DatabaseModuleMapper, ModuleMapperInterface
Author:
Christoph Schwick
Revision:
1.1
Date:
2007/03/05 18:02:09

Definition at line 48 of file ASCIIFileModuleMapper.hh.


Constructor & Destructor Documentation

The constructor needs the fileName as argument.

Definition at line 7 of file ASCIIFileModuleMapper.cc.

Definition at line 58 of file ASCIIFileModuleMapper.hh.


Member Function Documentation

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.


Member Data Documentation

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.


The documentation for this class was generated from the following files: