File indexing completed on 2024-04-06 11:56:05
0001
0002
0003
0004
0005
0006
0007
0008 #include "Alignment/CocoaUtilities/interface/ALIFileOut.h"
0009
0010 #include <cstdlib>
0011 #include <sstream>
0012
0013 std::vector<ALIFileOut*> ALIFileOut::theInstances;
0014
0015
0016
0017
0018 ALIFileOut& ALIFileOut::getInstance(const ALIstring& filename) {
0019 std::vector<ALIFileOut*>::const_iterator vfcite;
0020 for (vfcite = theInstances.begin(); vfcite != theInstances.end(); ++vfcite) {
0021 if ((*vfcite)->name() == filename) {
0022 return *(*vfcite);
0023 break;
0024 }
0025 }
0026
0027 if (vfcite == theInstances.end()) {
0028 ALIFileOut* instance = new ALIFileOut(filename);
0029 instance->open(filename.c_str());
0030 if (!instance) {
0031 std::cerr << "!! cannot open output file " << filename << std::endl;
0032 exit(0);
0033 }
0034 theInstances.push_back(instance);
0035 return *instance;
0036 }
0037
0038 ALIFileOut* instance = new ALIFileOut(filename);
0039 return *instance;
0040 }