16 const std::string file_magic=
"XXXXQDPLazyDiskMapObjFileXXXX";
26 reader.
open(filename);
28 std::string read_magic;
32 if (read_magic != MapObjDiskEnv::file_magic) {
33 QDPIO::cerr <<
"Magic String Wrong: Expected: " << MapObjDiskEnv::file_magic <<
" but read: " << read_magic << std::endl;
38 read(reader, read_version);
40 std::string user_data;
51 bool new_file =
false;
56 if ((mode & std::ios_base::trunc) || (stat(file.c_str(), &statbuf) != 0 && (errno == ENOENT)))
void open(const std::string &p)
Opens a file for reading.
void close()
Closes the last file opened.
virtual void readDesc(std::string &result)
void readDesc(BinaryReader &bin, std::string &input)
void read(BinaryReader &bin, std::string &input, size_t maxBytes)
bool primaryNode()
Returns whether this is the primary node.
bool checkForNewFile(const std::string &file, std::ios_base::openmode mode)
Check if this will be a new file.
std::string getFileMagic()
Get the file magic.
unsigned int file_version_t
std::string getMetaData(const std::string &filename)
Get the meta-data from a file.
StandardOutputStream cerr
void broadcast(T &dest)
Broadcast from primary node to all other nodes.
Yet another random number generator.
void QDP_abort(int status)
Panic button.
A Map Object that works lazily from Disk.