Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fieldIO_LIME.h
Go to the documentation of this file.
1 
14 #ifndef FIELDIO_LIME_INCLUDED
15 #define FIELDIO_LIME_INCLUDED
16 
17 #include <string>
18 using std::string;
19 
20 #ifdef USE_LIMELIB
21 extern "C" {
22 #include <lime.h>
23 }
24 #endif
25 
26 #include "fieldIO.h"
27 //#include "ildg_metadata.h"
28 
29 #include "bridgeIO.h"
30 
31 #undef USE_ILDG_METADATA
32 
34 
55 #ifdef USE_LIMELIB
56 
57 class FieldIO_LIME : public FieldIO
58 {
59  public:
60  static const std::string class_name;
61 
62  public:
63  FieldIO_LIME(const IO_Format::Format *format) : FieldIO(format)
64  {
65  }
66 
67  void read_file(Field *v, const std::string filename);
68  void write_file(Field *v, const std::string filename);
69 
70  void read_file(std::vector<Field *>& vv, const std::string& filename);
71  void write_file(std::vector<Field *>& vv, const std::string& filename);
72 
73  private:
74  void process_file(Field *v, const std::string filename);
75 
76  void load_data(LimeReader *reader, Field *v);
77  void store_data(LimeWriter *writer, Field *v, bool mark_begin, bool mark_end);
78 
79 #ifdef USE_ILDG_METADATA
80  void load_metadata(LimeReader *reader, ILDG_Format::Params *params);
81  void check_metadata(const ILDG_Format::Params *params);
82  void store_metadata(LimeWriter *writer);
83 #endif
84 
85  void load_lfn(LimeReader *reader);
86  void store_lfn(LimeWriter *reader, std::string lfn_string);
87 };
88 
89 #else
90 
91 class FieldIO_LIME : public FieldIO
92 {
93  public:
94  FieldIO_LIME(const IO_Format::Format *format) : FieldIO(format)
95  {
96  Bridge::vout.crucial("Error at FieldIO_LIME: USE_LIMELIB is not defined.\n");
97 
98  exit(EXIT_FAILURE);
99  }
100 
101  void read_file(Field *v, const std::string filename);
102  void write_file(Field *v, const std::string filename);
103 };
104 #endif
105 #endif /* GAUGECONFIG_ILDG_INCLUDED */
BridgeIO vout
Definition: bridgeIO.cpp:503
static const std::string class_name
Definition: fieldIO.h:56
FieldIO_LIME class for file I/O of Field data in LIME format.
Definition: fieldIO_LIME.h:91
Container of Field-type object.
Definition: field.h:45
void write_file(Field *v, const std::string filename)
write data to file.
FieldIO_LIME(const IO_Format::Format *format)
Definition: fieldIO_LIME.h:94
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
void read_file(Field *v, const std::string filename)
read data from file.
FieldIO class for file I/O of space-time distributed data.
Definition: fieldIO.h:53