diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-07-25 19:49:28 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-07-25 19:49:28 +0200 |
commit | a599317624fb8428eb64cf719affcdd075f5c9d5 (patch) | |
tree | 7669ffd4a1acab1b0caf003443ed470de6fe34ea /Libraries/LibCore/CTimer.h | |
parent | d21a4f7518ced2b49e20b3b2521c80b0afec216d (diff) | |
download | serenity-a599317624fb8428eb64cf719affcdd075f5c9d5.zip |
LibCore: Introduce a C_OBJECT macro.
This macro goes at the top of every CObject-derived class like so:
class SomeClass : public CObject {
C_OBJECT(SomeClass)
public:
...
At the moment, all it does is create an override for the class_name() getter
but in the future this will be used to automatically insert member functions
into these classes.
Diffstat (limited to 'Libraries/LibCore/CTimer.h')
-rw-r--r-- | Libraries/LibCore/CTimer.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Libraries/LibCore/CTimer.h b/Libraries/LibCore/CTimer.h index b6c1c2005f..3abb54d6f6 100644 --- a/Libraries/LibCore/CTimer.h +++ b/Libraries/LibCore/CTimer.h @@ -4,6 +4,7 @@ #include <LibCore/CObject.h> class CTimer final : public CObject { + C_OBJECT(CTimer) public: explicit CTimer(CObject* parent = nullptr); CTimer(int interval, Function<void()>&& timeout_handler, CObject* parent = nullptr); @@ -29,8 +30,6 @@ public: Function<void()> on_timeout; - virtual const char* class_name() const override { return "CTimer"; } - private: virtual void timer_event(CTimerEvent&) override; |