Anklang-0.3.0.dev956+gd75ac925 anklang-0.3.0.dev956+gd75ac925
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#pragma once
3
4#include <ase/api.hh>
5#include <unordered_set>
6
7namespace Ase {
8
10class EmittableImpl : public virtual Emittable {
11 struct EventDispatcher;
12 EventDispatcher *ed_ = nullptr;
13 friend class EventConnection;
14protected:
15 virtual ~EmittableImpl ();
16public:
17 ASE_USE_RESULT
18 Connection on_event (const String &eventselector, const EventHandler &eventhandler) override;
19 void emit_event (const String &type, const String &detail, const ValueR fields = {}) override;
20 void emit_notify (const String &detail) override;
21};
22
24 struct Notification {
25 EmittableP emittable; String detail;
26 bool operator== (const Notification &b) const { return emittable == b.emittable && detail == b.detail; }
27 };
28 struct NotificationHash { size_t operator() (const Notification&) const; };
30 NotificationSet notifications_;
31 CoalesceNotifies *next_ = nullptr;
32public:
33 explicit CoalesceNotifies ();
34 void flush_notifications ();
35 /*dtor*/ ~CoalesceNotifies ();
36 friend class EmittableImpl;
37};
38
40class ObjectImpl : public EmittableImpl, public virtual Object {
41protected:
42 virtual ~ObjectImpl () = 0;
43public:
44};
46
47} // Ase
48
Implementation type for classes with Event subscription.
Definition object.hh:10
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:120
Implementation type for classes with Property interfaces.
Definition object.hh:40
Base type for classes with Property interfaces.
Definition api.hh:166
The Anklang C++ API namespace.
Definition api.hh:8