IdentifiedObjectAbstract.hpp
1 #pragma once
2 #include <QObject>
3 
4 #include <score_lib_base_export.h>
5 
6 #include <cinttypes>
7 #include <verdigris>
8 
15 class SCORE_LIB_BASE_EXPORT IdentifiedObjectAbstract : public QObject
16 {
17  W_OBJECT(IdentifiedObjectAbstract)
18 public:
19  virtual int32_t id_val() const noexcept = 0;
20  ~IdentifiedObjectAbstract() override;
21 
24  E_SIGNAL(SCORE_LIB_BASE_EXPORT, identified_object_destroying, o)
25 
26 
27  void identified_object_destroyed(IdentifiedObjectAbstract* o)
28  E_SIGNAL(SCORE_LIB_BASE_EXPORT, identified_object_destroyed, o)
29 
30  virtual void resetCache() const noexcept = 0;
31 
32 protected:
33  using QObject::QObject;
34  IdentifiedObjectAbstract(const QString& name, QObject* parent) noexcept
35  {
36  QObject::setObjectName(name);
37  QObject::setParent(parent);
38  }
39 };
40 
41 W_REGISTER_ARGTYPE(IdentifiedObjectAbstract*)
Base class for IdentifiedObject.
Definition: IdentifiedObjectAbstract.hpp:16
void identified_object_destroying(IdentifiedObjectAbstract *o)
To be called by subclasses.