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

Reorganize public rules headers #1110

Merged
merged 2 commits into from
Nov 25, 2021
Merged

Conversation

LaurentiuCristofor
Copy link
Contributor

Discussed these changes with Dax. They make it so that the rules.hpp header is the main one that needs to be included.

Copy link
Contributor

@daxhaw daxhaw left a comment

Choose a reason for hiding this comment

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

The only other file I changed was event_manager.hpp. This was including gaia/rules/exceptions.hpp instead of gaia/rules/rules.hpp. Other than that, this looks good. Thank you!

@LaurentiuCristofor
Copy link
Contributor Author

The only other file I changed was event_manager.hpp. This was including gaia/rules/exceptions.hpp instead of gaia/rules/rules.hpp. Other than that, this looks good. Thank you!

Given that that is an internal header, do you want it to include more than it needs to? It only needs the exceptions definitions because it initializes an invalid_rule_binding. If we'd move that code to the .cpp, we probably wouldn't even need to include that file. I try to keep internal headers light, so that we only pull the definitions we need.

@LaurentiuCristofor
Copy link
Contributor Author

The only other file I changed was event_manager.hpp. This was including gaia/rules/exceptions.hpp instead of gaia/rules/rules.hpp. Other than that, this looks good. Thank you!

Given that that is an internal header, do you want it to include more than it needs to? It only needs the exceptions definitions because it initializes an invalid_rule_binding. If we'd move that code to the .cpp, we probably wouldn't even need to include that file. I try to keep internal headers light, so that we only pull the definitions we need.

OTOH, we may already include rules.hpp through the other internal headers, in which case I can remove the public include completely. Let me try that.

Copy link
Contributor

@daxhaw daxhaw left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks.

@LaurentiuCristofor LaurentiuCristofor merged commit d428713 into master Nov 25, 2021
@LaurentiuCristofor LaurentiuCristofor deleted the laur_rules_headers branch November 25, 2021 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants