Repository: qpid-proton Updated Branches: refs/heads/master 8293164d8 -> 13150e493
PROTON-1083: Make proton::event a pure abstract class (interface) Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/958d0095 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/958d0095 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/958d0095 Branch: refs/heads/master Commit: 958d009599f13f2aa79d9bfc6baa6964fb3e6967 Parents: 8293164 Author: Andrew Stitcher <[email protected]> Authored: Wed Feb 10 17:13:08 2016 -0500 Committer: Andrew Stitcher <[email protected]> Committed: Mon Feb 15 12:05:07 2016 -0500 ---------------------------------------------------------------------- proton-c/bindings/cpp/CMakeLists.txt | 1 - proton-c/bindings/cpp/include/proton/event.hpp | 27 +++---- proton-c/bindings/cpp/src/event.cpp | 78 --------------------- 3 files changed, 10 insertions(+), 96 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/958d0095/proton-c/bindings/cpp/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/CMakeLists.txt b/proton-c/bindings/cpp/CMakeLists.txt index 15b760e..4ad015a 100644 --- a/proton-c/bindings/cpp/CMakeLists.txt +++ b/proton-c/bindings/cpp/CMakeLists.txt @@ -42,7 +42,6 @@ set(qpid-proton-cpp-source src/endpoint.cpp src/connection_engine.cpp src/error.cpp - src/event.cpp src/id_generator.cpp src/link.cpp src/link_options.cpp http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/958d0095/proton-c/bindings/cpp/include/proton/event.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/event.hpp b/proton-c/bindings/cpp/include/proton/event.hpp index 844fcab..05d6cc0 100644 --- a/proton-c/bindings/cpp/include/proton/event.hpp +++ b/proton-c/bindings/cpp/include/proton/event.hpp @@ -40,7 +40,7 @@ class connection; /// @see proton::handler class event { public: - virtual PN_CPP_EXTERN ~event(); + virtual PN_CPP_EXTERN ~event() {} /// Return the name of the event type. virtual PN_CPP_EXTERN std::string name() const = 0; @@ -49,46 +49,39 @@ class event { /// /// @throw proton::error if this event was not generated by a /// container - virtual PN_CPP_EXTERN class container& container() const; + virtual PN_CPP_EXTERN class container& container() const = 0; /// Get transport - virtual PN_CPP_EXTERN class transport transport() const; + virtual PN_CPP_EXTERN class transport transport() const = 0; /// Get connection. - virtual PN_CPP_EXTERN class connection connection() const; + virtual PN_CPP_EXTERN class connection connection() const = 0; /// Get session. - virtual PN_CPP_EXTERN class session session() const; + virtual PN_CPP_EXTERN class session session() const = 0; /// Get sender. /// /// @throw proton::error if no sender - virtual PN_CPP_EXTERN class sender sender() const; + virtual PN_CPP_EXTERN class sender sender() const = 0; /// Get receiver. /// /// @throw proton::error if no receiver - virtual PN_CPP_EXTERN class receiver receiver() const; + virtual PN_CPP_EXTERN class receiver receiver() const = 0; /// Get link. /// /// @throw proton::error if no link - virtual PN_CPP_EXTERN class link link() const; + virtual PN_CPP_EXTERN class link link() const = 0; /// Get delivery. /// /// @throw proton::error if no delivery - virtual PN_CPP_EXTERN class delivery delivery() const; + virtual PN_CPP_EXTERN class delivery delivery() const = 0; /// Get message. /// /// @throw proton::error if no message - virtual PN_CPP_EXTERN class message &message() const; - - protected: - PN_CPP_EXTERN event(); - - private: - event(const event&); - event& operator=(const event&); + virtual PN_CPP_EXTERN class message &message() const = 0; }; } http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/958d0095/proton-c/bindings/cpp/src/event.cpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/src/event.cpp b/proton-c/bindings/cpp/src/event.cpp deleted file mode 100644 index ebd3434..0000000 --- a/proton-c/bindings/cpp/src/event.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * - * 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/event.h" - -#include "proton/delivery.hpp" -#include "proton/error.hpp" -#include "proton/event.hpp" -#include "proton/receiver.hpp" -#include "proton/sender.hpp" -#include "proton/transport.hpp" - -#include "msg.hpp" -#include "contexts.hpp" - -namespace proton { - -event::event() {} - -event::~event() {} - -container& event::container() const { - // Subclasses to override as appropriate - throw error(MSG("No container context for event")); -} - -transport event::transport() const { - throw error(MSG("No transport context for event")); -} - -connection event::connection() const { - throw error(MSG("No connection context for event")); -} - -session event::session() const { - throw error(MSG("No session context for event")); -} - -sender event::sender() const { - throw error(MSG("No sender context for event")); -} - -receiver event::receiver() const { - throw error(MSG("No receiver context for event")); -} - -link event::link() const { - throw error(MSG("No link context for event")); -} - -delivery event::delivery() const { - throw error(MSG("No link context for event")); -} - -class message &event::message() const { - throw error(MSG("No message associated with event")); -} - -} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
