174 Commits

Author SHA1 Message Date
zero
8e29fb4c53 Add installation of PDB files and debug suffix for MSVC 2024-01-30 10:43:14 +04:00
laxerrrr
62046399d4 readme typo + process example 2023-08-03 18:47:26 +04:00
Dawid Drozd
ed4b80d1f5 Add Listener::isListening
Requested feature in #48
v3.0.4
2023-06-17 15:06:38 +04:00
Dawid Drozd
b30f87483e EventBus version bump v3.0.3 v3.0.3 2022-11-29 12:10:00 +04:00
Dawid Drozd
f9ff982521 Fix compile error
Shame on me.
2022-11-29 12:09:23 +04:00
Dawid Drozd
48a14238ff Update README concept image to match Light/Dark theme #39
Transparent background - bad for dark theme as lines are dark
White background - bad for eyes when using dark theme at night :D
Black background - can't C#
Gray - LGTM :)
2022-11-24 07:21:09 +01:00
Dawid Drozd
a87883b87b EventBus version bump v3.0.2 v3.0.2 2022-11-24 06:57:23 +01:00
Dawid Drozd
e8724b6052 Fix ProtectedEventStream::process erase queue #46 2022-11-24 06:56:47 +01:00
Ian Geiser
4689564c4c Fixes for MSVC 2019 2021-08-03 16:38:46 +02:00
Ian Reinhart Geiser
3238c41ea5 Fix compile on debian buster
On debian buster with gcc 8.3 I see the following compiler error:

```
[build] FAILED: 3rdparty/eventbus/use_case/basic/UseCase_Basic 
[build] : && /bin/g++-8  -DTORRENT_NO_DEPRECATE=1 -DSPDLOG_FMT_EXTERNAL=1 -DJSONCONS_HAS_OPTIONAL=1 -DNO_BOOST_SERIALIZATION=1 -DGSL_THROW_ON_CONTRACT_VIOLATION -DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_INFO -g   3rdparty/eventbus/use_case/basic/CMakeFiles/UseCase_Basic.dir/src/main.cpp.o  -o 3rdparty/eventbus/use_case/basic/UseCase_Basic  3rdparty/eventbus/lib/libEventBus.a && :
[build] /usr/bin/ld: 3rdparty/eventbus/use_case/basic/CMakeFiles/UseCase_Basic.dir/src/main.cpp.o: in function `std::__shared_mutex_pthread::lock()':
[build] /usr/include/c++/8/shared_mutex:103: undefined reference to `pthread_rwlock_wrlock'
[build] /usr/bin/ld: 3rdparty/eventbus/use_case/basic/CMakeFiles/UseCase_Basic.dir/src/main.cpp.o: in function `std::__shared_mutex_pthread::unlock()':
[build] /usr/include/c++/8/shared_mutex:123: undefined reference to `pthread_rwlock_unlock'
[build] /usr/bin/ld: 3rdparty/eventbus/lib/libEventBus.a(EventBus.cpp.o): in function `std::__shared_mutex_pthread::lock_shared()':
[build] /usr/include/c++/8/shared_mutex:139: undefined reference to `pthread_rwlock_rdlock'
[build] collect2: error: ld returned 1 exit status
```

This adds threads to the linker arguments.
2021-08-02 17:01:59 +02:00
Dawid Drozd
182fea9359 EventBus version bump v3.0.1 v3.0.1 2021-06-30 10:10:22 +02:00
Dawid Drozd
fad6be4f7a Merge branch 'development'
* development:
  Add unit test for processing events behavior
  Add unit test for processing events behavior
  Update test
2021-06-30 10:03:00 +02:00
Dodopriester
08d7937e6e Fix weird MSVC errors 2021-06-30 09:56:22 +02:00
Dawid Drozd
3bfa06b33c Add unit test for processing events behavior 2021-06-18 12:55:52 +02:00
Dawid Drozd
c084078117 Add unit test for processing events behavior 2021-06-18 10:51:48 +02:00
Dawid Drozd
3f51caac57 Merge remote-tracking branch 'origin/master' into development
* origin/master:
  Fix for #35
