3#include <Core/CoreDLL.h>
4#include <Foundation/Communication/Event.h>
5#include <Foundation/Strings/HashedString.h>
6#include <Foundation/Types/SharedPtr.h>
7#include <Foundation/Types/Variant.h>
15 using StorageType = plUInt16;
21 OnChangeEvent = PL_BIT(1),
23 UserFlag0 = PL_BIT(7),
24 UserFlag1 = PL_BIT(8),
25 UserFlag2 = PL_BIT(9),
26 UserFlag3 = PL_BIT(10),
27 UserFlag4 = PL_BIT(11),
28 UserFlag5 = PL_BIT(12),
29 UserFlag6 = PL_BIT(13),
30 UserFlag7 = PL_BIT(14),
40 StorageType OnChangeEvent : 1;
41 StorageType Reserved : 5;
42 StorageType UserFlag0 : 1;
43 StorageType UserFlag1 : 1;
44 StorageType UserFlag2 : 1;
45 StorageType UserFlag3 : 1;
46 StorageType UserFlag4 : 1;
47 StorageType UserFlag5 : 1;
48 StorageType UserFlag6 : 1;
49 StorageType UserFlag7 : 1;
50 StorageType Invalid : 1;
73 bool IsGlobalBlackboard()
const {
return m_bIsGlobal; }
103 const char* GetName()
const {
return m_sName; }
113 plUInt32 m_uiChangeCounter = 0;
120 const Entry* m_pEntry;
127 void RemoveAllEntries();
203 bool m_bIsGlobal =
false;
206 plUInt32 m_uiBlackboardChangeCounter = 0;
207 plUInt32 m_uiBlackboardEntryChangeCounter = 0;
210 PL_MAKE_SUBSYSTEM_STARTUP_FRIEND(Core, Blackboard);
211 static plMutex s_GlobalBlackboardsMutex;
222 double m_fComparisonValue = 0.0;
225 bool IsConditionMet(
const plBlackboard& blackboard)
const;
Base class for all memory allocators.
Definition Allocator.h:23
A blackboard is a key/value store that provides OnChange events to be informed when a value changes.
Definition Blackboard.h:66
plUInt32 GetBlackboardEntryChangeCounter() const
This counter is increased every time any entry's value is modified.
Definition Blackboard.h:183
const plHashTable< plHashedString, Entry > & GetAllEntries() const
Grants read access to the entire map of entries.
Definition Blackboard.h:170
const plEvent< EntryEvent > & OnEntryEvent() const
Allows you to register to the OnEntryEvent. This is broadcast whenever an entry is modified that has ...
Definition Blackboard.h:173
plUInt32 GetBlackboardChangeCounter() const
This counter is increased every time an entry is added or removed (but not when it is modified).
Definition Blackboard.h:178
static PL_ALWAYS_INLINE plAllocator * GetDefaultAllocator()
The default allocator can be used for any kind of allocation if no alignment is required.
Definition Basics.h:82
Definition HashTable.h:333
This class is optimized to take nearly no memory (sizeof(void*)) and to allow very fast checks whethe...
Definition HashedString.h:25
Provides a simple mechanism for mutual exclusion to prevent multiple threads from accessing a shared ...
Definition Mutex.h:13
Base class for reference counted objects.
Definition RefCounted.h:52
A Shared ptr manages a shared object and destroys that object when no one references it anymore....
Definition SharedPtr.h:10
Interface for binary in (read) streams.
Definition Stream.h:22
Interface for binary out (write) streams.
Definition Stream.h:107
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
A class to use together with plHashedString for quick comparisons with temporary strings that need no...
Definition HashedString.h:151
plVariant is a class that can store different types of variables, which is useful in situations where...
Definition Variant.h:44
The plBitflags class allows you to work with type-safe bitflags.
Definition Bitflags.h:82
Definition Blackboard.h:117
Definition Blackboard.h:107
Definition Blackboard.h:220
Definition Blackboard.h:38
Flags for entries in plBlackboard.
Definition Blackboard.h:14
Enum
Definition Blackboard.h:18
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54