|
32 | 32 | #include <optional> |
33 | 33 | #include <stdexcept> |
34 | 34 | #include <utility> |
35 | | -#include <variant> |
36 | 35 |
|
37 | 36 | namespace cucascade { |
38 | 37 | namespace memory { |
@@ -76,11 +75,11 @@ class idata_batch_probe { |
76 | 75 | * this function is called in a thread-safe manner, and will block other mutating changes |
77 | 76 | * while this executes. Primarily intended for bookkeeping purposes. |
78 | 77 | */ |
79 | | - virtual void state_transitioned_to([[maybe_unused]] const batch_state& new_state, |
80 | | - [[maybe_unused]] const uint64_t& batch_id, |
| 78 | + virtual void state_transitioned_to([[maybe_unused]] const batch_state new_state, |
| 79 | + [[maybe_unused]] const uint64_t batch_id, |
81 | 80 | [[maybe_unused]] const idata_representation& data, |
82 | | - [[maybe_unused]] const size_t& processing_count, |
83 | | - [[maybe_unused]] const size_t& task_created_count) |
| 81 | + [[maybe_unused]] const size_t processing_count, |
| 82 | + [[maybe_unused]] const size_t task_created_count) |
84 | 83 | { |
85 | 84 | // The default impl is no-op. |
86 | 85 | } |
@@ -508,21 +507,21 @@ class data_batch : public std::enable_shared_from_this<data_batch> { |
508 | 507 | * @brief Handle a state transition by updating _state and invoking the probe callback. |
509 | 508 | * |
510 | 509 | * Must be called while the caller holds _mutex. Passes all member fields except _mutex |
511 | | - * and _state_change_cv as const references to the probe callback. |
| 510 | + * and _state_change_cv in immutable forms to the probe callback. |
512 | 511 | * |
513 | 512 | * @param new_state The state to transition to |
514 | 513 | * @param lock Reference to the lock proving the mutex is held |
515 | 514 | */ |
516 | 515 | void update_state_to(batch_state new_state, const std::unique_lock<std::mutex>& lock); |
517 | 516 |
|
518 | 517 | mutable std::mutex _mutex; ///< Mutex for thread-safe access to state and processing count |
519 | | - std::condition_variable _internal_cv; ///< CV used by blocking wait_to_* calls |
520 | | - uint64_t _batch_id; ///< Unique identifier for this data batch |
521 | | - std::unique_ptr<idata_representation> _data; ///< Pointer to the actual data representation |
522 | | - size_t _processing_count = 0; ///< Count of active processing handles |
523 | | - size_t _task_created_count = 0; ///< Count of pending task_created requests |
524 | | - batch_state _state = batch_state::idle; ///< Current state of the batch |
525 | | - std::unique_ptr<idata_batch_probe> _probe; ///< Probe for observing state transitions |
| 518 | + std::condition_variable _internal_cv; ///< CV used by blocking wait_to_* calls |
| 519 | + uint64_t _batch_id; ///< Unique identifier for this data batch |
| 520 | + std::unique_ptr<idata_representation> _data; ///< Pointer to the actual data representation |
| 521 | + size_t _processing_count = 0; ///< Count of active processing handles |
| 522 | + size_t _task_created_count = 0; ///< Count of pending task_created requests |
| 523 | + batch_state _state = batch_state::idle; ///< Current state of the batch |
| 524 | + std::unique_ptr<idata_batch_probe> _probe; ///< Probe for observing state transitions |
526 | 525 | std::condition_variable* _state_change_cv = nullptr; ///< Optional CV to notify on state change |
527 | 526 | }; |
528 | 527 |
|
|
0 commit comments