PHRawOManager.h
//-----------------------------------------------------------------------------
// $Header: /afs/rhic/phenix/cvsroot/offline/framework/phool/PHRawOManager.h,v 1.3 2000/04/12 17:24:15 messer Exp $
//
// The PHOOL's Software
// Copyright (C) PHENIX collaboration, 1999
//
// Declaration of class PHRawOManager
//
// Purpose: Write a node-tree into a PRDF file
//
// Description:
// - The default constructor sets all pointers to NULL. SetFile() would
// have to be called in addition.
// - The second constructor calls the setFile method to which it passes
// on its arguments. In order of appearance:
// 1. The filename, type PHString, no default
// 2. The runnumber, int, defaults to 0
// 3. The buffersize, int, defaults to 100000
// 4. The eventlength, int, defaults to -1, in which case a quarter
// of the selected buffersize will be chosen.
// 5. The compression-level. Values can range between 1 and 9, as in
// gzip, the underlying compression program. Zero means no
// compression at all, default is 3.
//
// Author: Matthias Messer
//-----------------------------------------------------------------------------
#ifndef PHRAWOMANAGER_H
#define PHRAWOMANAGER_H
#include "phool.h"
#include "PHIOManager.h"
#include "phenixTypes.h"
#include <stdio.h>
class PHCompositeNode;
class PHRawDataNode;
class oBuffer;
class PHRawOManager : public PHIOManager {
public:
PHRawOManager();
PHRawOManager(const PHString &, int = 0, int = 100000, int = -1, int = 3);
~PHRawOManager();
PHBoolean setFile(const PHString &, int, int, int, int);
virtual void closeFile();
virtual PHBoolean write(PHCompositeNode *);
PHBoolean write(PHRawDataNode*);
virtual void print() const;
private:
FILE *file;
DWORD *memBuffer;
oBuffer *fileBuffer;
int runNumber;
int bufferSize;
int eventLength;
int compressionLevel;
};
#endif /* PHRAWOMANAGER_H */