ALIFileOut

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
//   COCOA class header file
//Id:  ALIFileOut.h
//CAT: Model
//
//   ostream class for handling the output
//
//   History: v1.0
//   Pedro Arce

#ifndef FILEOUT_H
#define FILEOUT_H

#include <fstream>
#include <iostream>

#include <vector>
//#include "bstring.h"

#include "Alignment/CocoaUtilities/interface/CocoaGlobals.h"

class ALIFileOut : public std::ofstream {
public:
  ALIFileOut() {}
  ALIFileOut(const ALIstring& name) : std::ofstream(), theName(name) {}
  ~ALIFileOut() override {}

  // get the instance of file with name filename
  static ALIFileOut& getInstance(const ALIstring& filename);

  // Access data members
  const ALIstring& name() { return theName; }

  // private DATA MEMEBERS
private:
  // Class only instance
  static std::vector<ALIFileOut*> theInstances;

  /// Name of file
  ALIstring theName;
};

#endif