You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2016/09/15 14:55:35 UTC
[1/3] qpid-proton git commit: PROTON-1302: Rewrite
proton::timestamp::now in terms of std::chrono and make it C++11 only -
Portability and allows independence of proton-c platform code
Repository: qpid-proton
Updated Branches:
refs/heads/master 12a6e4d33 -> 077eea5a8
PROTON-1302: Rewrite proton::timestamp::now in terms of std::chrono and make it C++11 only
- Portability and allows independence of proton-c platform code
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/bf615adf
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/bf615adf
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/bf615adf
Branch: refs/heads/master
Commit: bf615adf6da3c0654211fc637caccd073dc6a48a
Parents: 477d53b
Author: Andrew Stitcher <as...@apache.org>
Authored: Tue Sep 13 13:48:54 2016 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Thu Sep 15 09:54:50 2016 -0400
----------------------------------------------------------------------
.../bindings/cpp/include/proton/internal/config.hpp | 4 ++++
proton-c/bindings/cpp/src/timestamp.cpp | 12 +++++++++++-
2 files changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bf615adf/proton-c/bindings/cpp/include/proton/internal/config.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/internal/config.hpp b/proton-c/bindings/cpp/include/proton/internal/config.hpp
index cd5370e..612e1e3 100644
--- a/proton-c/bindings/cpp/include/proton/internal/config.hpp
+++ b/proton-c/bindings/cpp/include/proton/internal/config.hpp
@@ -87,6 +87,10 @@
#define PN_CPP_HAS_STD_FUNCTION PN_CPP_HAS_CPP11
#endif
+#ifndef PN_CPP_HAS_CHRONO
+#define PN_CPP_HAS_CHRONO PN_CPP_HAS_CPP11
+#endif
+
#endif // PROTON_INTERNAL_CONFIG_HPP
/// @endcond
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bf615adf/proton-c/bindings/cpp/src/timestamp.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/timestamp.cpp b/proton-c/bindings/cpp/src/timestamp.cpp
index 2a3e8a9..b763096 100644
--- a/proton-c/bindings/cpp/src/timestamp.cpp
+++ b/proton-c/bindings/cpp/src/timestamp.cpp
@@ -18,14 +18,24 @@
*/
#include "proton/timestamp.hpp"
+
+#include "proton/internal/config.hpp"
#include <proton/types.h>
+
#include <iostream>
+#if PN_CPP_HAS_CHRONO
+#include <chrono>
+#endif
+
namespace proton {
+#if PN_CPP_HAS_CHRONO
timestamp timestamp::now() {
- return timestamp(pn_timestamp_now());
+ using namespace std::chrono;
+ return timestamp( duration_cast<std::chrono::milliseconds>(system_clock::now().time_since_epoch()).count() );
}
+#endif
std::ostream& operator<<(std::ostream& o, timestamp ts) { return o << ts.milliseconds(); }
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[2/3] qpid-proton git commit: NO-JIRA: Removed totally unused parser
member from pn_message.
Posted by as...@apache.org.
NO-JIRA: Removed totally unused parser member from pn_message.
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/477d53b6
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/477d53b6
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/477d53b6
Branch: refs/heads/master
Commit: 477d53b6299515cd7950845b2869b5cebe6e02fa
Parents: 12a6e4d
Author: Andrew Stitcher <as...@apache.org>
Authored: Tue Aug 30 10:49:51 2016 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Thu Sep 15 09:54:50 2016 -0400
----------------------------------------------------------------------
proton-c/src/message/message.c | 12 ------------
1 file changed, 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/477d53b6/proton-c/src/message/message.c
----------------------------------------------------------------------
diff --git a/proton-c/src/message/message.c b/proton-c/src/message/message.c
index cb163d1..15d9c6c 100644
--- a/proton-c/src/message/message.c
+++ b/proton-c/src/message/message.c
@@ -54,7 +54,6 @@ struct pn_message_t {
pn_data_t *properties;
pn_data_t *body;
- pn_parser_t *parser;
pn_error_t *error;
pn_sequence_t group_sequence;
@@ -86,7 +85,6 @@ void pn_message_finalize(void *obj)
pn_data_free(msg->annotations);
pn_data_free(msg->properties);
pn_data_free(msg->body);
- pn_parser_free(msg->parser);
pn_error_free(msg->error);
}
@@ -334,7 +332,6 @@ pn_message_t *pn_message()
msg->properties = pn_data(16);
msg->body = pn_data(16);
- msg->parser = NULL;
msg->error = pn_error();
return msg;
}
@@ -397,15 +394,6 @@ int pn_message_set_inferred(pn_message_t *msg, bool inferred)
return 0;
}
-pn_parser_t *pn_message_parser(pn_message_t *msg)
-{
- assert(msg);
- if (!msg->parser) {
- msg->parser = pn_parser();
- }
- return msg->parser;
-}
-
bool pn_message_is_durable(pn_message_t *msg)
{
assert(msg);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[3/3] qpid-proton git commit: PROTON-1302: Remove use of pn_io_t from
C++ binding - Added pn_reactor_error() API
Posted by as...@apache.org.
PROTON-1302: Remove use of pn_io_t from C++ binding
- Added pn_reactor_error() API
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/077eea5a
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/077eea5a
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/077eea5a
Branch: refs/heads/master
Commit: 077eea5a8912c251202c3b2102d69b818795625b
Parents: bf615ad
Author: Andrew Stitcher <as...@apache.org>
Authored: Mon Sep 12 16:02:16 2016 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Thu Sep 15 10:10:16 2016 -0400
----------------------------------------------------------------------
proton-c/bindings/cpp/src/container_impl.cpp | 2 +-
proton-c/bindings/cpp/src/reactor.cpp | 4 ----
proton-c/include/proton/reactor.h | 2 +-
proton-c/src/reactor/reactor.c | 5 +++++
4 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/077eea5a/proton-c/bindings/cpp/src/container_impl.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/container_impl.cpp b/proton-c/bindings/cpp/src/container_impl.cpp
index f2cad7f..aca67ae 100644
--- a/proton-c/bindings/cpp/src/container_impl.cpp
+++ b/proton-c/bindings/cpp/src/container_impl.cpp
@@ -244,7 +244,7 @@ listener container_impl::listen(const std::string& url, listen_handler& lh) {
pn_acceptor_t *acptr = pn_reactor_acceptor(
reactor_.pn_object(), u.host().c_str(), u.port().c_str(), chandler.get());
if (!acptr) {
- std::string err(pn_error_text(pn_io_error(reactor_.pn_io())));
+ std::string err(pn_error_text(pn_reactor_error(reactor_.pn_object())));
lh.on_error(err);
lh.on_close();
throw error(err);
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/077eea5a/proton-c/bindings/cpp/src/reactor.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/reactor.cpp b/proton-c/bindings/cpp/src/reactor.cpp
index 20d331c..15547f0 100644
--- a/proton-c/bindings/cpp/src/reactor.cpp
+++ b/proton-c/bindings/cpp/src/reactor.cpp
@@ -61,10 +61,6 @@ connection reactor::connection_to_host(const std::string &host, const std::strin
return make_wrapper(pn_reactor_connection_to_host(pn_object(), host.c_str(), port.c_str(), h));
}
-pn_io_t* reactor::pn_io() const {
- return pn_reactor_io(pn_object());
-}
-
void reactor::pn_handler(pn_handler_t* h) {
pn_reactor_set_handler(pn_object(), h);
}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/077eea5a/proton-c/include/proton/reactor.h
----------------------------------------------------------------------
diff --git a/proton-c/include/proton/reactor.h b/proton-c/include/proton/reactor.h
index 5a33a0b..78fe57b 100644
--- a/proton-c/include/proton/reactor.h
+++ b/proton-c/include/proton/reactor.h
@@ -74,7 +74,7 @@ PN_EXTERN pn_selectable_t *pn_reactor_selectable(pn_reactor_t *reactor);
PN_EXTERN void pn_reactor_update(pn_reactor_t *reactor, pn_selectable_t *selectable);
PN_EXTERN pn_acceptor_t *pn_reactor_acceptor(pn_reactor_t *reactor, const char *host, const char *port,
pn_handler_t *handler);
-
+PN_EXTERN pn_error_t *pn_reactor_error(pn_reactor_t *reactor);
/**
* Create an outgoing connection that will be managed by the reactor.
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/077eea5a/proton-c/src/reactor/reactor.c
----------------------------------------------------------------------
diff --git a/proton-c/src/reactor/reactor.c b/proton-c/src/reactor/reactor.c
index 31cce08..a83a881 100644
--- a/proton-c/src/reactor/reactor.c
+++ b/proton-c/src/reactor/reactor.c
@@ -169,6 +169,11 @@ pn_io_t *pn_reactor_io(pn_reactor_t *reactor) {
return reactor->io;
}
+pn_error_t *pn_reactor_error(pn_reactor_t *reactor) {
+ assert(reactor);
+ return pn_io_error(reactor->io);
+}
+
pn_collector_t *pn_reactor_collector(pn_reactor_t *reactor) {
assert(reactor);
return reactor->collector;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org