2021-06-18 10:40:57 +02:00
Ian Reinhart Geiser
804cf6b7cd Fix for #35 2021-05-07 08:36:07 +02:00
Dawid Drozd
cfed57a31f Update test 2020-05-01 22:13:32 +02:00
Nicolas Noble
16f2bbe613 Fixes Visual Studio 2019 compilation. 2020-04-28 16:47:21 +02:00
Dawid Drozd
de1852c639 Update README v3.0.0 2020-04-12 16:44:31 +02:00
Dawid Drozd
181b89d263 Update test 2020-04-12 14:57:09 +02:00
Dawid Drozd
69ac64a3ee Add comments 2020-04-12 14:47:05 +02:00
Dawid Drozd
9cab181cab Update Perks to shared
Maybe we would like to share perks to achieve something between event buses
2020-03-28 19:45:26 +01:00
Dawid Drozd
a58aa21934 Fix implicit move that could lead to UB
In some scenarios we could end up with UB. I added simple example in test case where we add class
instance to vector and as we know it may move its elements when resizing.

Maybe we could allow to move and just unlisten previous listener but this would be very annoying as
user needs to remember what would happen in every case. It is better to let user decide and force
him to think about it.
2020-03-26 11:53:05 +01:00
Dawid Drozd
b4bceafb40 Fix data race
Bad usage of condition variable
2020-03-13 09:59:50 +01:00
Dawid Drozd
35efe42884 Fix WaitPerk for dummy waiting case
It could happen that we had some events in queue but we still would wait for new events.
2020-03-12 13:59:40 +01:00
Dawid Drozd
7c63021ea3 Add integration tests
- Refactor unit tests
2020-03-12 09:48:03 +01:00
Dawid Drozd
0985cd62d2 Move test into new file layout
No code changes only moving stuff
2020-03-12 09:40:26 +01:00
Dawid Drozd
c14094d037 Add FAQ doc 2020-01-18 13:25:19 +01:00
Dawid Drozd
871db45754 Add extra assert
fail ASAP during debug
2020-01-18 13:22:46 +01:00
Dawid Drozd
d7c9690cc7 Fix Travis build
- Update Travis
- Fix option
- Update Catch2 required version to 2.10
2020-01-02 12:48:14 +01:00
Dawid Drozd
d426b68981 Add THANKS.md 2019-12-29 15:06:29 +01:00
Dawid Drozd
59683ebd08 Add tsan asan lsan msan ubsan build types
For testing and development
2019-12-29 15:02:03 +01:00
Dawid Drozd
c5756e24a8 Update needed c++ version 2019-12-29 15:00:20 +01:00
Dawid Drozd
d0d236dab0 Secure installed files
We should be able to remove installed stuff but we want to forbid changes in installed files.
Thanks to that we do not modify files by mistake directly from e.g. Clion (when we go to
header/source)
2019-12-29 13:13:34 +01:00
Dawid Drozd
2bc2858a8a New EventBus 3.0 2019-12-27 11:24:34 +01:00
Dawid Drozd
6baa41917e Update clang-format 2019-11-25 11:00:57 +01:00
Dawid Drozd
f986c6c675 Fix TagEventBus::get()
In some cases we could move our shared_ptr by mistake
2019-11-13 19:43:32 +01:00
Dawid Drozd
2bb9c3e679 Add TagEventBus 2019-10-30 17:44:52 +01:00
Dawid Drozd
890eaff178 Update encapsulation for accessing private stuff from EventBus 2019-10-30 17:28:59 +01:00
Dawid Drozd
1adbc61a03 Add extra check for waiting events
We don't want to wait for events if we already have some.
2019-10-22 22:50:36 +02:00
Dawid Drozd
55dd3937fa Fix api readability 2019-09-15 02:45:13 +02:00
Dawid Drozd
54b3fae30a Remove old EventBus 2.X and make room for 3.X 2019-09-14 23:46:12 +02:00
Dawid Drozd
018a536147 Move code from include/ to src/
I don't like to keep separate folders for public & private stuff. In my opinion this is "old"
approach. I like when header and module file are next to each other.

My choice. Installation will handle splitting public & private headers.
2019-09-14 16:05:21 +02:00
Dawid Drozd
170690ae9d Mark as 3.0.0 version
This would be next release version
2019-09-14 15:59:25 +02:00
Dawid Drozd
75443f35da Add EventBus::getStrategy
E.g. Protected strategy has some extra functions like Protected::wait
2019-09-14 15:59:02 +02:00
Dawid Drozd
026889c86c Update cpp code for move and forward 2019-09-14 15:58:02 +02:00
Dawid Drozd
8f6eb24549 Remove Subscriber and make Listener more safe
There could be not nice situation when bus dies and Listener wants to unlisten. That was easy to
achieve e.g. bad order in class fields. (Order of destruction matters)
2019-09-14 15:56:09 +02:00
Dawid Drozd
0efc4264fc Update required C++ to 17 2019-09-14 15:51:47 +02:00
Dawid Drozd
412bc653aa Add new way of installing public headers 2019-09-14 15:11:21 +02:00