Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to new cubos system syntax #919

Merged
merged 11 commits into from
Jan 31, 2024
Merged

Conversation

RiscadoA
Copy link
Member

@RiscadoA RiscadoA commented Jan 31, 2024

Description

Depends on #862, will merge after it is merged.

Changes the Cubos system syntax to define the systems inline with the rest of the configuration.
Will be useful to later allow specifying the traversal direction of queries and other options, such as filtering out components.
Had to change all plugins, which means this is a gigantic PR. 😔

Checklist

  • Self-review changes.
  • Evaluate impact on the documentation.
  • Ensure test coverage.
  • Write new samples.

@RiscadoA RiscadoA added A-Core A-Engine B-ECS C-Code-Quality A section of code that is hard to understand or change labels Jan 31, 2024
@RiscadoA RiscadoA added this to the 0.1 Jammable Engine milestone Jan 31, 2024
@RiscadoA RiscadoA self-assigned this Jan 31, 2024
@RiscadoA RiscadoA linked an issue Jan 31, 2024 that may be closed by this pull request
@RiscadoA RiscadoA force-pushed the 896-switch-to-new-cubos-system-syntax branch from fc9c30b to 0229e9f Compare January 31, 2024 11:09
Copy link
Contributor

github-actions bot commented Jan 31, 2024

PR Preview Action v1.4.6
Preview removed because the pull request was closed.
2024-01-31 19:01 UTC

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (1/14)

core/include/cubos/core/ecs/system/dispatcher.hpp Outdated Show resolved Hide resolved
core/include/cubos/core/ecs/system/dispatcher.hpp Outdated Show resolved Hide resolved
core/include/cubos/core/ecs/system/dispatcher.hpp Outdated Show resolved Hide resolved
core/include/cubos/core/ecs/system/dispatcher.hpp Outdated Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (2/14)

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (3/14)

core/include/cubos/core/ecs/system/dispatcher.hpp Outdated Show resolved Hide resolved
template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (4/14)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (5/14)

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (6/14)

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

Copy link

codecov bot commented Jan 31, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (fa22bcd) 48.91% compared to head (8294541) 49.68%.

Files Patch % Lines
core/src/cubos/core/ecs/cubos.cpp 88.88% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #919      +/-   ##
==========================================
+ Coverage   48.91%   49.68%   +0.76%     
==========================================
  Files         134      134              
  Lines        7999     8009      +10     
==========================================
+ Hits         3913     3979      +66     
+ Misses       4086     4030      -56     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (7/14)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (8/14)

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

/// @return Reference to this object, for chaining.
template <typename F>
SystemBuilder& runIf(F func);

private:
core::ecs::Dispatcher& mDispatcher;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-unused-private-field ⚠️
private field mDispatcher is not used

/// @return Reference to this object, for chaining.
template <typename F>
SystemBuilder& runIf(F func);

private:
core::ecs::Dispatcher& mDispatcher;
std::vector<std::string>& mTags;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-unused-private-field ⚠️
private field mTags is not used

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (9/14)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (10/14)

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (11/14)

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (12/14)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (13/14)

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (14/14)

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

{
// Wrap the system and put it in the pending queue
auto* system = new System{nullptr, std::make_shared<SystemWrapper<F>>(func), {}};
auto* system = new System{nullptr, func, {}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter func is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
auto* system = new System{nullptr, func, {}};
auto* system = new System{nullptr, std::move(func), {}};

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(F func);
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func);
const std::shared_ptr<AnySystemWrapper<bool>>& func);

template <typename F>
std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(F func)
inline std::bitset<CUBOS_CORE_DISPATCHER_MAX_CONDITIONS> Dispatcher::assignConditionBit(
std::shared_ptr<AnySystemWrapper<bool>> func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the parameter func is copied for each invocation but only used as a const reference; consider making it a const reference

Suggested change
std::shared_ptr<AnySystemWrapper<bool>> func)
const std::shared_ptr<AnySystemWrapper<bool>>& func)

@RiscadoA RiscadoA force-pushed the 896-switch-to-new-cubos-system-syntax branch from 0229e9f to 950bf00 Compare January 31, 2024 17:22
@RiscadoA RiscadoA merged commit 1bce7c5 into main Jan 31, 2024
10 checks passed
@RiscadoA RiscadoA deleted the 896-switch-to-new-cubos-system-syntax branch January 31, 2024 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Core A-Engine B-ECS C-Code-Quality A section of code that is hard to understand or change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch to new Cubos system syntax
1 participant