-
-
Notifications
You must be signed in to change notification settings - Fork 510
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
core: move ConnectionResult out of DroneCore class #290
Conversation
core/connection_result.h
Outdated
@@ -0,0 +1,67 @@ | |||
#ifndef DRONECORE_CONNECTION_RESULT_H | |||
#define DRONECORE_CONNECTION_RESULT_H |
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.
Usually, I used #pragma once
.
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.
Oh, right. I did not know #pragma once
actually, and I had seen some guidelines on isocpp.github.io, saying:
Some implementations offer vendor extensions like
#pragma once
as alternative to include guards. It is not standard and it is not portable.
Do you have an opinion on that? I really don't know, I just read it. I can change it for a pragma
if you prefer.
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.
I prefer it because it seems to work and it prevents errors when you copy and paste files without changing the define correctly.
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.
ok
5a28408
to
f258465
Compare
f258465
to
4711622
Compare
To me it feels a little wrong that the ConnectionResult is not part of DroneCore, since that is the one user facing place that manages connections. I'll take your work for it that this is a good idea though :-) I assume the header is exported for docs generation purposes? This will require quite a few docs changes. |
Oh, I did not think about the docs changes =/. One reason is that I want to be able to mock DroneCore from the backend. So I want to have And also in terms of code, it's not like if |
Because it is used in many classes,
ConnectionResult
should not be nested intoDroneCore
, IMO. Moreover, having it separate makes the code a bit nicer (DroneCore::ConnectionResult
becomesConnectionResult
).Finally, I am mocking
DroneCore
for some unit tests and, in my situation, I need to haveConnectionResult
separate fromDroneCore
.