FileFormatVersion.h
Go to the documentation of this file.
1 #ifndef canvas_Persistency_Provenance_FileFormatVersion_h
2 #define canvas_Persistency_Provenance_FileFormatVersion_h
3 
4 #include <iosfwd>
5 #include <string>
6 
7 namespace art {
8 
10  FileFormatVersion() = default;
11  explicit FileFormatVersion(int vers) : FileFormatVersion{vers, {}} {}
12  FileFormatVersion(int vers, std::string const& era)
13  : value_{vers}, era_{era}
14  {}
15  bool
16  isValid() const
17  {
18  return value_ >= 0;
19  }
20 
21  int value_{-1};
23  };
24 
25  // Note for backward compatibility and efficiency reasons, comparison
26  // operators do not take era into account. This must be checked explicitly.
27  inline bool
29  {
30  return a.value_ == b.value_;
31  }
32 
33  inline bool
35  {
36  return !(a == b);
37  }
38 
39  std::ostream& operator<<(std::ostream& os, FileFormatVersion const& ff);
40 }
41 
42 #endif /* canvas_Persistency_Provenance_FileFormatVersion_h */
43 
44 // Local Variables:
45 // mode: c++
46 // End:
std::ostream & operator<<(std::ostream &os, EDAnalyzer::Table< T > const &t)
Definition: EDAnalyzer.h:184
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &)
double era(double jd_high, double jd_low)
const double a
const hit & b
Definition: hits.cxx:21
Service to store calibration data products (CDP) in the SQLite3 metadatabase of a file...
Definition: FillParentInfo.h:8
TFile ff[ntarg]
Definition: Style.C:26
bool operator==(Provenance const &a, Provenance const &b)
Definition: Provenance.h:168
FileFormatVersion(int vers, std::string const &era)
enum BeamMode string