itfile.h
Go to the documentation of this file.
#ifndef ITFILE_H
#define ITFILE_H
#include <itpp/base/vec.h>
#include <itpp/base/array.h>
#include <itpp/base/binfile.h>
#include <itpp/base/ittypes.h>
#include <itpp/itexports.h>
namespace itpp
{
class ITPP_EXPORT it_file_base
{
public:
struct data_header {
uint64_t hdr_bytes;
uint64_t data_bytes;
uint64_t block_bytes;
std::string name;
std::string type;
std::string desc;
};
protected:
struct file_header {
char magic[4];
char version;
};
static char file_magic[4];
static char file_version;
};
class ITPP_EXPORT it_ifile : public it_file_base
{
public:
it_ifile();
explicit it_ifile(const std::string& filename);
virtual ~it_ifile() { }
void open(const std::string& filename);
virtual void close();
bfstream& low_level() { return s; }
bool read_check_file_header();
void read_data_header(it_file_base::data_header& h);
void low_level_read(char& x);
void low_level_read(uint64_t& x);
void low_level_read(bool &x);
void low_level_read(bin& x);
void low_level_read(short& x);
void low_level_read(int& x);
void low_level_read(float& x);
void low_level_read(double& x);
void low_level_read(std::complex<float>& x);
void low_level_read(std::complex<double>& x);
void low_level_read(bvec& v);
void low_level_read(svec& v);
void low_level_read(ivec& v);
void low_level_read_lo(vec& v);
void low_level_read_hi(vec& v);
void low_level_read_lo(cvec& v);
void low_level_read_hi(cvec& v);
void low_level_read(std::string& str);
void low_level_read(bmat& m);
void low_level_read(smat& m);
void low_level_read(imat& m);
void low_level_read_lo(mat& m);
void low_level_read_hi(mat& m);
void low_level_read_lo(cmat& m);
void low_level_read_hi(cmat& m);
void low_level_read(Array<bin>& v);
void low_level_read(Array<short>& v);
void low_level_read(Array<int>& v);
void low_level_read(Array<float>& v);
void low_level_read_lo(Array<double>& v);
void low_level_read_hi(Array<double>& v);
void low_level_read(Array<std::complex<float> >& v);
void low_level_read_lo(Array<std::complex<double> >& v);
void low_level_read_hi(Array<std::complex<double> >& v);
bool seek(const std::string& name);
bool seek(int n);
void info(std::string& name, std::string& type, std::string& desc,
uint64_t& bytes);
protected:
bfstream s;
};
class ITPP_EXPORT it_file : public it_ifile
{
public:
typedef it_file& (*it_manip)(it_file&);
it_file();
explicit it_file(const std::string& filename, bool trunc = false);
virtual ~it_file() { delete _strings;}
void open(const std::string& filename, bool trunc = false);
void close();
void flush();
bfstream& low_level() { return s; }
void set_low_precision(bool p = true) { low_prec = p; }
bool get_low_precision() const { return low_prec; }
void set_next_name(const std::string& name,
const std::string& description = "")
{ next_name() = name; next_desc() = description; }
void write_file_header();
void write_data_header(const std::string& type, uint64_t size);
void write_data_header(const std::string& type, const std::string& name,
uint64_t size, const std::string& description = "");
void low_level_write(char x);
void low_level_write(uint64_t x);
void low_level_write(bool x);
void low_level_write(bin x);
void low_level_write(short x);
void low_level_write(int x);
void low_level_write(float x);
void low_level_write(double x);
void low_level_write(const std::complex<float>& x);
void low_level_write(const std::complex<double>& x);
void low_level_write(const bvec& v);
void low_level_write(const svec& v);
void low_level_write(const ivec& v);
void low_level_write(const vec& v);
void low_level_write(const cvec& v);
void low_level_write(const std::string& str);
void low_level_write(const bmat& m);
void low_level_write(const smat& m);
void low_level_write(const imat& m);
void low_level_write(const mat& m);
void low_level_write(const cmat& m);
void low_level_write(const Array<bin>& v);
void low_level_write(const Array<short>& v);
void low_level_write(const Array<int>& v);
void low_level_write(const Array<float>& v);
void low_level_write(const Array<double>& v);
void low_level_write(const Array<std::complex<float> >& v);
void low_level_write(const Array<std::complex<double> >& v);
it_file& operator<<(it_manip func) { return (*func)(*this); }
void remove(const std::string& name);
bool exists(const std::string& name);
void pack();
protected:
void remove();
void write_data_header_here(const data_header& h);
bool low_prec;
std::string& next_name() {return _strings->_next_name;}
std::string& next_desc() {return _strings->_next_desc;}
private:
struct Strings_Holder
{
std::string _next_name;
std::string _next_desc;
std::string _fname;
Strings_Holder():_next_name(""),_next_desc(""),_fname(""){}
};
Strings_Holder* _strings;
// Name of the opened file. Needed by the pack() method.
std::string& fname() {return _strings->_fname;}
};
inline it_file& flush(it_file& f)
{
f.flush();
return f;
}
class ITPP_EXPORT Name
{
public:
Name(const std::string& n, const std::string& d = ""): name(n), desc(d) {}
Name &operator=(const Name&) { return *this; }
const std::string& name;
const std::string& desc;
};
inline it_ifile& operator>>(it_ifile& f, const Name& s)
{
f.seek(s.name);
return f;
}
inline it_file& operator<<(it_file& f, const Name& s)
{
f.set_next_name(s.name, s.desc);
return f;
}
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, char& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile &f, bool &v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, bin& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, short& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, int& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, float& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, double& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, std::complex<float>& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, std::complex<double>& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, bvec& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, svec& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, ivec& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, vec& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, cvec& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, std::string& str);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, bmat& m);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, smat& m);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, imat& m);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, mat& m);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, cmat& m);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, Array<bin>& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, Array<short>& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, Array<int>& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, Array<float>& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, Array<double>& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, Array<std::complex<float> >& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, Array<std::complex<double> >& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, Array<bvec>& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, Array<svec>& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, Array<ivec>& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, Array<vec>& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, Array<cvec>& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, Array<std::string>& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, Array<bmat>& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, Array<smat>& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, Array<imat>& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, Array<mat>& v);
ITPP_EXPORT it_ifile& operator>>(it_ifile& f, Array<cmat>& v);
ITPP_EXPORT it_file& operator<<(it_file& f, char x);
ITPP_EXPORT it_file& operator<<(it_file &f, bool x);
ITPP_EXPORT it_file& operator<<(it_file& f, bin x);
ITPP_EXPORT it_file& operator<<(it_file& f, short x);
ITPP_EXPORT it_file& operator<<(it_file& f, int x);
ITPP_EXPORT it_file& operator<<(it_file& f, float x);
ITPP_EXPORT it_file& operator<<(it_file& f, double x);
ITPP_EXPORT it_file& operator<<(it_file& f, std::complex<float> x);
ITPP_EXPORT it_file& operator<<(it_file& f, std::complex<double> x);
ITPP_EXPORT it_file& operator<<(it_file& f, const bvec& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const svec& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const ivec& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const vec& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const cvec& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const std::string& str);
ITPP_EXPORT it_file& operator<<(it_file& f, const bmat& m);
ITPP_EXPORT it_file& operator<<(it_file& f, const smat& m);
ITPP_EXPORT it_file& operator<<(it_file& f, const imat& m);
ITPP_EXPORT it_file& operator<<(it_file& f, const mat& m);
ITPP_EXPORT it_file& operator<<(it_file& f, const cmat& m);
ITPP_EXPORT it_file& operator<<(it_file& f, const Array<bin>& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const Array<short>& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const Array<int>& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const Array<float>& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const Array<double>& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const Array<std::complex<float> >& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const Array<std::complex<double> >& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const Array<bvec>& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const Array<svec>& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const Array<ivec>& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const Array<vec>& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const Array<cvec>& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const Array<std::string>& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const Array<bmat>& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const Array<smat>& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const Array<imat>& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const Array<mat>& v);
ITPP_EXPORT it_file& operator<<(it_file& f, const Array<cmat>& v);
template <class T> inline
void it_save_var_as(const T& v, const std::string& name)
{
it_file f(name + ".it");
f << Name(name) << v;
f.close();
}
template <class T> inline
void it_load_var_as(T& v, const std::string& name)
{
it_ifile f(name + ".it");
f.seek(name);
f >> v;
f.close();
}
#define it_save_var(v) it_save_var_as(v,#v)
#define it_load_var(v) it_load_var_as(v,#v)
// ----------------------------------------------------------------------
// Deprecated implementation of IT++ file format version 2
// Will be removed in future versions
// ----------------------------------------------------------------------
class ITPP_EXPORT it_file_base_old
{
public:
struct data_header {
char endianity;
uint32_t hdr_bytes, data_bytes, block_bytes;
std::string name;
std::string type;
};
protected:
struct file_header {
char magic[4];
char version;
};
static char file_magic[4];
static char file_version;
};
class ITPP_EXPORT it_ifile_old : public it_file_base_old
{
public:
it_ifile_old();
explicit it_ifile_old(const std::string& name);
virtual ~it_ifile_old() { }
void open(const std::string& name);
virtual void close();
bfstream& low_level() { return s; }
bool read_check_file_header();
void read_data_header(data_header& h);
void low_level_read(char& x);
void low_level_read(bin& x);
void low_level_read(short& x);
void low_level_read(int& x);
void low_level_read(float& x);
void low_level_read(double& x);
void low_level_read(std::complex<float>& x);
void low_level_read(std::complex<double>& x);
void low_level_read_lo(vec& v);
void low_level_read_hi(vec& v);
void low_level_read(ivec& v);
void low_level_read(bvec& v);
void low_level_read_lo(cvec& v);
void low_level_read_hi(cvec& v);
void low_level_read(std::string& str);
void low_level_read_lo(mat& m);
void low_level_read_hi(mat& m);
void low_level_read(imat& m);
void low_level_read(bmat& m);
void low_level_read_lo(cmat& m);
void low_level_read_hi(cmat& m);
void low_level_read_lo(Array<float>& v);
void low_level_read_lo(Array<double>& v);
void low_level_read_hi(Array<double>& v);
void low_level_read(Array<int>& v);
void low_level_read(Array<bin>& v);
void low_level_read_lo(Array<std::complex<float> >& v);
void low_level_read_lo(Array<std::complex<double> >& v);
void low_level_read_hi(Array<std::complex<double> >& v);
bool seek(const std::string& name);
bool seek(int n);
void info(std::string& name, std::string& type, int& bytes);
protected:
bfstream s;
};
class ITPP_EXPORT it_file_old : public it_ifile_old
{
public:
typedef it_file_old& (*it_manip)(it_file_old&);
it_file_old();
explicit it_file_old(const std::string& name, bool trunc = false);
virtual ~it_file_old() { delete _string;}
void open(const std::string& name, bool trunc = false);
void close();
void flush();
bfstream& low_level() { return s; }
void set_low_precision(bool p = true) { low_prec = p; }
bool get_low_precision() { return low_prec; }
void set_next_name(const std::string& n) { next_name() = n; }
void write_file_header();
void write_data_header(const std::string& type, uint32_t size);
void write_data_header(const std::string& type, const std::string& name,
uint32_t size);
void low_level_write(char x);
void low_level_write(bin x);
void low_level_write(short x);
void low_level_write(int x);
void low_level_write(float x);
void low_level_write(double x);
void low_level_write(const std::complex<float>& x);
void low_level_write(const std::complex<double>& x);
void low_level_write(const vec& v);
void low_level_write(const ivec& v);
void low_level_write(const bvec& v);
void low_level_write(const cvec& v);
void low_level_write(const std::string& str);
void low_level_write(const mat& m);
void low_level_write(const imat& m);
void low_level_write(const bmat& m);
void low_level_write(const cmat& m);
void low_level_write(const Array<float>& v);
void low_level_write(const Array<double>& v);
void low_level_write(const Array<int>& v);
void low_level_write(const Array<bin>& v);
void low_level_write(const Array<std::complex<float> >& v);
void low_level_write(const Array<std::complex<double> >& v);
it_file_old& operator<<(it_manip func) { return (*func)(*this); }
void remove(const std::string& name);
bool exists(const std::string& name);
void pack();
protected:
void remove();
void write_data_header_here(const data_header& h);
bool low_prec;
std::string& next_name() {return _string->_next_name;}
private:
struct String_Holder
{
std::string _next_name;
String_Holder():_next_name(""){}
};
String_Holder* _string;
};
inline it_file_old& flush(it_file_old& f)
{
f.flush();
return f;
}
inline it_ifile_old& operator>>(it_ifile_old& f, const Name& s)
{
f.seek(s.name);
return f;
}
inline it_file_old& operator<<(it_file_old& f, const Name& s)
{
f.set_next_name(s.name);
return f;
}
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, char& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, bin& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, short& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, int& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, float& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, double& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, std::complex<float>& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, std::complex<double>& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, vec& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, ivec& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, bvec& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, cvec& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, std::string& str);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, mat& m);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, imat& m);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, bmat& m);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, cmat& m);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, Array<float>& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, Array<double>& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, Array<int>& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, Array<bin>& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, Array<std::complex<float> >& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, Array<std::complex<double> >& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, Array<vec>& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, Array<ivec>& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, Array<bvec>& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, Array<cvec>& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, Array<std::string>& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, Array<mat>& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, Array<imat>& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, Array<bmat>& v);
ITPP_EXPORT it_ifile_old& operator>>(it_ifile_old& f, Array<cmat>& v);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, char x);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, bin x);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, short x);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, int x);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, float x);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, double x);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, std::complex<float> x);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, std::complex<double> x);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const vec& v);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const ivec& v);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const bvec& v);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const cvec& v);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const std::string& str);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const mat& m);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const imat& m);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const bmat& m);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const cmat& m);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const Array<float>& v);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const Array<double>& v);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const Array<int>& v);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const Array<bin>& v);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const Array<std::complex<float> >& v);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const Array<std::complex<double> >& v);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const Array<vec>& v);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const Array<ivec>& v);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const Array<bvec>& v);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const Array<cvec>& v);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const Array<std::string>& v);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const Array<mat>& v);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const Array<imat>& v);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const Array<bmat>& v);
ITPP_EXPORT it_file_old& operator<<(it_file_old& f, const Array<cmat>& v);
// ----------------------------------------------------------------------
// End of the deprecated implementation of IT++ file format version 2
// Will be removed in future versions
// ----------------------------------------------------------------------
} // namespace itpp
#endif // #ifndef IT_FILE_H
itpp::it_ifile::seek
bool seek(const std::string &name)
Find the variable name.
Definition: itfile.cpp:65
itpp::Name::Name
Name(const std::string &n, const std::string &d="")
Constructor.
Definition: itfile.h:432
itpp::it_file::low_prec
bool low_prec
Low precision flag. If true, use float type, otherwise double.
Definition: itfile.h:378
itpp::it_file_base_old::data_header::endianity
char endianity
0=little, 1=big
Definition: itfile.h:675
itpp::Array
General array class.
Definition: array.h:42
itpp::it_file::flush
void flush()
Flush the data to disk.
Definition: itfile.cpp:535
itpp::it_file_old::~it_file_old
virtual ~it_file_old()
Destructor.
Definition: itfile.h:824
itpp::it_file_base::file_version
static char file_version
IT++ file version.
Definition: itfile.h:124
itpp::it_file_base::data_header::type
std::string type
Data type, e.g. int32, float32, etc. type = "" means deleted.
Definition: itfile.h:108
itpp::it_file_base_old::data_header::type
std::string type
data type, e.g. int32, float32, etc. type = "" means deleted
Definition: itfile.h:683
itpp::it_ifile_old
The old (version 2) IT++ file format reading class.
Definition: itfile.h:707
itpp::Name::desc
const std::string & desc
The description.
Definition: itfile.h:438
itpp::operator<<
std::ostream & operator<<(std::ostream &output, const bin &inbin)
Output stream of bin.
Definition: binary.cpp:36
itpp::it_file_base_old
Base class for it_ifile_old and it_file_old.
Definition: itfile.h:668
itpp::Name
Automatic naming when savingAn easy way to give a variable a name and optionally description when sav...
Definition: itfile.h:428
itpp::it_ifile_old::~it_ifile_old
virtual ~it_ifile_old()
Destructor.
Definition: itfile.h:715
itpp::it_file_old
The old (version 2) IT++ file format reading and writing class.
Definition: itfile.h:806
itpp::Name::name
const std::string & name
The name string.
Definition: itfile.h:436
itpp::bfstream
Binary in/out-file Class.
Definition: binfile.h:603
itpp::it_file::get_low_precision
bool get_low_precision() const
Get the precision.
Definition: itfile.h:284
itpp::it_file::operator<<
it_file & operator<<(it_manip func)
ACTION: ADD DOCUMENTATION FOR THIS MEMBER !!!!!!!!
Definition: itfile.h:362
itpp::it_file_base::data_header::desc
std::string desc
Data description.
Definition: itfile.h:110
array.h
Definition of Array class (container)
itpp::it_file_base_old::file_header
File header structure.
Definition: itfile.h:689
itpp::it_file::close
void close()
Close the file.
Definition: itfile.cpp:530
itpp::it_ifile::s
bfstream s
Protected binary file stream.
Definition: itfile.h:237
itpp::Name::operator=
Name & operator=(const Name &)
Dummy assignment operator - MSVC++ warning C4512.
Definition: itfile.h:434
itpp::it_file_base_old::data_header::hdr_bytes
uint32_t hdr_bytes
Definition: itfile.h:678
ittypes.h
IT++ type definitions.
itpp::it_save_var_as
void it_save_var_as(const T &v, const std::string &name)
Save the variable v in the file name.it as the name name.
Definition: itfile.h:632
itpp::it_file::~it_file
virtual ~it_file()
Destructor.
Definition: itfile.h:263
itpp::it_ifile_old::seek
bool seek(const std::string &name)
Find the variable name.
Definition: itfile.cpp:1906
itpp::it_file
The IT++ file format reading and writing class.
Definition: itfile.h:245
itpp::it_file_old::low_level
bfstream & low_level()
Returns pointer to the underlying bfstream used.
Definition: itfile.h:841
itpp::size
int size(const Vec< T > &v)
Length of vector.
Definition: matfunc.h:55
itpp::it_ifile::~it_ifile
virtual ~it_ifile()
Destructor.
Definition: itfile.h:140
itpp::it_file::next_desc
std::string & next_desc()
Description to be used for saving the next variable.
Definition: itfile.h:382
itpp::flush
it_file & flush(it_file &f)
Flush operatorFlushes the data. Usage:
Definition: itfile.h:409
itpp::it_ifile
The IT++ file format reading class.
Definition: itfile.h:132
itpp::it_ifile::low_level
bfstream & low_level()
Returns pointer to the underlying bfstream used.
Definition: itfile.h:146
itpp::it_file_base_old::file_version
static char file_version
ACTION: Add documentation.
Definition: itfile.h:698
itpp::it_ifile_old::s
bfstream s
Protected binary file stream.
Definition: itfile.h:797
itpp::it_file_base_old::data_header
Data header structure.
Definition: itfile.h:673
itpp::it_file_old::flush
void flush()
Flush the data to disk.
Definition: itfile.cpp:2352
itpp::it_file_base::file_header::version
char version
IT++ file format version.
Definition: itfile.h:119
itpp::it_file_base_old::file_header::version
char version
ACTION: Add documentation.
Definition: itfile.h:693
itpp::it_file_base::data_header::data_bytes
uint64_t data_bytes
Number of bytes of the data.
Definition: itfile.h:102
itpp::it_file_old::low_prec
bool low_prec
ACTION: Add documenation for this protected member.
Definition: itfile.h:923
itpp::it_file_old::get_low_precision
bool get_low_precision()
Get the precision.
Definition: itfile.h:847
itpp::bin
Binary arithmetic (boolean) class.
Definition: binary.h:56
itpp::it_file_base::data_header::block_bytes
uint64_t block_bytes
Number of bytes of the header + data.
Definition: itfile.h:104
itpp::it_file_old::set_next_name
void set_next_name(const std::string &n)
Set the name of the next name to be saved. See also the Name class.
Definition: itfile.h:850
itpp::it_file_base::data_header::name
std::string name
Data name.
Definition: itfile.h:106
itpp::it_file_old::next_name
std::string & next_name()
ACTION: Add documenation for this protected member.
Definition: itfile.h:925
itpp::it_file::set_low_precision
void set_low_precision(bool p=true)
Set the precision. Low precision means floats, high means doubles.
Definition: itfile.h:282
itpp::it_file_base::data_header::hdr_bytes
uint64_t hdr_bytes
Number of bytes of the header.
Definition: itfile.h:100
itpp::it_file::low_level
bfstream & low_level()
Returns pointer to the underlying bfstream used.
Definition: itfile.h:279
itpp::it_file::set_next_name
void set_next_name(const std::string &name, const std::string &description="")
Set the name and optionally description of the next variable to be saved.
Definition: itfile.h:287
itpp::it_file_base::data_header
Data header structure.
Definition: itfile.h:98
itpp::it_ifile_old::low_level
bfstream & low_level()
Returns pointer to the underlying bfstream used.
Definition: itfile.h:721
itpp::it_file_base
Base class for it_ifile and it_file.
Definition: itfile.h:94
itpp::it_file_old::operator<<
it_file_old & operator<<(it_manip func)
ACTION: ADD DOCUMENTATION FOR THIS MEMBER !!!!!!!!
Definition: itfile.h:907
itpp::it_load_var_as
void it_load_var_as(T &v, const std::string &name)
Load the variable v from the file name.it as the name name.
Definition: itfile.h:641
itpp::operator>>
std::istream & operator>>(std::istream &input, bin &outbin)
Input stream of bin.
Definition: binary.cpp:42
binfile.h
Binary file formats definitions.
itpp::it_file_old::set_low_precision
void set_low_precision(bool p=true)
Set the precision. Low precision means floats, high means doubles.
Definition: itfile.h:844
itpp::it_file::next_name
std::string & next_name()
Name to be used for saving the next variable.
Definition: itfile.h:380
itpp::it_ifile::close
virtual void close()
Close the file.
Definition: itfile.cpp:60
itpp::it_file_base::file_header
File header structure.
Definition: itfile.h:115
bmat
Mat< bin > bmat
bin matrix
Definition: mat.h:508
vec.h
Templated Vector Class Definitions.

Generated on Thu Mar 20 2014 12:26:41 for IT++ by Doxygen 1.8.6