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
GEODE-5018: Fixing PIMPL pattern for Cache #278
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of formatting changes that seem unrelated. Did you blanket reformat the source?
cppcache/include/geode/Cache.hpp
Outdated
@@ -76,7 +78,8 @@ class APACHE_GEODE_EXPORT Cache : public GeodeCache { | |||
* @param regionShortcut | |||
* To create the region specific type, @see RegionShortcut | |||
*/ | |||
virtual RegionFactory createRegionFactory(RegionShortcut regionShortcut); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Region shortcut is an enum type. The size of the ref is actually more expensive than the enum value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tradeoff is we can't forward declare RegionShortcut if we pass by value since it needs access to the copy constructor. Is that preferable? If so I'll change it back to by-value and add an include for RegionShortcut.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s fine, it’s a small enum. Though I would expect a forward to work. See docs for enum class
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right - forward declaration does work. CLion was giving me a false error, but it compiles fine. I'll watch out for that sort of thing in the future.
@@ -378,8 +395,9 @@ BEGIN_TEST(TEST_EXPIRATION) | |||
////////////// | |||
RegionAttributes attrs_18; | |||
// ettl = 0, eit = 0, rttl = 0, reit = 0 | |||
attrs_18 = setRegionAttributesTimeouts(std::chrono::seconds(6), std::chrono::seconds(3), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a lot of formatting changes. Are you using clang-format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I ran all the source I touched through clang-format, but only if I made other changes to the file related to GEODE-5018.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What version of clang-format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-format version 7.0.0 (tags/google/stable/2018-01-11). This is the latest version available via brew
* Moving type registry out and using forward decl * Using initializer list in Cache constructor
No description provided.