You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A thread-safe event-listener template and observable value implementation for C++17.
7
8
8
-
# Examples
9
+
##Examples
9
10
10
11
Full examples can be found in the [examples directory](https://github.com/TheLartians/Event/tree/master/examples).
11
12
12
-
## lars::Event
13
+
### Using lars::Event
13
14
14
15
```c++
15
16
lars::Event<float,float> onClick;
@@ -18,7 +19,7 @@ onClick.emit(0,0); // emits event to all observers
18
19
observer.reset(); // removes observer from event
19
20
```
20
21
21
-
## lars::ObservableValue
22
+
### Using lars::ObservableValue
22
23
23
24
```c++
24
25
lars::ObservableValue a = 1;
@@ -29,7 +30,7 @@ std::cout << "The result is " << *sum << std::endl; // -> the result is 3
29
30
a.set(3); // -> The result changed to 5
30
31
```
31
32
32
-
# Installation and usage
33
+
##Installation and usage
33
34
34
35
With [CPM](https://github.com/TheLartians/CPM), lars::Event can be used in a CMake project simply by adding the following to the project's `CMakeLists.txt`.
0 commit comments