26class UuidIdentifiableBase :
public QObject
31 explicit UuidIdentifiableBase (QObject * parent =
nullptr)
32 : QObject (parent), uuid_ (QUuid::createUuid ())
35 UuidIdentifiableBase (
const QUuid &
id, QObject * parent =
nullptr)
36 : QObject (parent), uuid_ (
id)
40 Q_DISABLE_COPY_MOVE (UuidIdentifiableBase)
41 ~UuidIdentifiableBase ()
override =
default;
43 QUuid raw_uuid ()
const {
return uuid_; }
46 operator== (
const UuidIdentifiableBase &lhs,
const UuidIdentifiableBase &rhs)
48 return lhs.uuid_ == rhs.uuid_;
51 friend void to_json (nlohmann::json &j,
const UuidIdentifiableBase &obj);
52 friend void from_json (
const nlohmann::json &j, UuidIdentifiableBase &obj);
55 void set_raw_uuid (
const QUuid &
id) { uuid_ = id; }
60 BOOST_DESCRIBE_CLASS (UuidIdentifiableBase, (), (), (), (uuid_))