52 for(
auto i = cbegin(); i != cend(); ++i)
73 fOut.open(fileName, std::ios::out | std::ios::binary);
77 fOut.open(fileName, std::ios::out);
84 G4cerr <<
"G4OrderedTable::::Store():";
94 fOut.write((
char*) (&tableSize),
sizeof tableSize);
98 fOut << tableSize <<
G4endl;
102 for(
const auto itr : *
this)
106 fOut.write((
char*) (&vType),
sizeof vType);
112 itr->Store(fOut, ascii);
125 fIn.open(fileName, std::ios::in | std::ios::binary);
129 fIn.open(fileName, std::ios::in);
136 G4cerr <<
"G4OrderedTable::Retrieve():";
150 fIn.read((
char*) (&tableSize),
sizeof tableSize);
159 G4cerr <<
"G4OrderedTable::Retrieve():";
160 G4cerr <<
" Invalid table size: " << tableSize <<
G4endl;
167 for(
G4int idx = 0; idx < tableSize; ++idx)
172 fIn.read((
char*) (&vType),
sizeof vType);
181 G4cerr <<
"G4OrderedTable::Retrieve():";
182 G4cerr <<
" Illegal Data Vector type: " << vType <<
" in ";
191 if(!(pVec->Retrieve(fIn, ascii)))
194 G4cerr <<
"G4OrderedTable::Retrieve(): ";
195 G4cerr <<
" Error in retreiving " << idx
196 <<
"-th Physics Vector from file: ";
216 for(
const auto itr : right)
218 out << std::setw(8) << i <<
"-th Vector ";
std::ostream & operator<<(std::ostream &out, G4OrderedTable &right)
G4GLOB_DLL std::ostream G4cerr
G4bool Store(const G4String &filename, G4bool ascii=false)
G4bool Retrieve(const G4String &filename, G4bool ascii=false)