/usr/include/measurement_kit/dns/qctht_.hpp is in libmeasurement-kit-dev 0.7.1-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | // Part of measurement-kit <https://measurement-kit.github.io/>.
// Measurement-kit is free software. See AUTHORS and LICENSE for more
// information on the copying conditions.
#ifndef MEASUREMENT_KIT_DNS_QCTHT__HPP
#define MEASUREMENT_KIT_DNS_QCTHT__HPP
// QCTHT = query class and type helper template
#include <string>
#include <tuple>
namespace mk {
namespace dns {
template <typename Type, Type (*Mapping)(std::string)> class qctht_ {
public:
qctht_() noexcept {}
qctht_(Type v) noexcept : id_{v} {}
template <typename Stringish> qctht_(Stringish v) { *this = v; }
qctht_ &operator=(Type v) noexcept {
id_ = v;
return *this;
}
template <typename Stringish> qctht_ &operator=(Stringish v) {
id_ = (*Mapping)(v);
return *this;
}
bool operator==(Type id) const noexcept { return id_ == id; }
bool operator!=(Type id) const noexcept { return id_ != id; }
operator Type() const noexcept { return id_; }
private:
Type id_ = (*Mapping)("");
};
} // namespace dns
} // namespace mk
#endif
|