PHNodeIOManager.h
//-----------------------------------------------------------------------------
// $Header: /afs/rhic/phenix/cvsroot/offline/framework/phool/PHNodeIOManager.h,v 1.17 2001/06/14 10:13:54 aphecetc Exp $
//
// The PHOOL's Software
// Copyright (C) PHENIX collaboration, 1999
//
// Declaration of class PHNodeIOManager
//
// Purpose: manages file IO for PHIODataNodes
//
// Author: Matthias Messer
//-----------------------------------------------------------------------------
#ifndef PHNODEIOMANAGER_H
#define PHNODEIOMANAGER_H
#include "phool.h"
#include "PHString.h"
#include "PHIOManager.h"
#include <string>
#include <map>
class TObject;
class TFile;
class TTree;
class TBranch ;
class PHNodeIOManager : public PHIOManager {
public:
PHNodeIOManager();
PHNodeIOManager(const PHString&, const PHAccessType = PHReadOnly);
PHNodeIOManager(const PHString&, const PHString&, const PHAccessType = PHReadOnly);
virtual ~PHNodeIOManager();
public:
virtual void closeFile() ;
virtual PHBoolean write(PHCompositeNode *) ;
virtual void print() const ;
PHBoolean setFile(const PHString&, const PHString&, const PHAccessType = PHReadOnly) ;
PHCompositeNode * read(PHCompositeNode * = 0, size_t = 0) ;
PHBoolean read(size_t requestedEvent) ;
int readSpecific(size_t requestedEvent, const char* objectName) ;
void selectObjectToRead(const char* objectName, PHBoolean readit) ;
PHBoolean isSelected(const char* objectName) ;
int isFunctional() const {return isFunctionalFlag;}
PHBoolean SetCompressionLevel(int);
public:
PHBoolean write(TObject**, const PHString&);
private:
PHCompositeNode * reconstructNodeTree(PHCompositeNode *);
PHBoolean readEventFromFile(size_t requestedEvent);
string getBranchClassName(TBranch*) ;
private:
TFile *file;
TTree *tree;
int bufSize;
int split;
int accessMode;
int CompressionLevel;
map<string,TBranch*> fBranches ;
map<string,PHBoolean> objectToRead ;
int isFunctionalFlag; // flag to tell if that object initialized properly
};
#endif /* PHNODEIOMANAGER_H */