PROTON-865: Renaming to follow boost/std library C++ naming conventions. - private member variables end in underscore_ to avoid clash with accessors. - identifiers like_this, not LikeThis - no get/set prefixes on attribute accessor functions. - drop reactor namespace, proton seems sufficient. - No `using namespace proton` in examples
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/69783099 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/69783099 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/69783099 Branch: refs/heads/cjansen-cpp-client Commit: 697830998ab4768bf76129deabfaf474ddc10713 Parents: 9f7e346 Author: Alan Conway <[email protected]> Authored: Fri Jun 19 09:03:43 2015 -0400 Committer: Alan Conway <[email protected]> Committed: Mon Jun 22 13:21:42 2015 -0400 ---------------------------------------------------------------------- .gitignore | 3 + examples/cpp/README_dev.md | 9 + examples/cpp/broker.cpp | 161 ++++---- examples/cpp/encode_decode.cpp | 201 +++++---- examples/cpp/example_test.py | 10 +- examples/cpp/helloworld.cpp | 40 +- examples/cpp/helloworld_blocking.cpp | 37 +- examples/cpp/helloworld_direct.cpp | 47 ++- examples/cpp/simple_recv.cpp | 36 +- examples/cpp/simple_send.cpp | 42 +- proton-c/bindings/cpp/CMakeCache.txt | 334 --------------- proton-c/bindings/cpp/CMakeLists.txt | 70 ++-- .../bindings/cpp/include/proton/Acceptor.hpp | 50 --- proton-c/bindings/cpp/include/proton/Acking.hpp | 44 -- .../cpp/include/proton/BlockingConnection.hpp | 66 --- .../cpp/include/proton/BlockingLink.hpp | 58 --- .../cpp/include/proton/BlockingSender.hpp | 53 --- .../bindings/cpp/include/proton/Connection.hpp | 69 ---- .../bindings/cpp/include/proton/Container.hpp | 77 ---- proton-c/bindings/cpp/include/proton/Data.hpp | 71 ---- .../bindings/cpp/include/proton/Decoder.hpp | 223 ---------- .../bindings/cpp/include/proton/Delivery.hpp | 60 --- .../bindings/cpp/include/proton/Duration.hpp | 55 --- .../bindings/cpp/include/proton/Encoder.hpp | 185 --------- .../bindings/cpp/include/proton/Endpoint.hpp | 58 --- proton-c/bindings/cpp/include/proton/Error.hpp | 44 -- proton-c/bindings/cpp/include/proton/Event.hpp | 59 --- proton-c/bindings/cpp/include/proton/Handle.hpp | 79 ---- .../bindings/cpp/include/proton/Handler.hpp | 49 --- proton-c/bindings/cpp/include/proton/Link.hpp | 69 ---- .../bindings/cpp/include/proton/Message.hpp | 112 ----- .../cpp/include/proton/MessagingAdapter.hpp | 77 ---- .../cpp/include/proton/MessagingEvent.hpp | 99 ----- .../cpp/include/proton/MessagingHandler.hpp | 98 ----- .../bindings/cpp/include/proton/ProtonEvent.hpp | 56 --- .../cpp/include/proton/ProtonHandle.hpp | 68 --- .../cpp/include/proton/ProtonHandler.hpp | 82 ---- .../bindings/cpp/include/proton/Receiver.hpp | 47 --- proton-c/bindings/cpp/include/proton/Sender.hpp | 52 --- .../bindings/cpp/include/proton/Session.hpp | 61 --- .../bindings/cpp/include/proton/Terminus.hpp | 81 ---- .../bindings/cpp/include/proton/Transport.hpp | 48 --- proton-c/bindings/cpp/include/proton/Value.hpp | 104 ----- proton-c/bindings/cpp/include/proton/Values.hpp | 60 --- .../cpp/include/proton/WaitCondition.hpp | 45 -- .../bindings/cpp/include/proton/acceptor.hpp | 49 +++ proton-c/bindings/cpp/include/proton/acking.hpp | 43 ++ .../cpp/include/proton/blocking_connection.hpp | 65 +++ .../cpp/include/proton/blocking_link.hpp | 57 +++ .../cpp/include/proton/blocking_sender.hpp | 52 +++ .../bindings/cpp/include/proton/connection.hpp | 67 +++ .../bindings/cpp/include/proton/container.hpp | 76 ++++ proton-c/bindings/cpp/include/proton/data.hpp | 70 ++++ .../bindings/cpp/include/proton/decoder.hpp | 230 +++++++++++ .../bindings/cpp/include/proton/delivery.hpp | 59 +++ .../bindings/cpp/include/proton/duration.hpp | 55 +++ .../bindings/cpp/include/proton/encoder.hpp | 198 +++++++++ .../bindings/cpp/include/proton/endpoint.hpp | 58 +++ proton-c/bindings/cpp/include/proton/error.hpp | 44 ++ proton-c/bindings/cpp/include/proton/event.hpp | 58 +++ proton-c/bindings/cpp/include/proton/handle.hpp | 78 ++++ .../bindings/cpp/include/proton/handler.hpp | 43 ++ proton-c/bindings/cpp/include/proton/index.md | 7 + proton-c/bindings/cpp/include/proton/link.hpp | 69 ++++ .../bindings/cpp/include/proton/message.hpp | 112 +++++ .../cpp/include/proton/messaging_adapter.hpp | 76 ++++ .../cpp/include/proton/messaging_event.hpp | 98 +++++ .../cpp/include/proton/messaging_handler.hpp | 96 +++++ .../cpp/include/proton/proton_event.hpp | 55 +++ .../cpp/include/proton/proton_handle.hpp | 67 +++ .../cpp/include/proton/proton_handler.hpp | 81 ++++ .../bindings/cpp/include/proton/receiver.hpp | 46 +++ proton-c/bindings/cpp/include/proton/sender.hpp | 51 +++ .../bindings/cpp/include/proton/session.hpp | 60 +++ .../bindings/cpp/include/proton/terminus.hpp | 83 ++++ .../bindings/cpp/include/proton/transport.hpp | 52 +++ .../bindings/cpp/include/proton/type_traits.hpp | 88 ++-- proton-c/bindings/cpp/include/proton/types.hpp | 281 ++++++------- proton-c/bindings/cpp/include/proton/value.hpp | 94 +++++ proton-c/bindings/cpp/include/proton/values.hpp | 53 +++ .../cpp/include/proton/wait_condition.hpp | 44 ++ proton-c/bindings/cpp/src/Acceptor.cpp | 56 --- proton-c/bindings/cpp/src/Acking.cpp | 49 --- .../bindings/cpp/src/BlockingConnection.cpp | 62 --- .../bindings/cpp/src/BlockingConnectionImpl.cpp | 124 ------ .../bindings/cpp/src/BlockingConnectionImpl.hpp | 63 --- proton-c/bindings/cpp/src/BlockingLink.cpp | 86 ---- proton-c/bindings/cpp/src/BlockingSender.cpp | 66 --- proton-c/bindings/cpp/src/Connection.cpp | 73 ---- proton-c/bindings/cpp/src/ConnectionImpl.cpp | 139 ------- proton-c/bindings/cpp/src/ConnectionImpl.hpp | 75 ---- proton-c/bindings/cpp/src/Connector.cpp | 71 ---- proton-c/bindings/cpp/src/Connector.hpp | 59 --- proton-c/bindings/cpp/src/Container.cpp | 97 ----- proton-c/bindings/cpp/src/ContainerImpl.cpp | 369 ----------------- proton-c/bindings/cpp/src/ContainerImpl.hpp | 82 ---- proton-c/bindings/cpp/src/Data.cpp | 65 --- proton-c/bindings/cpp/src/Decoder.cpp | 327 --------------- proton-c/bindings/cpp/src/Delivery.cpp | 58 --- proton-c/bindings/cpp/src/Duration.cpp | 31 -- proton-c/bindings/cpp/src/Encoder.cpp | 160 ------- proton-c/bindings/cpp/src/Endpoint.cpp | 37 -- proton-c/bindings/cpp/src/Error.cpp | 32 -- proton-c/bindings/cpp/src/Event.cpp | 71 ---- proton-c/bindings/cpp/src/Handler.cpp | 44 -- proton-c/bindings/cpp/src/Link.cpp | 114 ----- proton-c/bindings/cpp/src/Message.cpp | 253 ------------ proton-c/bindings/cpp/src/MessagingAdapter.cpp | 412 ------------------- proton-c/bindings/cpp/src/MessagingEvent.cpp | 150 ------- proton-c/bindings/cpp/src/MessagingHandler.cpp | 126 ------ proton-c/bindings/cpp/src/Msg.hpp | 59 --- proton-c/bindings/cpp/src/PrivateImplRef.hpp | 97 ----- proton-c/bindings/cpp/src/ProtonEvent.cpp | 153 ------- proton-c/bindings/cpp/src/ProtonHandler.cpp | 74 ---- proton-c/bindings/cpp/src/ProtonImplRef.hpp | 66 --- proton-c/bindings/cpp/src/Receiver.cpp | 45 -- proton-c/bindings/cpp/src/Sender.cpp | 72 ---- proton-c/bindings/cpp/src/Session.cpp | 74 ---- proton-c/bindings/cpp/src/Terminus.cpp | 102 ----- proton-c/bindings/cpp/src/Transport.cpp | 39 -- proton-c/bindings/cpp/src/Url.cpp | 77 ---- proton-c/bindings/cpp/src/Url.hpp | 49 --- proton-c/bindings/cpp/src/Value.cpp | 136 ------ proton-c/bindings/cpp/src/Values.cpp | 40 -- proton-c/bindings/cpp/src/acceptor.cpp | 55 +++ proton-c/bindings/cpp/src/acking.cpp | 48 +++ .../bindings/cpp/src/blocking_connection.cpp | 61 +++ .../cpp/src/blocking_connection_impl.cpp | 123 ++++++ .../cpp/src/blocking_connection_impl.hpp | 62 +++ proton-c/bindings/cpp/src/blocking_link.cpp | 85 ++++ proton-c/bindings/cpp/src/blocking_sender.cpp | 65 +++ proton-c/bindings/cpp/src/connection.cpp | 68 +++ proton-c/bindings/cpp/src/connection_impl.cpp | 136 ++++++ proton-c/bindings/cpp/src/connection_impl.hpp | 74 ++++ proton-c/bindings/cpp/src/connector.cpp | 70 ++++ proton-c/bindings/cpp/src/connector.hpp | 58 +++ proton-c/bindings/cpp/src/container.cpp | 96 +++++ proton-c/bindings/cpp/src/container_impl.cpp | 361 ++++++++++++++++ proton-c/bindings/cpp/src/container_impl.hpp | 81 ++++ proton-c/bindings/cpp/src/contexts.cpp | 41 +- proton-c/bindings/cpp/src/contexts.hpp | 31 +- proton-c/bindings/cpp/src/data.cpp | 67 +++ proton-c/bindings/cpp/src/decoder.cpp | 329 +++++++++++++++ proton-c/bindings/cpp/src/delivery.cpp | 57 +++ proton-c/bindings/cpp/src/duration.cpp | 31 ++ proton-c/bindings/cpp/src/encoder.cpp | 142 +++++++ proton-c/bindings/cpp/src/endpoint.cpp | 40 ++ proton-c/bindings/cpp/src/error.cpp | 32 ++ proton-c/bindings/cpp/src/event.cpp | 70 ++++ proton-c/bindings/cpp/src/handler.cpp | 35 ++ proton-c/bindings/cpp/src/interop_test.cpp | 69 ++-- proton-c/bindings/cpp/src/link.cpp | 113 +++++ proton-c/bindings/cpp/src/message.cpp | 252 ++++++++++++ proton-c/bindings/cpp/src/messaging_adapter.cpp | 411 ++++++++++++++++++ proton-c/bindings/cpp/src/messaging_event.cpp | 148 +++++++ proton-c/bindings/cpp/src/messaging_handler.cpp | 125 ++++++ proton-c/bindings/cpp/src/msg.hpp | 58 +++ proton-c/bindings/cpp/src/private_impl_ref.hpp | 96 +++++ proton-c/bindings/cpp/src/proton_bits.cpp | 10 +- proton-c/bindings/cpp/src/proton_bits.hpp | 8 +- proton-c/bindings/cpp/src/proton_event.cpp | 151 +++++++ proton-c/bindings/cpp/src/proton_handler.cpp | 73 ++++ proton-c/bindings/cpp/src/proton_impl_ref.hpp | 65 +++ proton-c/bindings/cpp/src/receiver.cpp | 44 ++ proton-c/bindings/cpp/src/sender.cpp | 71 ++++ proton-c/bindings/cpp/src/session.cpp | 73 ++++ proton-c/bindings/cpp/src/terminus.cpp | 101 +++++ proton-c/bindings/cpp/src/transport.cpp | 38 ++ proton-c/bindings/cpp/src/types.cpp | 49 +-- proton-c/bindings/cpp/src/url.cpp | 76 ++++ proton-c/bindings/cpp/src/url.hpp | 48 +++ proton-c/bindings/cpp/src/value.cpp | 136 ++++++ proton-c/bindings/cpp/src/values.cpp | 38 ++ proton-c/docs/api/index.md | 2 - proton-c/docs/api/user.doxygen.in | 4 +- 175 files changed, 7412 insertions(+), 7863 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore index 45dd364..0b26644 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,6 @@ proton-c/bindings/go/bin # Testresults from the jenkins build script testresults + +# KDE project files +/*.kdev* http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/examples/cpp/README_dev.md ---------------------------------------------------------------------- diff --git a/examples/cpp/README_dev.md b/examples/cpp/README_dev.md new file mode 100644 index 0000000..0b23a2f --- /dev/null +++ b/examples/cpp/README_dev.md @@ -0,0 +1,9 @@ +# Notes for example developers + +Use the C++ std library/boost conventions. File names are (*.hpp, *.cpp) and +identifiers are lowercase_underscore names not CamelCase. + +No "using namespace proton" in examples. This is not a general rule, but for +_example_ code the explicit `proton::` qualifier makes it easier to see what is +part of the proton library vs. standard library or code that is just part of the +example. http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/examples/cpp/broker.cpp ---------------------------------------------------------------------- diff --git a/examples/cpp/broker.cpp b/examples/cpp/broker.cpp index 468af48..cd5eb54 100644 --- a/examples/cpp/broker.cpp +++ b/examples/cpp/broker.cpp @@ -19,64 +19,57 @@ * */ -#include "proton/Container.hpp" -#include "proton/MessagingHandler.hpp" +#include "proton/container.hpp" +#include "proton/messaging_handler.hpp" #include <iostream> +#include <sstream> #include <deque> #include <map> #include <list> -#include <stdlib.h> -#include <string.h> +#include <string> -using namespace proton; -using namespace proton::reactor; - -std::string generateUuid(){ - throw "TODO: platform neutral uuid"; -} - -class Queue { +class queue { public: bool dynamic; - typedef std::deque<Message> MsgQ; - typedef std::list<Sender> List; - MsgQ queue; - List consumers; + typedef std::deque<proton::message> message_queue; + typedef std::list<proton::sender> sender_list; + message_queue messages; + sender_list consumers; - Queue(bool dyn = false) : dynamic(dyn), queue(MsgQ()), consumers(List()) {} + queue(bool dyn = false) : dynamic(dyn) {} - void subscribe(Sender &c) { + void subscribe(proton::sender &c) { consumers.push_back(c); } - bool unsubscribe(Sender &c) { + bool unsubscribe(proton::sender &c) { consumers.remove(c); - return (consumers.size() == 0 && (dynamic || queue.size() == 0)); + return (consumers.size() == 0 && (dynamic || messages.size() == 0)); } - void publish(Message &m) { - queue.push_back(m); + void publish(proton::message &m) { + messages.push_back(m); dispatch(0); } - void dispatch(Sender *s) { - while (deliverTo(s)) { + void dispatch(proton::sender *s) { + while (deliver_to(s)) { } } - bool deliverTo(Sender *consumer) { + bool deliver_to(proton::sender *consumer) { // deliver to single consumer if supplied, else all consumers int count = consumer ? 1 : consumers.size(); if (!count) return false; bool result = false; - List::iterator it = consumers.begin(); + sender_list::iterator it = consumers.begin(); if (!consumer && count) consumer = &*it; - while (queue.size()) { - if (consumer->getCredit()) { - consumer->send(queue.front()); - queue.pop_front(); + while (messages.size()) { + if (consumer->credit()) { + consumer->send(messages.front()); + messages.pop_front(); result = true; } if (--count) @@ -88,24 +81,26 @@ class Queue { } }; -class Broker : public MessagingHandler { +class broker : public proton::messaging_handler { private: + typedef std::map<std::string, queue *> queue_map; std::string url; - typedef std::map<std::string, Queue *> QMap; - QMap queues; + queue_map queues; + uint64_t queue_count; // Use to generate unique queue IDs. + public: - Broker(const std::string &s) : url(s), queues(QMap()) {} + broker(const std::string &s) : url(s), queue_count(0) {} - void onStart(Event &e) { - e.getContainer().listen(url); + void on_start(proton::event &e) { + e.container().listen(url); std::cout << "broker listening on " << url << std::endl; } - Queue &queue(std::string &address) { - QMap::iterator it = queues.find(address); + class queue &get_queue(std::string &address) { + queue_map::iterator it = queues.find(address); if (it == queues.end()) { - queues[address] = new Queue(); + queues[address] = new queue(); return *queues[address]; } else { @@ -113,88 +108,94 @@ class Broker : public MessagingHandler { } } - void onLinkOpening(Event &e) { - Link lnk = e.getLink(); - if (lnk.isSender()) { - Sender sender(lnk); - Terminus remoteSource(lnk.getRemoteSource()); - if (remoteSource.isDynamic()) { - std::string address = generateUuid(); - lnk.getSource().setAddress(address); - Queue *q = new Queue(true); + std::string queue_name() { + std::ostringstream os; + os << "q" << queue_count++; + return os.str(); + } + + void on_link_opening(proton::event &e) { + proton::link lnk = e.link(); + if (lnk.is_sender()) { + proton::sender sender(lnk); + proton::terminus remote_source(lnk.remote_source()); + if (remote_source.is_dynamic()) { + std::string address = queue_name(); + lnk.source().address(address); + queue *q = new queue(true); queues[address] = q; q->subscribe(sender); } else { - std::string address = remoteSource.getAddress(); + std::string address = remote_source.address(); if (!address.empty()) { - lnk.getSource().setAddress(address); - queue(address).subscribe(sender); + lnk.source().address(address); + get_queue(address).subscribe(sender); } } } else { - std::string address = lnk.getRemoteTarget().getAddress(); + std::string address = lnk.remote_target().address(); if (!address.empty()) - lnk.getTarget().setAddress(address); + lnk.target().address(address); } } - void unsubscribe (Sender &lnk) { - std::string address = lnk.getSource().getAddress(); - QMap::iterator it = queues.find(address); + void unsubscribe (proton::sender &lnk) { + std::string address = lnk.source().address(); + queue_map::iterator it = queues.find(address); if (it != queues.end() && it->second->unsubscribe(lnk)) { delete it->second; queues.erase(it); } } - void onLinkClosing(Event &e) { - Link lnk = e.getLink(); - if (lnk.isSender()) { - Sender s(lnk); + void on_link_closing(proton::event &e) { + proton::link lnk = e.link(); + if (lnk.is_sender()) { + proton::sender s(lnk); unsubscribe(s); } } - void onConnectionClosing(Event &e) { - removeStaleConsumers(e.getConnection()); + void on_connection_closing(proton::event &e) { + remove_stale_consumers(e.connection()); } - void onDisconnected(Event &e) { - removeStaleConsumers(e.getConnection()); + void on_disconnected(proton::event &e) { + remove_stale_consumers(e.connection()); } - void removeStaleConsumers(Connection &connection) { - Link l = connection.getLinkHead(Endpoint::REMOTE_ACTIVE); + void remove_stale_consumers(proton::connection &connection) { + proton::link l = connection.link_head(proton::endpoint::REMOTE_ACTIVE); while (l) { - if (l.isSender()) { - Sender s(l); + if (l.is_sender()) { + proton::sender s(l); unsubscribe(s); } - l = l.getNext(Endpoint::REMOTE_ACTIVE); + l = l.next(proton::endpoint::REMOTE_ACTIVE); } } - void onSendable(Event &e) { - Link lnk = e.getLink(); - Sender sender(lnk); - std::string addr = lnk.getSource().getAddress(); - queue(addr).dispatch(&sender); + void on_sendable(proton::event &e) { + proton::link lnk = e.link(); + proton::sender sender(lnk); + std::string addr = lnk.source().address(); + get_queue(addr).dispatch(&sender); } - void onMessage(Event &e) { - std::string addr = e.getLink().getTarget().getAddress(); - Message msg = e.getMessage(); - queue(addr).publish(msg); + void on_message(proton::event &e) { + std::string addr = e.link().target().address(); + proton::message msg = e.message(); + get_queue(addr).publish(msg); } }; int main(int argc, char **argv) { std::string url = argc > 1 ? argv[1] : ":5672"; - Broker broker(url); + broker broker(url); try { - Container(broker).run(); + proton::container(broker).run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return 1; http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/examples/cpp/encode_decode.cpp ---------------------------------------------------------------------- diff --git a/examples/cpp/encode_decode.cpp b/examples/cpp/encode_decode.cpp index fd65ebd..df9ad15 100644 --- a/examples/cpp/encode_decode.cpp +++ b/examples/cpp/encode_decode.cpp @@ -17,73 +17,70 @@ * under the License. */ -#include <proton/Values.hpp> -#include <proton/Value.hpp> +#include <proton/value.hpp> #include <algorithm> #include <iostream> #include <iterator> #include <map> #include <sstream> -#include <stdexcept> #include <vector> using namespace std; -using namespace proton; -// Examples of how to use the Encoder and Decoder to create and examine AMQP values. +// Examples of how to use the encoder and decoder to create and examine AMQP values. // // Print is defined at the end as an example of how to query and extract complex // values in terms of their simple components. -void print(Values& values); +void print(proton::values& values); // Inserting and extracting simple C++ values. void simple_insert_extract() { - Values values; + proton::values vv; cout << endl << "== Simple values: int, string, bool" << endl; - values << 42 << "foo" << true; - print(values); + vv << 42 << "foo" << true; + print(vv); int i; - std::string s; + string s; bool b; - values.rewind(); - values >> i >> s >> b; + vv.rewind(); + vv >> i >> s >> b; cout << "Extracted: " << i << ", " << s << ", " << b << endl; // Encode and decode as AMQP - string amqpData = values.encode(); - cout << "Encoded as AMQP in " << amqpData.size() << " bytes" << endl; - Values values2; - values.decode(amqpData); - values >> i >> s >> b; + string amqp_data = vv.encode(); + cout << "Encoded as AMQP in " << amqp_data.size() << " bytes" << endl; + proton::values vv2; + vv2.decode(amqp_data); + vv2 >> i >> s >> b; cout << "Decoded: " << i << ", " << s << ", " << b << endl; } // Inserting values as a specific AMQP type void simple_insert_extract_exact_type() { - Values values; + proton::values vv; cout << endl << "== Specific AMQP types: byte, long, symbol" << endl; - values << Byte('x') << Long(123456789123456789) << Symbol("bar"); - print(values); - values.rewind(); + vv << proton::amqp_byte('x') << proton::amqp_long(123456789123456789) << proton::amqp_symbol("bar"); + print(vv); + vv.rewind(); // Check that we encoded the correct types, but note that decoding will // still convert to standard C++ types, in particular any AMQP integer type // can be converted to a long-enough C++ integer type.. - std::int64_t i1, i2; - std::string s; - values >> i1 >> i2 >> s; + int64_t i1, i2; + string s; + vv >> i1 >> i2 >> s; cout << "Extracted (with conversion) " << i1 << ", " << i2 << ", " << s << endl; // Now use the as() function to fail unless we extract the exact AMQP type expected. - values.rewind(); // Byte(1) << Long(2) << Symbol("bar"); - Long l; - // Fails, extracting Byte as Long - try { values >> as<LONG>(l); throw logic_error("expected error"); } catch (DecodeError) {} - Byte b; - values >> as<BYTE>(b) >> as<LONG>(l); // OK, extract Byte as Byte, Long as Long. - std::string str; - // Fails, extracting Symbol as String. - try { values >> as<STRING>(str); throw logic_error("expected error"); } catch (DecodeError) {} - values >> as<SYMBOL>(str); // OK, extract Symbol as Symbol + vv.rewind(); // amqp_byte(1) << amqp_long(2) << amqp_symbol("bar"); + proton::amqp_long l; + // Fails, extracting amqp_byte as amqp_long + try { vv >> proton::as<proton::LONG>(l); throw logic_error("expected error"); } catch (proton::decode_error) {} + proton::amqp_byte b; + vv >> proton::as<proton::BYTE>(b) >> proton::as<proton::LONG>(l); // OK, extract amqp_byte as amqp_byte, amqp_long as amqp_long. + string str; + // Fails, extracting amqp_symbol as amqp_string. + try { vv >> proton::as<proton::STRING>(str); throw logic_error("expected error"); } catch (proton::decode_error) {} + vv >> proton::as<proton::SYMBOL>(str); // OK, extract amqp_symbol as amqp_symbol cout << "Extracted (exact) " << b << ", " << l << ", " << str << endl; } @@ -121,54 +118,54 @@ void insert_extract_containers() { m["one"] = 1; m["two"] = 2; - Values values; - values << as<ARRAY>(a) << as<LIST>(l) << as<MAP>(m); - print(values); + proton::values vv; + vv << proton::as<proton::ARRAY>(a) << proton::as<proton::LIST>(l) << proton::as<proton::MAP>(m); + print(vv); vector<int> a1, l1; map<string, int> m1; - values.rewind(); - values >> as<ARRAY>(a1) >> as<LIST>(l1) >> as<MAP>(m1); + vv.rewind(); + vv >> proton::as<proton::ARRAY>(a1) >> proton::as<proton::LIST>(l1) >> proton::as<proton::MAP>(m1); cout << "Extracted: " << a1 << ", " << l1 << ", " << m1 << endl; } -// Containers with mixed types, use Value to represent arbitrary AMQP types. +// Containers with mixed types, use value to represent arbitrary AMQP types. void mixed_containers() { cout << endl << "== List and map of mixed type values." << endl; - vector<Value> l; - l.push_back(Value(42)); - l.push_back(Value(String("foo"))); - map<Value, Value> m; - m[Value("five")] = Value(5); - m[Value(4)] = Value("four"); - Values values; - values << as<LIST>(l) << as<MAP>(m); - print(values); + vector<proton::value> l; + l.push_back(proton::value(42)); + l.push_back(proton::value(proton::amqp_string("foo"))); + map<proton::value, proton::value> m; + m[proton::value("five")] = proton::value(5); + m[proton::value(4)] = proton::value("four"); + proton::values vv; + vv << proton::as<proton::LIST>(l) << proton::as<proton::MAP>(m); + print(vv); - vector<Value> l1; - map<Value, Value> m1; - values.rewind(); - values >> as<LIST>(l1) >> as<MAP>(m1); + vector<proton::value> l1; + map<proton::value, proton::value> m1; + vv.rewind(); + vv >> proton::as<proton::LIST>(l1) >> proton::as<proton::MAP>(m1); cout << "Extracted: " << l1 << ", " << m1 << endl; } -// Insert using stream operators (see printNext for example of extracting with stream ops.) +// Insert using stream operators (see print_next for example of extracting with stream ops.) void insert_extract_stream_operators() { cout << endl << "== Insert with stream operators." << endl; - Values values; + proton::values vv; // Note: array elements must be encoded with the exact type, they are not // automaticlly converted. Mismatched types for array elements will not - // be detected until values.encode() is called. - values << Start::array(INT) << Int(1) << Int(2) << Int(3) << finish(); - print(values); + // be detected until vv.encode() is called. + vv << proton::start::array(proton::INT) << proton::amqp_int(1) << proton::amqp_int(2) << proton::amqp_int(3) << proton::finish(); + print(vv); - values.clear(); - values << Start::list() << Int(42) << false << Symbol("x") << finish(); - print(values); + vv.clear(); + vv << proton::start::list() << proton::amqp_int(42) << false << proton::amqp_symbol("x") << proton::finish(); + print(vv); - values.clear(); - values << Start::map() << "k1" << Int(42) << Symbol("k2") << false << finish(); - print(values); + vv.clear(); + vv << proton::start::map() << "k1" << proton::amqp_int(42) << proton::amqp_symbol("k2") << false << proton::finish(); + print(vv); } int main(int, char**) { @@ -184,80 +181,80 @@ int main(int, char**) { } } -// printNext prints the next value from Values by recursively descending into complex values. +// print_next prints the next value from values by recursively descending into complex values. // -// NOTE this is for example puroses only: There is a built in ostream operator<< for Values. +// NOTE this is for example puroses only: There is a built in ostream operator<< for values. // // -void printNext(Values& values) { - TypeId type = values.type(); - Start start; +void print_next(proton::values& vv) { + proton::type_id type = vv.type(); + proton::start s; switch (type) { - case ARRAY: { - values >> start; - cout << "array<" << start.element; - if (start.isDescribed) { + case proton::ARRAY: { + vv >> s; + cout << "array<" << s.element; + if (s.is_described) { cout << ", descriptor="; - printNext(values); + print_next(vv); } cout << ">["; - for (size_t i = 0; i < start.size; ++i) { + for (size_t i = 0; i < s.size; ++i) { if (i) cout << ", "; - printNext(values); + print_next(vv); } cout << "]"; - values >> finish(); + vv >> proton::finish(); break; } - case LIST: { - values >> start; + case proton::LIST: { + vv >> s; cout << "list["; - for (size_t i = 0; i < start.size; ++i) { + for (size_t i = 0; i < s.size; ++i) { if (i) cout << ", "; - printNext(values); + print_next(vv); } cout << "]"; - values >> finish(); + vv >> proton::finish(); break; } - case MAP: { - values >> start; + case proton::MAP: { + vv >> s; cout << "map{"; - for (size_t i = 0; i < start.size/2; ++i) { + for (size_t i = 0; i < s.size/2; ++i) { if (i) cout << ", "; - printNext(values); + print_next(vv); cout << ":"; // key:value - printNext(values); + print_next(vv); } cout << "}"; - values >> finish(); + vv >> proton::finish(); break; } - case DESCRIBED: { - values >> start; + case proton::DESCRIBED: { + vv >> s; cout << "described("; - printNext(values); // Descriptor - printNext(values); // Value - values >> finish(); + print_next(vv); // Descriptor + print_next(vv); // value + vv >> proton::finish(); break; } default: // A simple type. We could continue the switch for all AMQP types but - // instead we us the `Value` type which can hold and print any AMQP + // instead we us the `value` type which can hold and print any AMQP // value. - Value v; - values >> v; + proton::value v; + vv >> v; cout << type << "(" << v << ")"; } } -// Print all the values with printNext -void print(Values& values) { - values.rewind(); +// Print all the values with print_next +void print(proton::values& vv) { + vv.rewind(); cout << "Values: "; - while (values.more()) { - printNext(values); - if (values.more()) cout << ", "; + while (vv.more()) { + print_next(vv); + if (vv.more()) cout << ", "; } cout << endl; } http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/examples/cpp/example_test.py ---------------------------------------------------------------------- diff --git a/examples/cpp/example_test.py b/examples/cpp/example_test.py index 8507be8..8aa321f 100644 --- a/examples/cpp/example_test.py +++ b/examples/cpp/example_test.py @@ -28,11 +28,11 @@ def call(*args, **kwargs): p = Popen(*args, stdout=PIPE, stderr=STDOUT, **kwargs) out, err = p.communicate() if p.returncode: - raise CalledProcessError("""%s exit code %s -vvvvvvvvvvvvvvvv output of %s exit code %s vvvvvvvvvvvvvvvv + raise Exception("""%s exit code %s +vvvvvvvvvvvvvvvv %s -^^^^^^^^^^^^^^^^ output of %s exit code %s ^^^^^^^^^^^^^^^^""" % ( - p.cmd, p.returncode, p.cmd, p.returncode, out, p.cmd, p.returncode)) +^^^^^^^^^^^^^^^^ +""" % (args[0], p.returncode, out)) return out NULL = open(os.devnull, 'w') @@ -55,7 +55,7 @@ class Broker(object): def __init__(self): self.port = randrange(10000, 20000) self.addr = ":%s" % self.port - self.process = Popen(["./broker", self.addr], stdout=NULL, stderr=NULL) + self.process = Popen([os.path.abspath("broker"), self.addr], stdout=NULL, stderr=NULL) # Wait 10 secs for broker to listen deadline = time.time() + 10 c = None http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/examples/cpp/helloworld.cpp ---------------------------------------------------------------------- diff --git a/examples/cpp/helloworld.cpp b/examples/cpp/helloworld.cpp index 9546218..c00ec8e 100644 --- a/examples/cpp/helloworld.cpp +++ b/examples/cpp/helloworld.cpp @@ -19,39 +19,37 @@ * */ -#include "proton/Container.hpp" -#include "proton/MessagingHandler.hpp" +#include "proton/container.hpp" +#include "proton/messaging_handler.hpp" #include <iostream> - -using namespace proton; -using namespace proton::reactor; - -class HelloWorld : public MessagingHandler { +class hello_world : public proton::messaging_handler { private: std::string server; std::string address; public: - HelloWorld(const std::string &s, const std::string &addr) : server(s), address(addr) {} + hello_world(const std::string &s, const std::string &addr) : server(s), address(addr) {} - void onStart(Event &e) { - Connection conn = e.getContainer().connect(server); - e.getContainer().createReceiver(conn, address); - e.getContainer().createSender(conn, address); + void on_start(proton::event &e) { + proton::connection conn = e.container().connect(server); + e.container().create_receiver(conn, address); + e.container().create_sender(conn, address); } - void onSendable(Event &e) { - Message m; + void on_sendable(proton::event &e) { + proton::message m; m.body("Hello World!"); - e.getSender().send(m); - e.getSender().close(); + e.sender().send(m); + e.sender().close(); } - void onMessage(Event &e) { - std::cout << e.getMessage().body().get<String>() << std::endl; - e.getConnection().close(); + void on_message(proton::event &e) { + std::string s; + proton::value v(e.message().body()); + std::cout << v.get<std::string>() << std::endl; + e.connection().close(); } }; @@ -60,8 +58,8 @@ int main(int argc, char **argv) { try { std::string server = argc > 1 ? argv[1] : ":5672"; std::string addr = argc > 2 ? argv[2] : "examples"; - HelloWorld hw(server, addr); - Container(hw).run(); + hello_world hw(server, addr); + proton::container(hw).run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return 1; http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/examples/cpp/helloworld_blocking.cpp ---------------------------------------------------------------------- diff --git a/examples/cpp/helloworld_blocking.cpp b/examples/cpp/helloworld_blocking.cpp index b5aee8d..e08e93d 100644 --- a/examples/cpp/helloworld_blocking.cpp +++ b/examples/cpp/helloworld_blocking.cpp @@ -19,32 +19,29 @@ * */ -#include "proton/Container.hpp" -#include "proton/MessagingHandler.hpp" -#include "proton/BlockingSender.hpp" +#include "proton/container.hpp" +#include "proton/messaging_handler.hpp" +#include "proton/blocking_sender.hpp" #include <iostream> - -using namespace proton; -using namespace proton::reactor; - -class HelloWorldBlocking : public MessagingHandler { +class hello_world_blocking : public proton::messaging_handler { private: std::string server; std::string address; public: - HelloWorldBlocking(const std::string &s, const std::string &addr) : server(s), address(addr) {} + hello_world_blocking(const std::string &s, const std::string &addr) : server(s), address(addr) {} - void onStart(Event &e) { - Connection conn = e.getContainer().connect(server); - e.getContainer().createReceiver(conn, address); + void on_start(proton::event &e) { + proton::connection conn = e.container().connect(server); + e.container().create_receiver(conn, address); } - void onMessage(Event &e) { - std::cout << e.getMessage().body().get<String>() << std::endl; - e.getConnection().close(); + void on_message(proton::event &e) { + proton::value v(e.message().body()); + std::cout << v.get<std::string>() << std::endl; + e.connection().close(); } }; @@ -53,16 +50,16 @@ int main(int argc, char **argv) { try { std::string server = argc > 1 ? argv[1] : ":5672"; std::string addr = argc > 2 ? argv[2] : "examples"; - BlockingConnection conn = BlockingConnection(server); - BlockingSender sender = conn.createSender(addr); - Message m; + proton::blocking_connection conn(server); + proton::blocking_sender sender = conn.create_sender(addr); + proton::message m; m.body("Hello World!"); sender.send(m); conn.close(); // TODO Temporary hack until blocking receiver available - HelloWorldBlocking hw(server, addr); - Container(hw).run(); + hello_world_blocking hw(server, addr); + proton::container(hw).run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return 1; http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/examples/cpp/helloworld_direct.cpp ---------------------------------------------------------------------- diff --git a/examples/cpp/helloworld_direct.cpp b/examples/cpp/helloworld_direct.cpp index 536aba8..1d87037 100644 --- a/examples/cpp/helloworld_direct.cpp +++ b/examples/cpp/helloworld_direct.cpp @@ -19,47 +19,46 @@ * */ -#include "proton/MessagingHandler.hpp" -#include "proton/Container.hpp" +#include "proton/messaging_handler.hpp" +#include "proton/container.hpp" -//#include "proton/Acceptor.hpp" +//#include "proton/acceptor.hpp" #include <iostream> -using namespace proton; -using namespace proton::reactor; -class HelloWorldDirect : public MessagingHandler { +class hello_world_direct : public proton::messaging_handler { private: - std::string url; - Acceptor acceptor; + std::string url_; + proton::acceptor acceptor_; public: - HelloWorldDirect(const std::string &u) : url(u) {} + hello_world_direct(const std::string &u) : url_(u) {} - void onStart(Event &e) { - acceptor = e.getContainer().listen(url); - e.getContainer().createSender(url); + void on_start(proton::event &e) { + acceptor_ = e.container().listen(url_); + e.container().create_sender(url_); } - void onSendable(Event &e) { - Message m; + void on_sendable(proton::event &e) { + proton::message m; m.body("Hello World!"); - e.getSender().send(m); - e.getSender().close(); + e.sender().send(m); + e.sender().close(); } - void onMessage(Event &e) { - std::cout << e.getMessage().body().get<String>() << std::endl; + void on_message(proton::event &e) { + proton::value v(e.message().body()); + std::cout << v.get<std::string>() << std::endl; } - void onAccepted(Event &e) { - e.getConnection().close(); + void on_accepted(proton::event &e) { + e.connection().close(); } - void onConnectionClosed(Event &e) { - acceptor.close(); + void on_connection_closed(proton::event &e) { + acceptor_.close(); } }; @@ -67,8 +66,8 @@ class HelloWorldDirect : public MessagingHandler { int main(int argc, char **argv) { try { std::string url = argc > 1 ? argv[1] : ":8888/examples"; - HelloWorldDirect hwd(url); - Container(hwd).run(); + hello_world_direct hwd(url); + proton::container(hwd).run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return 1; http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/examples/cpp/simple_recv.cpp ---------------------------------------------------------------------- diff --git a/examples/cpp/simple_recv.cpp b/examples/cpp/simple_recv.cpp index b4572f5..806d928 100644 --- a/examples/cpp/simple_recv.cpp +++ b/examples/cpp/simple_recv.cpp @@ -19,9 +19,9 @@ * */ -#include "proton/Container.hpp" -#include "proton/MessagingHandler.hpp" -#include "proton/Link.hpp" +#include "proton/container.hpp" +#include "proton/messaging_handler.hpp" +#include "proton/link.hpp" #include <iostream> #include <map> @@ -30,27 +30,25 @@ #include <string.h> -using namespace proton; -using namespace proton::reactor; -class Recv : public MessagingHandler { +class simple_recv : public proton::messaging_handler { private: std::string url; int expected; int received; public: - Recv(const std::string &s, int c) : url(s), expected(c), received(0) {} + simple_recv(const std::string &s, int c) : url(s), expected(c), received(0) {} - void onStart(Event &e) { - e.getContainer().createReceiver(url); + void on_start(proton::event &e) { + e.container().create_receiver(url); std::cout << "simple_recv listening on " << url << std::endl; } - void onMessage(Event &e) { - Message msg = e.getMessage(); - Value id = msg.id(); - if (id.type() == ULONG) { + void on_message(proton::event &e) { + proton::message msg = e.message(); + proton::value id = msg.id(); + if (id.type() == proton::ULONG) { if (id.get<int>() < received) return; // ignore duplicate } @@ -58,8 +56,8 @@ class Recv : public MessagingHandler { std::cout << msg.body() << std::endl; received++; if (received == expected) { - e.getReceiver().close(); - e.getConnection().close(); + e.receiver().close(); + e.connection().close(); } } } @@ -69,11 +67,11 @@ static void parse_options(int argc, char **argv, int &count, std::string &addr); int main(int argc, char **argv) { try { - int messageCount = 100; + int message_count = 100; std::string address("localhost:5672/examples"); - parse_options(argc, argv, messageCount, address); - Recv recv(address, messageCount); - Container(recv).run(); + parse_options(argc, argv, message_count, address); + simple_recv recv(address, message_count); + proton::container(recv).run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return 1; http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/examples/cpp/simple_send.cpp ---------------------------------------------------------------------- diff --git a/examples/cpp/simple_send.cpp b/examples/cpp/simple_send.cpp index f7518c1..703561c 100644 --- a/examples/cpp/simple_send.cpp +++ b/examples/cpp/simple_send.cpp @@ -19,9 +19,9 @@ * */ -#include "proton/Container.hpp" -#include "proton/MessagingHandler.hpp" -#include "proton/Connection.hpp" +#include "proton/container.hpp" +#include "proton/messaging_handler.hpp" +#include "proton/connection.hpp" #include <iostream> #include <map> @@ -30,10 +30,8 @@ #include <stdio.h> -using namespace proton; -using namespace proton::reactor; -class Send : public MessagingHandler { +class simple_send : public proton::messaging_handler { private: std::string url; int sent; @@ -41,34 +39,34 @@ class Send : public MessagingHandler { int total; public: - Send(const std::string &s, int c) : url(s), sent(0), confirmed(0), total(c) {} + simple_send(const std::string &s, int c) : url(s), sent(0), confirmed(0), total(c) {} - void onStart(Event &e) { - e.getContainer().createSender(url); + void on_start(proton::event &e) { + e.container().create_sender(url); } - void onSendable(Event &e) { - Sender sender = e.getSender(); - while (sender.getCredit() && sent < total) { - Message msg; - msg.id(Value(sent + 1)); + void on_sendable(proton::event &e) { + proton::sender sender = e.sender(); + while (sender.credit() && sent < total) { + proton::message msg; + msg.id(proton::value(sent + 1)); std::map<std::string, int> m; m["sequence"] = sent+1; - msg.body(as<MAP>(m)); + msg.body(proton::as<proton::MAP>(m)); sender.send(msg); sent++; } } - void onAccepted(Event &e) { + void on_accepted(proton::event &e) { confirmed++; if (confirmed == total) { std::cout << "all messages confirmed" << std::endl; - e.getConnection().close(); + e.connection().close(); } } - void onDisconnected(Event &e) { + void on_disconnected(proton::event &e) { sent = confirmed; } }; @@ -77,11 +75,11 @@ static void parse_options(int argc, char **argv, int &count, std::string &addr); int main(int argc, char **argv) { try { - int messageCount = 100; + int message_count = 100; std::string address("localhost:5672/examples"); - parse_options(argc, argv, messageCount, address); - Send send(address, messageCount); - Container(send).run(); + parse_options(argc, argv, message_count, address); + simple_send send(address, message_count); + proton::container(send).run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return 1; http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/proton-c/bindings/cpp/CMakeCache.txt ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/CMakeCache.txt b/proton-c/bindings/cpp/CMakeCache.txt deleted file mode 100644 index 9e6eaeb..0000000 --- a/proton-c/bindings/cpp/CMakeCache.txt +++ /dev/null @@ -1,334 +0,0 @@ -# This is the CMakeCache file. -# For build in directory: /home/aconway/proton/proton-c/bindings/cpp -# It was generated by CMake: /usr/bin/cmake -# You can edit this file to change values found and used by cmake. -# If you do not want to change any of the values, simply exit the editor. -# If you do want to change a value, simply edit, save, and exit the editor. -# The syntax for the file is as follows: -# KEY:TYPE=VALUE -# KEY is the name of a variable in the cache. -# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. -# VALUE is the current value for the KEY. - -######################## -# EXTERNAL cache entries -######################## - -//Build cpp language binding -BUILD_CPP:BOOL=ON - -//Build javascript language binding -BUILD_JAVASCRIPT:BOOL=OFF - -//Path to a program. -CMAKE_AR:FILEPATH=/usr/bin/ar - -//For backwards compatibility, what version of CMake commands and -// syntax should this version of CMake try to support. -CMAKE_BACKWARDS_COMPATIBILITY:STRING=2.4 - -//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or -// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel. -CMAKE_BUILD_TYPE:STRING= - -//Enable/Disable color output during build. -CMAKE_COLOR_MAKEFILE:BOOL=ON - -//CXX compiler -CMAKE_CXX_COMPILER:FILEPATH=/usr/lib64/ccache/c++ - -//Flags used by the compiler during all build types. -CMAKE_CXX_FLAGS:STRING= - -//Flags used by the compiler during debug builds. -CMAKE_CXX_FLAGS_DEBUG:STRING=-g - -//Flags used by the compiler during release builds for minimum -// size. -CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the compiler during release builds. -CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the compiler during release builds with debug info. -CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//C compiler -CMAKE_C_COMPILER:FILEPATH=/usr/lib64/ccache/cc - -//Flags used by the compiler during all build types. -CMAKE_C_FLAGS:STRING= - -//Flags used by the compiler during debug builds. -CMAKE_C_FLAGS_DEBUG:STRING=-g - -//Flags used by the compiler during release builds for minimum -// size. -CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the compiler during release builds. -CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the compiler during release builds with debug info. -CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//Flags used by the linker. -CMAKE_EXE_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Enable/Disable output of compile commands during generation. -CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF - -//Install path prefix, prepended onto install directories. -CMAKE_INSTALL_PREFIX:PATH=/usr/local - -//Path to a program. -CMAKE_LINKER:FILEPATH=/usr/bin/ld - -//Path to a program. -CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/gmake - -//Flags used by the linker during the creation of modules. -CMAKE_MODULE_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_NM:FILEPATH=/usr/bin/nm - -//Path to a program. -CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy - -//Path to a program. -CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump - -//Value Computed by CMake -CMAKE_PROJECT_NAME:STATIC=Project - -//Path to a program. -CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib - -//Flags used by the linker during the creation of dll's. -CMAKE_SHARED_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//If set, runtime paths are not added when installing shared libraries, -// but are added when building. -CMAKE_SKIP_INSTALL_RPATH:BOOL=NO - -//If set, runtime paths are not added when using shared libraries. -CMAKE_SKIP_RPATH:BOOL=NO - -//Flags used by the linker during the creation of static libraries. -CMAKE_STATIC_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_STRIP:FILEPATH=/usr/bin/strip - -//If true, cmake will use relative paths in makefiles and projects. -CMAKE_USE_RELATIVE_PATHS:BOOL=OFF - -//If this value is on, makefiles will be generated without the -// .SILENT directive, and all commands will be echoed to the console -// during the make. This is useful for debugging only. With Visual -// Studio IDE projects all commands are done without /nologo. -CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE - -//Single output directory for building all executables. -EXECUTABLE_OUTPUT_PATH:PATH= - -//The directory containing a CMake configuration file for Emscripten. -Emscripten_DIR:PATH=Emscripten_DIR-NOTFOUND - -//Single output directory for building all libraries. -LIBRARY_OUTPUT_PATH:PATH= - -//Value Computed by CMake -Project_BINARY_DIR:STATIC=/home/aconway/proton/proton-c/bindings/cpp - -//Value Computed by CMake -Project_SOURCE_DIR:STATIC=/home/aconway/proton/proton-c/bindings - -//Dependencies for the target -qpid-proton-cpp_LIB_DEPENDS:STATIC=general;qpid-proton; - - -######################## -# INTERNAL cache entries -######################## - -//ADVANCED property for variable: CMAKE_AR -CMAKE_AR-ADVANCED:INTERNAL=1 -//This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/home/aconway/proton/proton-c/bindings/cpp -//Major version of cmake used to create the current loaded cache -CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 -//Minor version of cmake used to create the current loaded cache -CMAKE_CACHE_MINOR_VERSION:INTERNAL=2 -//Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=2 -//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE -CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 -//Path to CMake executable. -CMAKE_COMMAND:INTERNAL=/usr/bin/cmake -//Path to cpack program executable. -CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack -//Path to ctest program executable. -CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest -//ADVANCED property for variable: CMAKE_CXX_COMPILER -CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS -CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG -CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL -CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE -CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO -CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER -CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS -CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG -CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL -CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE -CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO -CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//Path to cache edit program executable. -CMAKE_EDIT_COMMAND:INTERNAL=/usr/bin/ccmake -//Executable file format -CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS -CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG -CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE -CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS -CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 -//Name of external makefile project generator. -CMAKE_EXTRA_GENERATOR:INTERNAL= -//Name of generator. -CMAKE_GENERATOR:INTERNAL=Unix Makefiles -//Name of generator platform. -CMAKE_GENERATOR_PLATFORM:INTERNAL= -//Name of generator toolset. -CMAKE_GENERATOR_TOOLSET:INTERNAL= -//Start directory with the top level CMakeLists.txt file for this -// project -CMAKE_HOME_DIRECTORY:INTERNAL=/home/aconway/proton/proton-c/bindings -//Install .so files without execute permission. -CMAKE_INSTALL_SO_NO_EXE:INTERNAL=0 -//ADVANCED property for variable: CMAKE_LINKER -CMAKE_LINKER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MAKE_PROGRAM -CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS -CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG -CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE -CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_NM -CMAKE_NM-ADVANCED:INTERNAL=1 -//number of local generators -CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=2 -//ADVANCED property for variable: CMAKE_OBJCOPY -CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJDUMP -CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_RANLIB -CMAKE_RANLIB-ADVANCED:INTERNAL=1 -//Path to CMake installation. -CMAKE_ROOT:INTERNAL=/usr/share/cmake -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS -CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG -CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE -CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH -CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_RPATH -CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS -CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG -CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE -CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STRIP -CMAKE_STRIP-ADVANCED:INTERNAL=1 -//uname command -CMAKE_UNAME:INTERNAL=/usr/bin/uname -//ADVANCED property for variable: CMAKE_USE_RELATIVE_PATHS -CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE -CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 -//Result of TRY_COMPILE -RESULT:INTERNAL=TRUE http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/proton-c/bindings/cpp/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/CMakeLists.txt b/proton-c/bindings/cpp/CMakeLists.txt index 462e2bf..c1f286d 100644 --- a/proton-c/bindings/cpp/CMakeLists.txt +++ b/proton-c/bindings/cpp/CMakeLists.txt @@ -39,42 +39,42 @@ include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/src") set(qpid-proton-cpp-source - src/Acceptor.cpp - src/Acking.cpp - src/Connection.cpp - src/ConnectionImpl.cpp - src/Connector.cpp - src/Container.cpp - src/ContainerImpl.cpp - src/Data.cpp - src/Decoder.cpp - src/Delivery.cpp - src/Duration.cpp - src/Encoder.cpp - src/Endpoint.cpp - src/Error.cpp - src/Event.cpp - src/Handler.cpp - src/Link.cpp - src/Message.cpp - src/MessagingAdapter.cpp - src/MessagingEvent.cpp - src/MessagingHandler.cpp - src/ProtonEvent.cpp - src/ProtonHandler.cpp - src/Receiver.cpp - src/Sender.cpp - src/Session.cpp - src/Terminus.cpp - src/Transport.cpp - src/Url.cpp - src/Value.cpp - src/Values.cpp + src/acceptor.cpp + src/acking.cpp + src/connection.cpp + src/connection_impl.cpp + src/connector.cpp + src/container.cpp + src/container_impl.cpp + src/data.cpp + src/decoder.cpp + src/delivery.cpp + src/duration.cpp + src/encoder.cpp + src/endpoint.cpp + src/error.cpp + src/event.cpp + src/handler.cpp + src/link.cpp + src/message.cpp + src/messaging_adapter.cpp + src/messaging_event.cpp + src/messaging_handler.cpp + src/proton_event.cpp + src/proton_handler.cpp + src/receiver.cpp + src/sender.cpp + src/session.cpp + src/terminus.cpp + src/transport.cpp + src/url.cpp + src/value.cpp + src/values.cpp src/proton_bits.cpp - src/BlockingConnection.cpp - src/BlockingConnectionImpl.cpp - src/BlockingLink.cpp - src/BlockingSender.cpp + src/blocking_connection.cpp + src/blocking_connection_impl.cpp + src/blocking_link.cpp + src/blocking_sender.cpp src/contexts.cpp src/types.cpp ) http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/proton-c/bindings/cpp/include/proton/Acceptor.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/Acceptor.hpp b/proton-c/bindings/cpp/include/proton/Acceptor.hpp deleted file mode 100644 index 5702c10..0000000 --- a/proton-c/bindings/cpp/include/proton/Acceptor.hpp +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef PROTON_CPP_ACCEPTOR_H -#define PROTON_CPP_ACCEPTOR_H - -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -#include "proton/reactor.h" -#include "proton/export.hpp" -#include "proton/ProtonHandle.hpp" - -struct pn_connection_t; - -namespace proton { -namespace reactor { - -class Acceptor : public ProtonHandle<pn_acceptor_t> -{ - public: - PN_CPP_EXTERN Acceptor(); - PN_CPP_EXTERN Acceptor(pn_acceptor_t *); - PN_CPP_EXTERN Acceptor(const Acceptor&); - PN_CPP_EXTERN Acceptor& operator=(const Acceptor&); - PN_CPP_EXTERN ~Acceptor(); - - PN_CPP_EXTERN void close(); - private: - friend class ProtonImplRef<Acceptor>; -}; - -}} - -#endif /*!PROTON_CPP_ACCEPTOR_H*/ http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/proton-c/bindings/cpp/include/proton/Acking.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/Acking.hpp b/proton-c/bindings/cpp/include/proton/Acking.hpp deleted file mode 100644 index 327f1a1..0000000 --- a/proton-c/bindings/cpp/include/proton/Acking.hpp +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef PROTON_CPP_ACKING_H -#define PROTON_CPP_ACKING_H - -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -#include "proton/export.hpp" -#include "proton/Delivery.hpp" - -namespace proton { -namespace reactor { - - -class Acking -{ - public: - PN_CPP_EXTERN virtual void accept(Delivery &d); - PN_CPP_EXTERN virtual void reject(Delivery &d); - PN_CPP_EXTERN virtual void release(Delivery &d, bool delivered=true); - PN_CPP_EXTERN virtual void settle(Delivery &d, Delivery::state s = Delivery::REJECTED); -}; - - -}} - -#endif /*!PROTON_CPP_ACKING_H*/ http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/proton-c/bindings/cpp/include/proton/BlockingConnection.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/BlockingConnection.hpp b/proton-c/bindings/cpp/include/proton/BlockingConnection.hpp deleted file mode 100644 index 5b01136..0000000 --- a/proton-c/bindings/cpp/include/proton/BlockingConnection.hpp +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef PROTON_CPP_BLOCKINGCONNECTION_H -#define PROTON_CPP_BLOCKINGCONNECTION_H - -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -#include "proton/export.hpp" -#include "proton/Handle.hpp" -#include "proton/Endpoint.hpp" -#include "proton/Container.hpp" -#include "proton/Duration.hpp" -#include "proton/MessagingHandler.hpp" -#include "proton/types.h" -#include <string> - -struct pn_connection_t; - -namespace proton { -namespace reactor { - -class Container; -class BlockingConnectionImpl; -class SslDomain; -class BlockingSender; -class WaitCondition; - -class BlockingConnection : public Handle<BlockingConnectionImpl> -{ - public: - PN_CPP_EXTERN BlockingConnection(); - PN_CPP_EXTERN BlockingConnection(const BlockingConnection& c); - PN_CPP_EXTERN BlockingConnection& operator=(const BlockingConnection& c); - PN_CPP_EXTERN ~BlockingConnection(); - - PN_CPP_EXTERN BlockingConnection(std::string &url, Duration = Duration::FOREVER, - SslDomain *ssld=0, Container *c=0); - PN_CPP_EXTERN void close(); - - PN_CPP_EXTERN BlockingSender createSender(std::string &address, Handler *h=0); - PN_CPP_EXTERN void wait(WaitCondition &condition); - PN_CPP_EXTERN void wait(WaitCondition &condition, std::string &msg, Duration timeout=Duration::FOREVER); - PN_CPP_EXTERN Duration getTimeout(); - private: - friend class PrivateImplRef<BlockingConnection>; -}; - -}} - -#endif /*!PROTON_CPP_BLOCKINGCONNECTION_H*/ http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/proton-c/bindings/cpp/include/proton/BlockingLink.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/BlockingLink.hpp b/proton-c/bindings/cpp/include/proton/BlockingLink.hpp deleted file mode 100644 index b1a5915..0000000 --- a/proton-c/bindings/cpp/include/proton/BlockingLink.hpp +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef PROTON_CPP_BLOCKINGLINK_H -#define PROTON_CPP_BLOCKINGLINK_H - -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -#include "proton/export.hpp" -#include "proton/Handle.hpp" -#include "proton/Endpoint.hpp" -#include "proton/Container.hpp" -#include "proton/Duration.hpp" -#include "proton/MessagingHandler.hpp" -#include "proton/BlockingConnection.hpp" -#include "proton/types.h" -#include <string> - -namespace proton { -namespace reactor { - -class BlockingConnection; - -class BlockingLink -{ - public: - PN_CPP_EXTERN void close(); - PN_CPP_EXTERN ~BlockingLink(); - protected: - PN_CPP_EXTERN BlockingLink(BlockingConnection *c, pn_link_t *l); - PN_CPP_EXTERN void waitForClosed(Duration timeout=Duration::SECOND); - private: - BlockingConnection connection; - Link link; - PN_CPP_EXTERN void checkClosed(); - friend class BlockingConnection; - friend class BlockingSender; - friend class BlockingReceiver; -}; - -}} - -#endif /*!PROTON_CPP_BLOCKINGLINK_H*/ http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/proton-c/bindings/cpp/include/proton/BlockingSender.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/BlockingSender.hpp b/proton-c/bindings/cpp/include/proton/BlockingSender.hpp deleted file mode 100644 index 5d95df5..0000000 --- a/proton-c/bindings/cpp/include/proton/BlockingSender.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef PROTON_CPP_BLOCKINGSENDER_H -#define PROTON_CPP_BLOCKINGSENDER_H - -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -#include "proton/export.hpp" -#include "proton/Handle.hpp" -#include "proton/Endpoint.hpp" -#include "proton/Container.hpp" -#include "proton/Duration.hpp" -#include "proton/MessagingHandler.hpp" -#include "proton/BlockingLink.hpp" -#include "proton/types.h" -#include "proton/delivery.h" -#include <string> - -namespace proton { -namespace reactor { - -class BlockingConnection; -class BlockingLink; - -class BlockingSender : public BlockingLink -{ - public: - PN_CPP_EXTERN Delivery send(Message &msg); - PN_CPP_EXTERN Delivery send(Message &msg, Duration timeout); - private: - PN_CPP_EXTERN BlockingSender(BlockingConnection &c, Sender &l); - friend class BlockingConnection; -}; - -}} - -#endif /*!PROTON_CPP_BLOCKINGSENDER_H*/ http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/proton-c/bindings/cpp/include/proton/Connection.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/Connection.hpp b/proton-c/bindings/cpp/include/proton/Connection.hpp deleted file mode 100644 index c16556b..0000000 --- a/proton-c/bindings/cpp/include/proton/Connection.hpp +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef PROTON_CPP_CONNECTION_H -#define PROTON_CPP_CONNECTION_H - -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -#include "proton/export.hpp" -#include "proton/Handle.hpp" -#include "proton/Endpoint.hpp" -#include "proton/Container.hpp" -#include "proton/types.h" -#include <string> - -struct pn_connection_t; - -namespace proton { -namespace reactor { - -class Handler; -class Transport; -class Container; -class ConnectionImpl; - -class Connection : public Endpoint, public Handle<ConnectionImpl> -{ - public: - PN_CPP_EXTERN Connection(); - PN_CPP_EXTERN Connection(ConnectionImpl *); - PN_CPP_EXTERN Connection(const Connection& c); - PN_CPP_EXTERN Connection& operator=(const Connection& c); - PN_CPP_EXTERN ~Connection(); - - PN_CPP_EXTERN Connection(Container &c, Handler *h = 0); - PN_CPP_EXTERN Transport &getTransport(); - PN_CPP_EXTERN Handler *getOverride(); - PN_CPP_EXTERN void setOverride(Handler *h); - PN_CPP_EXTERN void open(); - PN_CPP_EXTERN void close(); - PN_CPP_EXTERN pn_connection_t *getPnConnection(); - PN_CPP_EXTERN Container &getContainer(); - PN_CPP_EXTERN std::string getHostname(); - virtual PN_CPP_EXTERN Connection &getConnection(); - PN_CPP_EXTERN Link getLinkHead(Endpoint::State mask); - private: - friend class PrivateImplRef<Connection>; - friend class Connector; - friend class ConnectionImpl; -}; - -}} - -#endif /*!PROTON_CPP_CONNECTION_H*/ http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/proton-c/bindings/cpp/include/proton/Container.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/Container.hpp b/proton-c/bindings/cpp/include/proton/Container.hpp deleted file mode 100644 index c1ecb65..0000000 --- a/proton-c/bindings/cpp/include/proton/Container.hpp +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef PROTON_CPP_CONTAINER_H -#define PROTON_CPP_CONTAINER_H - -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -#include "proton/export.hpp" -#include "proton/Handle.hpp" -#include "proton/Acceptor.hpp" -#include "proton/Duration.hpp" -#include <proton/reactor.h> -#include <string> - -namespace proton { -namespace reactor { - -class DispatchHelper; -class Connection; -class Connector; -class Acceptor; -class ContainerImpl; -class MessagingHandler; -class Sender; -class Receiver; -class Link; - class Handler; - -class Container : public Handle<ContainerImpl> -{ - public: - PN_CPP_EXTERN Container(ContainerImpl *); - PN_CPP_EXTERN Container(const Container& c); - PN_CPP_EXTERN Container& operator=(const Container& c); - PN_CPP_EXTERN ~Container(); - - PN_CPP_EXTERN Container(); - PN_CPP_EXTERN Container(MessagingHandler &mhandler); - PN_CPP_EXTERN Connection connect(std::string &host, Handler *h=0); - PN_CPP_EXTERN void run(); - PN_CPP_EXTERN void start(); - PN_CPP_EXTERN bool process(); - PN_CPP_EXTERN void stop(); - PN_CPP_EXTERN void wakeup(); - PN_CPP_EXTERN bool isQuiesced(); - PN_CPP_EXTERN pn_reactor_t *getReactor(); - PN_CPP_EXTERN Sender createSender(Connection &connection, std::string &addr, Handler *h=0); - PN_CPP_EXTERN Sender createSender(std::string &url); - PN_CPP_EXTERN Receiver createReceiver(Connection &connection, std::string &addr); - PN_CPP_EXTERN Receiver createReceiver(const std::string &url); - PN_CPP_EXTERN Acceptor listen(const std::string &url); - PN_CPP_EXTERN std::string getContainerId(); - PN_CPP_EXTERN Duration getTimeout(); - PN_CPP_EXTERN void setTimeout(Duration timeout); - private: - friend class PrivateImplRef<Container>; -}; - -}} - -#endif /*!PROTON_CPP_CONTAINER_H*/ http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69783099/proton-c/bindings/cpp/include/proton/Data.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/Data.hpp b/proton-c/bindings/cpp/include/proton/Data.hpp deleted file mode 100644 index 77df52f..0000000 --- a/proton-c/bindings/cpp/include/proton/Data.hpp +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef DATA_H -#define DATA_H -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#include "proton/export.hpp" -#include <iosfwd> - -/**@file - * Base for classes that hold AMQP data. - * @internal - */ -struct pn_data_t; - -namespace proton { - -/** Base for classes that hold AMQP data. */ -class Data { - public: - PN_CPP_EXTERN explicit Data(); - PN_CPP_EXTERN Data(const Data&); - PN_CPP_EXTERN virtual ~Data(); - PN_CPP_EXTERN Data& operator=(const Data&); - - /** Clear the data. */ - PN_CPP_EXTERN void clear(); - - /** True if there are no values. */ - PN_CPP_EXTERN bool empty() const; - - /** The underlying pn_data_t */ - PN_CPP_EXTERN pn_data_t* pnData() { return data; } - - /** True if this Data object owns it's own pn_data_t, false if it is acting as a "view" */ - PN_CPP_EXTERN bool own() const { return own_; } - - PN_CPP_EXTERN void swap(Data&); - - /** Human readable representation of data. */ - friend PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const Data&); - - protected: - /** Does not take ownership, just a view on the data */ - PN_CPP_EXTERN explicit Data(pn_data_t*); - - /** Does not take ownership, just a view on the data */ - PN_CPP_EXTERN void view(pn_data_t*); - - mutable pn_data_t* data; - bool own_; -}; - - -} -#endif // DATA_H --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
