Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
object.hh
Go to the documentation of this file.
1 // This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0
2#ifndef __ASE_OBJECT_HH__
3#define __ASE_OBJECT_HH__
4
5#include <ase/api.hh>
6#include <unordered_set>
7
8namespace Ase {
9
11class EmittableImpl : public virtual Emittable {
12 struct EventDispatcher;
13 EventDispatcher *ed_ = nullptr;
14 friend class EventConnection;
15protected:
16 virtual ~EmittableImpl ();
17public:
18 ASE_USE_RESULT
19 Connection on_event (const String &eventselector, const EventHandler &eventhandler) override;
20 void emit_event (const String &type, const String &detail, const ValueR fields = {}) override;
21 void emit_notify (const String &detail) override;
22};
23
25 struct Notification {
26 EmittableP emittable; String detail;
27 bool operator== (const Notification &b) const { return emittable == b.emittable && detail == b.detail; }
28 };
29 struct NotificationHash { size_t operator() (const Notification&) const; };
31 NotificationSet notifications_;
32 CoalesceNotifies *next_ = nullptr;
33public:
34 explicit CoalesceNotifies ();
35 void flush_notifications ();
36 /*dtor*/ ~CoalesceNotifies ();
37 friend class EmittableImpl;
38};
39
41class ObjectImpl : public EmittableImpl, public virtual Object {
42protected:
43 virtual ~ObjectImpl () = 0;
44public:
45};
47
48} // Ase
49
50#endif // __ASE_OBJECT_HH__
Implementation type for classes with Event subscription.
Definition object.hh:11
void emit_notify(const String &detail) override
Emit notify:detail, multiple notifications maybe coalesced if a CoalesceNotifies instance exists.
Definition object.cc:164
Base type for classes with Event subscription.
Definition api.hh:121
Implementation type for classes with Property interfaces.
Definition object.hh:41
Base type for classes with Property interfaces.
Definition api.hh:170
The Anklang C++ API namespace.
Definition api.hh:9