Skip to content

Commit 98c01df

Browse files
committed
Pass by value for trivial types
1 parent 47b45b1 commit 98c01df

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

include/cucascade/data/data_batch.hpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include <optional>
3333
#include <stdexcept>
3434
#include <utility>
35-
#include <variant>
3635

3736
namespace cucascade {
3837
namespace memory {
@@ -76,11 +75,11 @@ class idata_batch_probe {
7675
* this function is called in a thread-safe manner, and will block other mutating changes
7776
* while this executes. Primarily intended for bookkeeping purposes.
7877
*/
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,
8180
[[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)
8483
{
8584
// The default impl is no-op.
8685
}
@@ -508,21 +507,21 @@ class data_batch : public std::enable_shared_from_this<data_batch> {
508507
* @brief Handle a state transition by updating _state and invoking the probe callback.
509508
*
510509
* 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.
512511
*
513512
* @param new_state The state to transition to
514513
* @param lock Reference to the lock proving the mutex is held
515514
*/
516515
void update_state_to(batch_state new_state, const std::unique_lock<std::mutex>& lock);
517516

518517
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
526525
std::condition_variable* _state_change_cv = nullptr; ///< Optional CV to notify on state change
527526
};
528527

0 commit comments

Comments
 (0)