-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/37217/
-----------------------------------------------------------
Review request for qpid, Alan Conway and Andrew Stitcher.
Bugs: PROTON-865
https://issues.apache.org/jira/browse/PROTON-865
Repository: qpid-proton-git
Description
-------
This is a mini refactor of a single class to see if the chosen direction for
generally removing handle<foo> is sane.
I chose the connection class to try based on medium complexity and interaction
with other moving parts (not visible to the user, the connector/override and
life cycle issues).
The connection is now non copyable.
If the connection "self-created" (i.e. an inbound connection from a listener,
arriving via a reactor event, or implicit connection from
container.create_receiver), it is not "owned", and its life ends when the
pn_connection_t dies (dies for good, i.e. when it releases its attachment
records).
If the user creates the connection explicitly, it is "owned" and destructs as
normal. It is unclear if the Python behavior should be preserved, where the
connection lives on un-owned, or destruction means "all gone" with tear down of
the transport and connector. I chose the latter as perhaps least surprise for
the user.
The Proton C++ code can use either model internally to taste.
Perhaps the connection object should have a pin/unpin or incref/decref ability
so that the user can hang onto it past the event delivery. As a hack, they can
always do pn_incref(connection.pn_connection()) and decref it when done.
It is not clear to me that the counted class will ever be used separately from
the context<foo> class, so they might get rolled together in the future. The
memory management is accomplished by a special proton metaclass that is
refcounted, but neither allocates nor frees memory.
connection::getZZZcontainer() is an unintended artifact of the refactor. I'm
not sure why gcc is fussing over the original signature, but I don't wish to
target its resolution in this review.
Diffs
-----
examples/cpp/helloworld.cpp 34e5076
examples/cpp/server.cpp 78b78d3
proton-c/bindings/cpp/CMakeLists.txt d1b1ebc
proton-c/bindings/cpp/include/proton/connection.hpp af3c585
proton-c/bindings/cpp/include/proton/container.hpp a0ca59a
proton-c/bindings/cpp/include/proton/context.hpp PRE-CREATION
proton-c/bindings/cpp/include/proton/counted.hpp PRE-CREATION
proton-c/bindings/cpp/src/blocking_connection.cpp c0c1477
proton-c/bindings/cpp/src/blocking_connection_impl.hpp 11ff4fd
proton-c/bindings/cpp/src/blocking_connection_impl.cpp 0e78541
proton-c/bindings/cpp/src/connection.cpp 2b335a4
proton-c/bindings/cpp/src/connection_impl.hpp 6450ef5
proton-c/bindings/cpp/src/connection_impl.cpp e2f4608
proton-c/bindings/cpp/src/connector.hpp ad373a9
proton-c/bindings/cpp/src/connector.cpp 559a7fd
proton-c/bindings/cpp/src/container.cpp a424c0b
proton-c/bindings/cpp/src/container_impl.hpp 1ce27ee
proton-c/bindings/cpp/src/container_impl.cpp e328251
proton-c/bindings/cpp/src/context.cpp PRE-CREATION
proton-c/bindings/cpp/src/contexts.cpp 98c502b
proton-c/bindings/cpp/src/counted.cpp PRE-CREATION
proton-c/bindings/cpp/src/link.cpp 2cef0a2
proton-c/bindings/cpp/src/proton_event.cpp 46b43ee
proton-c/bindings/cpp/src/session.cpp 5742f13
Diff: https://reviews.apache.org/r/37217/diff/
Testing
-------
passes ctest on rhel7
Thanks,
Cliff Jansen