Skip to content

Commit 1172c7e

Browse files
committed
- Explaination for ObservableWithBuckets being off-limits added
1 parent 42cae81 commit 1172c7e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/ESPressio_ObservableWithBuckets.hpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
#ifndef ESPRESSIO_OBSERVABLE_EXPERIMENTAL
22
#error This implementation is not yet complete. Please check back later for updates.
3+
/*
4+
NOTES:
5+
- This is an experimental attempt to make a Bucketed Observerable Type.
6+
- Due to language limitations in C++, what I'm attempting to achieve here may not be possible in any elegant way.
7+
- It is entirely possible that this implementation may be scrapped later, which is why it is marked with this error.
8+
9+
ISSUES:
10+
- Because each Observer type can inherit from multiple `IObserver` descendant types, registration of a single
11+
Observer with multiple `IObserver` descendant types can lead to undefined behavior. This is because the
12+
code cannot determine which `IObserver` type or types are applicable for that singular Observer object.
13+
- This is a limitation of the C++ language, and is not something that can be easily worked around.
14+
15+
WORKAROUNDS:
16+
- Use the `Observable` or `ThreadSafeObservable` classes instead. They are fully functional and have no known issues.
17+
They use a Dynamic Cast method to determine whether each given Observer satisfies a specific `IObserver` descendant type.
18+
This is the only known way to achieve this functionality in C++ (for now)
19+
20+
*/
321
#endif
422

523
#pragma once

0 commit comments

Comments
 (0)