-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIObserver.h
30 lines (22 loc) · 950 Bytes
/
IObserver.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef IObserverH
#define IObserverH
#include <System.hpp> // <-- for IUnknown
namespace AreaPrj {
class IObserver : public IUnknown {
public:
// These three stupid methods are needed to get rid of even more stupid
// warnings from the Embarcadero clang compilers that claim that the
// classes that a form derives from and that have an 'I' at the beginning
// of their name themselves have to derive from IUnknown.
//
// [bcc(32c|64) Warning]: Interface 'IObserver' does not derive
// from IUnknown. (Interfaces should derive from IUnknown)
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void ** ppvObject) override { return {}; }
virtual ULONG STDMETHODCALLTYPE AddRef() override { return {}; }
virtual ULONG STDMETHODCALLTYPE Release() override { return {}; }
void Notify() { DoNotify(); }
protected:
virtual void DoNotify() = 0;
};
} // End of namespace AreaPrj
#endif