#pragma once namespace saw { /** * ID class which is tied to it's representing class */ template class id { private: /** * Alias for the value type representing the ID */ using type = uint64_t; /** * The low level value */ type value_; public: /** * Basic constructor for the id class */ id(type val): value_{val} {} SAW_DEFAULT_COPY(id); SAW_DEFAULT_MOVE(id); /** * Equal operator for the id. * Returns true if equal, false otherwise. */ bool operator==(const id& rhs) const { return value_ == rhs.value_; } /** * Unequal operator for the id. * Returns false if equal, true otherwise. */ bool operator!=(const id& rhs) const { return !(*this == rhs); } /** * Returns a const ref of the underlying base type. * Mostly used for internal purposes. */ const type& get_value() const { return value_; } }; /** * @experimental * Container for a class which has relations to the provided id classes. * Meant as an idea for a generic class which uses this */ template class obj_owns_ids { private: std::tuple children_; T obj_; public: obj_owns_ids(T obj, Ids... children): obj_{std::move(obj)}, children_{std::move(children)} {} }; }