Skip to content

Conversation

@parisiale
Copy link
Contributor

No description provided.

@parisiale parisiale force-pushed the PCP-410 branch 2 times, most recently from 2daebe4 to f51796d Compare June 13, 2016 14:48
ConnectionTimings Connector::getConnectionTimings() const
{
return (connection_ptr_ == nullptr
? ConnectionTimings()
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder where this ConnectionTimings() object is created - on the stack or heap?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Temporary storage depends on context, if I'm correct. More here: http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/

Copy link
Contributor

Choose a reason for hiding this comment

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

It'll be stack, and copy elided to the caller.

@mruzicka
Copy link
Contributor

LGTM

class LIBCPP_PCP_CLIENT_EXPORT Connection {
public:
/// To keep track of WebSocket timings
ConnectionTimings timings;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you make this public?

Copy link
Contributor Author

@parisiale parisiale Jun 13, 2016

Choose a reason for hiding this comment

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

Since the new AssociationTimings will be stored in the Connector, it makes more sense to me to allow Connector accessing directly the ConnectionTimings instead of having a copy from a Connection getter call. This is done considering that the actual user interface is provided by Connector, that does not expose the Connection instance.

No strong opinion here, I'm happy to make it private again if you think it's the case.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems ok.

@mruzicka
Copy link
Contributor

LGTM

Adding reset method to ConnectionTimings.
Making public the ConnectionTimings member (timings) of Connection.
Adding ConnectionTimings getters to Connector.
Adding new unit tests.
@mruzicka mruzicka merged commit fc7699a into puppetlabs:master Jun 13, 2016
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.

3 participants