LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ParameterSetID.h
Go to the documentation of this file.
1 #ifndef fhiclcpp_ParameterSetID_h
2 #define fhiclcpp_ParameterSetID_h
3 
4 // ======================================================================
5 //
6 // ParameterSetID
7 //
8 // ======================================================================
9 
10 #include "cetlib/sha1.h"
11 #include "fhiclcpp/fwd.h"
12 
13 #include <cstdlib>
14 #include <ostream>
15 #include <string>
16 
17 namespace fhicl {
18  std::ostream& operator<<(std::ostream&, ParameterSetID const&);
19 }
20 
21 // ----------------------------------------------------------------------
22 
24 public:
25  // c'tor's:
26  ParameterSetID() noexcept;
27  explicit ParameterSetID(ParameterSet const&);
28  explicit ParameterSetID(std::string const& id);
29 
30  // observers:
31  bool is_valid() const noexcept;
32  std::string to_string() const;
33  static constexpr std::size_t max_str_size() noexcept;
34 
35  // mutators:
36  void invalidate() noexcept;
37  void reset(ParameterSet const&);
38  void swap(ParameterSetID&);
39 
40  // comparators:
41  bool operator==(ParameterSetID const&) const noexcept;
42  bool operator!=(ParameterSetID const&) const noexcept;
43  bool operator<(ParameterSetID const&) const noexcept;
44  bool operator>(ParameterSetID const&) const noexcept;
45  bool operator<=(ParameterSetID const&) const noexcept;
46  bool operator>=(ParameterSetID const&) const noexcept;
47 
48 private:
49  bool valid_;
50  cet::sha1::digest_t id_;
51 
52 }; // ParameterSetID
53 
54 inline constexpr std::size_t
56 {
57  // Two hex digits per byte.
58  return 2 * cet::sha1::digest_sz;
59 }
60 
61 // ======================================================================
62 
63 #endif /* fhiclcpp_ParameterSetID_h */
64 
65 // Local Variables:
66 // mode: c++
67 // End:
void swap(ParameterSetID &)
std::string to_string() const
bool operator>(ParameterSetID const &) const noexcept
bool operator>=(ParameterSetID const &) const noexcept
bool operator!=(ParameterSetID const &) const noexcept
cet::sha1::digest_t id_
parameter set interface
static constexpr std::size_t max_str_size() noexcept
bool operator<(ParameterSetID const &) const noexcept
bool is_valid() const noexcept
bool operator<=(ParameterSetID const &) const noexcept
void reset(ParameterSet const &)
void invalidate() noexcept
std::ostream & operator<<(std::ostream &, ParameterSetID const &)
bool operator==(ParameterSetID const &) const noexcept