so5extra
Magic Enum C++
so5extra | Magic Enum C++ | |
---|---|---|
2 | 44 | |
22 | 4,460 | |
- | - | |
5.4 | 8.1 | |
about 2 months ago | about 18 hours ago | |
C++ | C++ | |
GNU General Public License v3.0 or later | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
so5extra
-
SObjectizer Tales - 26. Dispatcher selection
In this case, it’s possible that we need to craft and use a custom dispatcher for the purpose. This might be not an easy task in general but we know where to start as we learnt in this previous post. For example, in calico we have discussed and crafted a do_gui_message_loop() function to guarantee the OpenCV drawing happens on the calling thread – and we call this function from the main thread. An alternative solution consists in developing a customized dispatcher. Just to share another example, SObjectizer’s companion project so5extra, provides some battle-tested dispatchers tailored for boost ASIO.
-
SObjectizer Tales - 5. Sending commands
Have you ever tried to cancel a timer on Alexa…while it was about to ring?! In SObjectizer, message cancellation is not strictly guaranteed. Indeed, a delayed message won’t be revoked if it left the timer thread already. This happens if you try cancelling the message too late, in that case there are good chances it will be delivered anyway. For example, if you send a message with delay 100ms and you try cancelling after 100ms then it might have left the timer thread already. There are ways to prevent this problem but won’t be discussed here. If you are interested, have a look at this.
Magic Enum C++
-
What C++ library do you wish existed but hasn’t been created yet?
I'm not sure this is quite what you're asking for, but this library has been super helpful to me in the past : https://github.com/Neargye/magic_enum
- Usable Magic Enums for C++
-
Fully Permissive License C++ Logger For Embedded System
Also, a shoutout to Magic Enum: https://github.com/Neargye/magic_enum
- Favorite Ways of Stringifying Enums
-
enum_name (yet another enum to/from string conversion utility >=C++11)
What does this have to offer over magic_enum?
-
quill v2.7.0 released - Asynchronous Low Latency C++ Logging Library
But it's a hack, and I prefer not to use hacks in production, because of their significant limitations:
-
Enums print numbers instead of words
You can either write a to string(view) function for your enum or use https://github.com/Neargye/magic_enum
-
Enums with methods
Why reinvent the wheel? magic_enum
-
Error: Boost bimap can't convert const CompatibleKey to Key&
Also if you want to convert enum members to string representation I suggest you just use magic_enum instead, much smaller dependency.
-
Macro to write enum and converter from and to string
Magic Enum provides that.
What are some alternatives?
SObjectizer - SObjectizer: it's all about in-process message dispatching!
Nameof C++ - Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum
sobjectizer - An implementation of Actor, Publish-Subscribe, and CSP models in one rather small C++ framework. With performance, quality, and stability proved by years in the production.
Protobuf - Protocol Buffers - Google's data interchange format
thread-pool - BS::thread_pool: a fast, lightweight, and easy-to-use C++17 thread pool library
cereal - A C++11 library for serialization
cppinsights - C++ Insights - See your source code with the eyes of a compiler
FlatBuffers - FlatBuffers: Memory Efficient Serialization Library
Boost.Serialization - Boost.org serialization module
pfr - std::tuple like methods for user defined types without any macro or boilerplate code
wise_enum - A reflective enum implementation for C++
protozero - Minimalist protocol buffer decoder and encoder in C++