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 const vers) : FileFormatVersion{vers, {}} {}
12  FileFormatVersion(int const 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:
bool operator==(Provenance const &a, Provenance const &b) noexcept
Definition: Provenance.cc:141
std::string string
Definition: nybbler.cc:12
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &)
std::ostream & operator<<(std::ostream &os, const GroupSelector &gs)
FileFormatVersion(int const vers, std::string const &era)
const double a
FileFormatVersion(int const vers)
static bool * b
Definition: config.cpp:1043