Bridge++  Ver. 2.0.2
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 "bridgeIO.h"
28 
30 
51 #ifdef USE_LIMELIB
52 
53 class FieldIO_LIME : public FieldIO
54 {
55  public:
56  static const std::string class_name;
57 
58  public:
59  FieldIO_LIME(const IO_Format::Format *format) : FieldIO(format)
60  {
61  }
62 
63  void read_file(Field& v, const std::string& filename);
64  void write_file(Field& v, const std::string& filename);
65 
66  private:
67  void process_file(Field *v, const std::string filename);
68 
69  void load_data(LimeReader *reader, Field *v);
70  void store_data(LimeWriter *writer, Field *v, bool mark_begin, bool mark_end);
71 
72  void load_lfn(LimeReader *reader);
73  void store_lfn(LimeWriter *reader, std::string lfn_string);
74 };
75 
76 #else
77 
78 class FieldIO_LIME : public FieldIO
79 {
80  public:
81  FieldIO_LIME(const IO_Format::Format *format) : FieldIO(format)
82  {
83  Bridge::vout.crucial("Error at FieldIO_LIME: USE_LIMELIB is not defined.\n");
84 
85  exit(EXIT_FAILURE);
86  }
87 
88  void read_file(Field& v, const std::string& filename);
89  void write_file(Field& v, const std::string& filename);
90 };
91 #endif
92 #endif /* GAUGECONFIG_ILDG_INCLUDED */
bridgeIO.h
IO_Format::Format
Definition: io_format.h:36
FieldIO_LIME::write_file
void write_file(Field &v, const std::string &filename)
write data to file. (‘const’ is added [18 Mar 2021])
Definition: fieldIO_LIME.cpp:350
FieldIO::class_name
static const std::string class_name
Definition: fieldIO.h:56
fieldIO.h
FieldIO_LIME::read_file
void read_file(Field &v, const std::string &filename)
read data from file. (‘const’ is added [18 Mar 2021])
Definition: fieldIO_LIME.cpp:343
FieldIO
FieldIO class for file I/O of space-time distributed data.
Definition: fieldIO.h:53
FieldIO_LIME
FieldIO_LIME class for file I/O of Field data in LIME format.
Definition: fieldIO_LIME.h:78
Bridge::BridgeIO::crucial
void crucial(const char *format,...)
Definition: bridgeIO.cpp:180
Field
Container of Field-type object.
Definition: field.h:46
FieldIO_LIME::FieldIO_LIME
FieldIO_LIME(const IO_Format::Format *format)
Definition: fieldIO_LIME.h:81
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512