Bridge++  Ver. 1.3.x
fieldIO_LIME.h
Go to the documentation of this file.
1 
14 #ifndef FIELDIO_LIME_INCLUDED
15 #define FIELDIO_LIME_INCLUDED
16 
17 #ifdef USE_LIMELIB
18 extern "C" {
19 #include <lime.h>
20 }
21 #endif
22 
23 #include "fieldIO.h"
24 //#include "ildg_metadata.h"
25 
26 #include "bridgeIO.h"
27 
28 #undef USE_ILDG_METADATA
29 
31 
52 #ifdef USE_LIMELIB
53 
54 class FieldIO_LIME : public FieldIO
55 {
56  public:
57  static const std::string class_name;
58 
59  public:
60  FieldIO_LIME(const IO_Format::Format *format) : FieldIO(format)
61  {
62  }
63 
64  void read_file(Field *v, std::string filename);
65  void write_file(Field *v, std::string filename);
66 
67  void read_file(std::vector<Field *>& vv, const std::string& filename);
68  void write_file(std::vector<Field *>& vv, const std::string& filename);
69 
70  private:
71 
72  void process_file(Field *v, std::string filename);
73 
74  void load_data(LimeReader *reader, Field *v);
75  void store_data(LimeWriter *writer, Field *v, bool mark_begin, bool mark_end);
76 
77 #ifdef USE_ILDG_METADATA
78  void load_metadata(LimeReader *reader, ILDG_Format::Params *params);
79  void check_metadata(const ILDG_Format::Params *params);
80  void store_metadata(LimeWriter *writer);
81 #endif
82 
83  void load_lfn(LimeReader *reader);
84  void store_lfn(LimeWriter *reader, std::string lfn_string);
85 };
86 
87 #else
88 
89 class FieldIO_LIME : public FieldIO
90 {
91  public:
92  FieldIO_LIME(const IO_Format::Format *format) : FieldIO(format)
93  {
94  Bridge::vout.crucial("FieldIO_LIME: USE_LIMELIB is not defined.\n");
95 
96  exit(EXIT_FAILURE);
97  }
98 
99  void read_file(Field *v, std::string filename);
100  void write_file(Field *v, std::string filename);
101 };
102 #endif
103 #endif /* GAUGECONFIG_ILDG_INCLUDED */
BridgeIO vout
Definition: bridgeIO.cpp:278
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:89
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:92
void crucial(const char *format,...)
Definition: bridgeIO.cpp:48
FieldIO class for file I/O of space-time distributed data.
Definition: fieldIO.h:53