Bridge++  Version 1.4.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, std::string filename);
68  void write_file(Field *v, 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 
75  void process_file(Field *v, std::string filename);
76 
77  void load_data(LimeReader *reader, Field *v);
78  void store_data(LimeWriter *writer, Field *v, bool mark_begin, bool mark_end);
79 
80 #ifdef USE_ILDG_METADATA
81  void load_metadata(LimeReader *reader, ILDG_Format::Params *params);
82  void check_metadata(const ILDG_Format::Params *params);
83  void store_metadata(LimeWriter *writer);
84 #endif
85 
86  void load_lfn(LimeReader *reader);
87  void store_lfn(LimeWriter *reader, std::string lfn_string);
88 };
89 
90 #else
91 
92 class FieldIO_LIME : public FieldIO
93 {
94  public:
95  FieldIO_LIME(const IO_Format::Format *format) : FieldIO(format)
96  {
97  Bridge::vout.crucial("Error at FieldIO_LIME: USE_LIMELIB is not defined.\n");
98 
99  exit(EXIT_FAILURE);
100  }
101 
102  void read_file(Field *v, std::string filename);
103  void write_file(Field *v, std::string filename);
104 };
105 #endif
106 #endif /* GAUGECONFIG_ILDG_INCLUDED */
BridgeIO vout
Definition: bridgeIO.cpp:495
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:92
Container of Field-type object.
Definition: field.h:39
void read_file(Field *v, std::string filename)
read data from file.
void write_file(Field *v, std::string filename)
write data to file.
FieldIO_LIME(const IO_Format::Format *format)
Definition: fieldIO_LIME.h:95
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
FieldIO class for file I/O of space-time distributed data.
Definition: fieldIO.h:53