LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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  // compiler generates d'tor, copy c'tor, copy assignment
26 
27  // c'tor's:
29  explicit ParameterSetID(ParameterSet const&);
30  explicit ParameterSetID(std::string const& id);
31 
32  // observers:
33  bool is_valid() const;
34  std::string to_string() const;
35  static std::size_t max_str_size();
36 
37  // mutators:
38  void invalidate();
39  void reset(ParameterSet const&);
40  void swap(ParameterSetID&);
41 
42  // comparators:
43  bool operator==(ParameterSetID const&) const;
44  bool operator!=(ParameterSetID const&) const;
45  bool operator<(ParameterSetID const&) const;
46  bool operator>(ParameterSetID const&) const;
47  bool operator<=(ParameterSetID const&) const;
48  bool operator>=(ParameterSetID const&) const;
49 
50 private:
51  bool valid_;
53 
54 }; // ParameterSetID
55 
56 inline std::size_t
58 {
59  // Two hex digits per byte.
60  return 2 * cet::sha1::digest_sz;
61 }
62 
63  // ======================================================================
64 
65 #endif /* fhiclcpp_ParameterSetID_h */
66 
67 // Local Variables:
68 // mode: c++
69 // End:
void swap(ParameterSetID &)
std::string to_string() const
cet::sha1::digest_t id_
bool operator>(ParameterSetID const &) const
sha1::digest_t digest_t
parameter set interface
static std::size_t max_str_size()
bool operator<(ParameterSetID const &) const
bool operator!=(ParameterSetID const &) const
bool operator==(ParameterSetID const &) const
void reset(ParameterSet const &)
bool operator<=(ParameterSetID const &) const
bool operator>=(ParameterSetID const &) const
std::ostream & operator<<(std::ostream &, ParameterSetID const &)
bool is_valid() const