#include "AliAltroMapping.h"
#include "AliLog.h"
#include <Riostream.h>
-//#include <stdlib.h>
ClassImp(AliAltroMapping)
fNumberOfChannels(0),
fMaxHWAddress(0),
fMappingSize(0),
- fInvMappingSize(0)
+ fMapping(NULL)
{
// Default constructor
}
fNumberOfChannels(0),
fMaxHWAddress(0),
fMappingSize(0),
- fInvMappingSize(0)
+ fMapping(NULL)
{
// Constructor
// Reads the mapping from an external file
//_____________________________________________________________________________
AliAltroMapping::~AliAltroMapping()
{
- CloseMappingFile();
// destructor
+ CloseMappingFile();
+
+ if (fMapping) delete [] fMapping;
}
//_____________________________________________________________________________
fIn = new ifstream(mappingFile);
if (!*fIn) {
AliFatal(Form("Missing mapping file (%s) !",mappingFile));
+ CloseMappingFile();
return kFALSE;
}
if (!(*fIn >> fNumberOfChannels)) {
AliFatal(Form("Syntax of the mapping file is wrong (%s) !",mappingFile));
+ CloseMappingFile();
return kFALSE;
}
if (!(*fIn >> fMaxHWAddress)) {
AliFatal(Form("Syntax of the mapping file is wrong (%s) !",mappingFile));
+ CloseMappingFile();
return kFALSE;
}
}
//_____________________________________________________________________________
-Bool_t AliAltroMapping::CloseMappingFile()
+void AliAltroMapping::CloseMappingFile()
{
// Closes the external mapping
// file
delete fIn;
fIn = NULL;
}
-
- return kTRUE;
}