22#include "smats/util/concepts.h"
23#include "smats/util/hash.hpp"
36 using Id = std::size_t;
39 enum class Type : std::uint8_t {
64 name_ = std::move(other.name_);
76 [[nodiscard]] Id
id()
const {
return id_; }
80 [[nodiscard]]
const std::string&
name()
const;
85 [[nodiscard]]
inline bool less(
const Variable& o)
const noexcept {
return id_ < o.id_; }
105 std::shared_ptr<const std::string>
name_;
108std::ostream& operator<<(std::ostream& os,
const Variable& var);
std::shared_ptr< const std::string > name_
Name of the variable.
Definition variable.h:105
Variable()
Definition variable.h:52
Id id_
Unique identifier for the variable. The high-order byte stores the Type.
Definition variable.h:104
static Id get_next_id(Variable::Type type)
Definition variable.cpp:19
bool less(const Variable &o) const noexcept
Definition variable.h:85
bool is_dummy() const
Definition variable.h:74
void hash(InvocableHashAlgorithm auto &hasher) const noexcept
Definition variable.h:87
Id id() const
Definition variable.h:76
Type type() const
Definition variable.h:78
Type
Definition variable.h:39
@ INTEGER
An INTEGER variable takes an int value.
@ BINARY
A BINARY variable takes an integer value from {0, 1}.
@ CONTINUOUS
A CONTINUOUS variable takes a double value.
@ BOOLEAN
A BOOLEAN variable takes a bool value.
const std::string & name() const
Definition variable.cpp:33
bool equal_to(const Variable &o) const noexcept
Definition variable.h:83
void hash_append(HashAlgorithm &hasher, const T &hashable) noexcept
Definition hash.hpp:79