Commit graph

4 commits

Author SHA1 Message Date
Edoardo Lolletti
f639200ce2 Simplify the check for Processors::NeedsAnswer
Access the constexpr class value directly and update header includes in processor_unit.h
2025-06-23 22:31:23 +02:00
Edoardo Lolletti
76ac85d3c0 Update copyright year on changed files and LICENSE 2025-02-23 13:56:35 +01:00
Edoardo Lolletti
4f03ac37b1 Clean up processors visit handling
Move the logic inside a lambda scoped to the c++ instead of putting the std::visit calls in the field.h header
2025-02-20 23:36:31 +01:00
Edoardo Lolletti
e97a1c2f94
Restructure the processor handling to use a variant object (#149)
Rewrite the whole ``process`` function of the processor to use instead tag dispatching on variant objects.
Each single processor message got rewritten as a struct, inheriting from a base templated Process struct, containing only the required data for that process, rather than using the generic structure that ended up needing to spam bitwise operations to pack as many arguments in a byte as possible. This makes things easier to follow and streamlines the addition of new processes:
 - Define its struct with the parameters it expects by also providing a constructor
   - If the process requires an answer, inherit it from ``Process<true>``, if it requires no answer, inherit it from ``Process<false>``
 - Add such struct to the ``processors`` variant type
 - Declare and implement its corresponding ``bool process(Processors::NewProcess& arg);`` function
2024-01-08 20:46:41 +01:00