6 #include "nlohmann/json.hpp"
39 std::
size_t size() const noexcept;
47 std::
size_t hash() const noexcept;
52 bool equal(const
std::
string &other) const noexcept;
62 bool operator==(const
Identifier &rhs) const noexcept;
67 std::strong_ordering operator<=>(const
Identifier &rhs) const noexcept = default;
77 friend
std::ostream &operator<<(
std::ostream &stream, const
Identifier &identifier);
81 std::size_t hash_code_{std::hash<std::string>{}(
"")};
83 void validate_identifeir()
const;
95 template <>
struct hash<
hgps::core::Identifier> {
Top-level namespace for Health-GPS Core C++ API.
Definition: analysis.h:7
void from_json(const nlohmann::json &j, Identifier &id)
Definition: identifier.cpp:59
Top-level namespace for Health-GPS C++ API.
Definition: analysis_definition.h:8
nlohmann::json json
JSON parser namespace alias.
Definition: jsonparser.h:16
Global namespace.
Definition: jsonparser.h:88
Entity unique identifier data type.
Definition: identifier.h:17
bool is_empty() const noexcept
Checks whether this is an empty identifier.
Definition: identifier.cpp:23
bool equal(const std::string &other) const noexcept
Determines whether a string representation and this instance have same value.
Definition: identifier.cpp:35
constexpr Identifier()=default
Initialises a new instance of the hgps::core::Identifier class.
std::size_t size() const noexcept
Gets the side of the identifier.
Definition: identifier.cpp:25
std::size_t hash() const noexcept
Gets the identifier hash code value.
Definition: identifier.cpp:29
static Identifier empty()
Represents the empty Identifier, read-only.
Definition: identifier.cpp:8
const std::string & to_string() const noexcept
Convert the identifier to a string representation.
Definition: identifier.cpp:27
size_t operator()(const hgps::core::Identifier &id) const noexcept
Definition: identifier.h:96