AliRoot Core  v5-06-15 (45dab64)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMpDataProcessor Class Reference

Class for converting ASCII data files in the map of string. More...

#include <AliMpDataProcessor.h>

Inheritance diagram for AliMpDataProcessor:

Public Member Functions

 AliMpDataProcessor ()
 
virtual ~AliMpDataProcessor ()
 
AliMpDataMapCreateDataMap (const TString &dataDir="data")
 
Bool_t GenerateData (AliMpDataMap *dataMap, const TString &outputDataDir="data_new")
 
Bool_t GenerateCode (AliMpDataMap *dataMap)
 

Private Member Functions

void ProcessDirectory (const TString &path, AliMpDataMap *map)
 
void ProcessFile (const TString &path, AliMpDataMap *map)
 
void GenerateFunction (const TString &path, const TString &data)
 
void GenerateFileCode (const TString &path)
 
void GenerateFill ()
 

Static Private Member Functions

static const TString & GetHeaderFileName ()
 
static const TString & GetImplFileName ()
 

Private Attributes

Int_t fCounter
 data files counter More...
 
ofstream fHeaderFile
 header file More...
 
ofstream fImplFile
 implementation file More...
 

Detailed Description

Class for converting ASCII data files in the map of string.

Author
Ivana Hrivnacova, IPN Orsay

Definition at line 24 of file AliMpDataProcessor.h.

Constructor & Destructor Documentation

AliMpDataProcessor::AliMpDataProcessor ( )

Default and standar constructor

Definition at line 67 of file AliMpDataProcessor.cxx.

AliMpDataProcessor::~AliMpDataProcessor ( )
virtual

Destructor

Definition at line 83 of file AliMpDataProcessor.cxx.

Member Function Documentation

AliMpDataMap * AliMpDataProcessor::CreateDataMap ( const TString &  dataDir = "data")

Process data directory and map a string with the content of each file to the file path.

Definition at line 261 of file AliMpDataProcessor.cxx.

Referenced by AliMpCDB::WriteMpData(), and AliMpCDB::WriteMpRunData().

Bool_t AliMpDataProcessor::GenerateCode ( AliMpDataMap dataMap)

Generate C++ code from dataMap.

AliMpDataProcessor mp;
AliMpDataMap* dataMap = mp.CreateDataMap();
mp.GenerateCode(dataMap);

Not really used, but kept for eventual future explorations.

Definition at line 358 of file AliMpDataProcessor.cxx.

Bool_t AliMpDataProcessor::GenerateData ( AliMpDataMap dataMap,
const TString &  outputDataDir = "data_new" 
)

Generate ASCII data files in outputDataDir from dataMap

Definition at line 280 of file AliMpDataProcessor.cxx.

Referenced by AliMpCDB::GenerateMpData(), and AliMpCDB::GenerateMpRunData().

void AliMpDataProcessor::GenerateFileCode ( const TString &  path)
private

Dump the content of the file specified by its path as a C++ string

Definition at line 206 of file AliMpDataProcessor.cxx.

Referenced by GenerateFunction().

void AliMpDataProcessor::GenerateFill ( )
private

Generate function which calls all previously generated functions

Definition at line 233 of file AliMpDataProcessor.cxx.

Referenced by GenerateCode().

void AliMpDataProcessor::GenerateFunction ( const TString &  path,
const TString &  data 
)
private

Generate a C++ function which defines a string with the data content and map it to the given path in the map

Definition at line 171 of file AliMpDataProcessor.cxx.

Referenced by GenerateCode().

const TString & AliMpDataProcessor::GetHeaderFileName ( )
staticprivate

Return the default name for generated header file

Definition at line 47 of file AliMpDataProcessor.cxx.

Referenced by AliMpDataProcessor().

const TString & AliMpDataProcessor::GetImplFileName ( )
staticprivate

Return the default name for generated implementation file

Definition at line 55 of file AliMpDataProcessor.cxx.

Referenced by AliMpDataProcessor().

void AliMpDataProcessor::ProcessDirectory ( const TString &  path,
AliMpDataMap map 
)
private

Recursive function to process data directory

Definition at line 95 of file AliMpDataProcessor.cxx.

Referenced by CreateDataMap().

void AliMpDataProcessor::ProcessFile ( const TString &  path,
AliMpDataMap map 
)
private

Dump the content of the file specified by its path in a string and fill it in the dataMap

Definition at line 130 of file AliMpDataProcessor.cxx.

Referenced by ProcessDirectory().

Member Data Documentation

Int_t AliMpDataProcessor::fCounter
private

data files counter

Definition at line 49 of file AliMpDataProcessor.h.

Referenced by GenerateFill(), and GenerateFunction().

ofstream AliMpDataProcessor::fHeaderFile
private

header file

Definition at line 50 of file AliMpDataProcessor.h.

Referenced by AliMpDataProcessor(), GenerateFill(), and GenerateFunction().

ofstream AliMpDataProcessor::fImplFile
private

implementation file

Definition at line 51 of file AliMpDataProcessor.h.

Referenced by AliMpDataProcessor(), GenerateFileCode(), GenerateFill(), and GenerateFunction().


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