diff options
author | Alan Conway <aconway@apache.org> | 2006-11-09 21:55:34 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2006-11-09 21:55:34 +0000 |
commit | 402ac40145f2d35f9f9bfd34d499336faeb65c2e (patch) | |
tree | 49084b4dcb4ba2a1b7c846dc90e997ac6582656f | |
parent | 75e9bad6c3eb3a7bb207a10ec6719e859170396b (diff) | |
download | qpid-python-402ac40145f2d35f9f9bfd34d499336faeb65c2e.tar.gz |
Added POSIX equivalents to APR classes used by clients, inlined trivial calls.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@473087 13f79535-47bb-0310-9956-ffa450edef68
161 files changed, 1171 insertions, 839 deletions
diff --git a/qpid/cpp/Makefile b/qpid/cpp/Makefile index ab542f7086..7cfa29c409 100644 --- a/qpid/cpp/Makefile +++ b/qpid/cpp/Makefile @@ -51,26 +51,30 @@ $(BUILDDIRS): ## Library rules -LIB_common := $(call LIBFILE,common,1.0) -$(LIB_common): $(call OBJECTS,qpid qpid/framing qpid/sys qpid/$(PLATFORM)) +LIB_common := $(call LIBFILE,common,1.0) +DIRS_common := qpid qpid/framing qpid/sys qpid/$(PLATFORM) +$(LIB_common): $(call OBJECTS, $(DIRS_common)) $(LIB_COMMAND) -LIB_client :=$(call LIBFILE,client,1.0) -$(LIB_client): $(call OBJECTS,qpid/client) $(LIB_common) +LIB_client := $(call LIBFILE,client,1.0) +DIRS_client := qpid/client +$(LIB_client): $(call OBJECTS,$(DIRS_client)) $(LIB_common) $(LIB_COMMAND) -LIB_broker :=$(call LIBFILE,broker,1.0) -$(LIB_broker): $(call OBJECTS,qpid/broker) $(LIB_common) +LIB_broker := $(call LIBFILE,broker,1.0) +DIRS_broker := qpid/broker +$(LIB_broker): $(call OBJECTS,$(DIRS_broker)) $(LIB_common) $(LIB_COMMAND) ## Daemon executable $(BINDIR)/qpidd: $(OBJDIR)/qpidd.o $(LIB_common) $(LIB_broker) mkdir -p $(dir $@) - $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) -lapr-1 $^ + $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $^ all-nogen: $(BINDIR)/qpidd ## Unit tests. UNITTEST_SRC:=$(shell find test/unit -name *Test.cpp) +UNITTEST_SRC:=$(filter-out test/unit/qpid/$(IGNORE)/%,$(UNITTEST_SRC)) UNITTESTS:=$(UNITTEST_SRC:test/unit/%.cpp=$(TESTDIR)/%.so) unittest: all @@ -100,7 +104,7 @@ endef $(foreach dir,$(SRCDIRS),$(eval $(call CPPRULE,$(dir)))) # Unit test plugin libraries. -$(TESTDIR)/%Test.so: test/unit/%Test.cpp $(LIB_common) $(LIB_client) +$(TESTDIR)/%Test.so: test/unit/%Test.cpp $(LIB_common) $(LIB_broker) mkdir -p $(dir $@) $(CXX) -shared -o $@ $< $(CXXFLAGS) -Itest/include $(LDFLAGS) -lcppunit $(LIB_common) $(LIB_broker) @@ -111,6 +115,7 @@ $(TESTDIR)/%: test/client/%.cpp $(LIB_common) $(LIB_client) CLIENT_TEST_SRC := $(wildcard test/client/*.cpp) CLIENT_TEST_EXE := $(CLIENT_TEST_SRC:test/client/%.cpp=$(TESTDIR)/%) all-nogen: $(CLIENT_TEST_EXE) +client: $(CLIENT_TEST_EXE) ## include dependencies DEPFILES:=$(wildcard $(OBJDIR)/*.d $(OBJDIR)/*/*.d $(OBJDIR)/*/*/*.d) diff --git a/qpid/cpp/README b/qpid/cpp/README index 2653873b1a..7d394bf511 100644 --- a/qpid/cpp/README +++ b/qpid/cpp/README @@ -20,13 +20,11 @@ If you use yum to install packages: You can have mutltiple builds in the same working copy. For example for a release build using APR platform: - make PLATFORM=apr TYPE=release + make USE_APR=1 RELEASE=1 This will create build/apr-release containing the bin/ lib/ and test/ subdirs. -To set your preferred default create file options-local.mk with -PLATFORM=<my platform> -TYPE=<my type> +You can set your preferred defaults in options-local.mk. Generated code goes in build/gen and is shared between all builds. @@ -51,9 +49,9 @@ Main targets: The source tree is structured as follows: * src/ - .h and .cpp source files, directories mirror namespaces. * qpid/ - * sys/ - system abstractions: threading, IO. + * sys/ - system portability abstractions: threading, io etc. * posix/ - posix implementations for sys - * apr/ - portable APR implementation for sys (client side) + * apr/ - portable APR implementation for sys * framing - encoding/decoding AMQP messages * client - client classes. * broker - broker classes. diff --git a/qpid/cpp/options.mk b/qpid/cpp/options.mk index 59933fafd0..51dca456e9 100644 --- a/qpid/cpp/options.mk +++ b/qpid/cpp/options.mk @@ -1,39 +1,49 @@ - # - # Copyright (c) 2006 The Apache Software Foundation - # - # Licensed 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. - # - -## Build platform and type defaults -TYPE := debug -PLATFORM := apr - -# Local options, may override PLATFORM and/or TYPE +# +# Copyright (c) 2006 The Apache Software Foundation +# +# Licensed 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. +# + +# Use APR by default till Posix is complete. +USE_APR := 1 + +# Local options. -include options-local.mk -## Platform specific options - -# apr: Apache Portable Runtime. -CXXFLAGS_apr := -I/usr/local/apr/include -LDFLAGS_apr := -L/usr/local/apr/lib -lapr-1 +## Release vs. debug build. +ifdef RELEASE +BUILD := release +CXXFLAGS := $(CXXFLAGS) -O3 -DNDEBUG +else +BUILD := debug +CXXFLAGS := $(CXXFLAGS) -ggdb3 +endif -# posix: Native posix implementation -CXXFLAGS_posix := -LDFLAGS_posix := +## Platform specific options +ifdef USE_APR +PLATFORM := apr +IGNORE := posix +CXXFLAGS := $(CXXFLAGS) -DUSE_APR -I/usr/local/apr/include +LDFLAGS := $(LDFLAGS) -L/usr/local/apr/lib -lapr-1 +else +PLATFORM := posix +IGNORE := apr +LDFLAGS := $(LDFLAGS) -lpthread -lrt +endif ## Build directories. -BUILD=$(PLATFORM)-$(TYPE) +BUILD :=$(PLATFORM)-$(BUILD) GENDIR:=build/gen BINDIR:=build/$(BUILD)/bin LIBDIR:=build/$(BUILD)/lib @@ -51,23 +61,19 @@ EXTRA_LIBDIRS := ## Compile flags -# Release vs. debug flags. -CXXFLAGS_debug := -ggdb3 -CXXFLAGS_release := -O3 -DNDEBUG - # Warnings: Enable as many as possible, keep the code clean. Please # do not disable warnings or remove -Werror without discussing on # qpid-dev list. # # The following warnings deliberately omitted, they warn on valid code. -# -Wno-unreachable-code -Wpadded -Winline +# -Wunreachable-code -Wpadded -Winline +# -Wshadow - warns about boost headers. # -WARN := -Werror -pedantic -Wall -Wextra -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wvolatile-register-var -Winvalid-pch +WARN := -Werror -pedantic -Wall -Wextra -Wno-shadow -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wvolatile-register-var -Winvalid-pch -Wno-system-headers -INCLUDES := $(SRCDIRS:%=-I%) $(EXTRA_INCLUDES) -DEFINES := -DPLATFORM=$(PLATFORM) -LDFLAGS := -L$(LIBDIR) $(LDFLAGS_$(PLATFORM)) -CXXFLAGS := $(DEFINES) $(WARN) -MMD -fpic $(INCLUDES) $(CXXFLAGS_$(PLATFORM)) $(CXXFLAGS_$(TYPE)) +INCLUDES := $(SRCDIRS:%=-I%) $(EXTRA_INCLUDES) +LDFLAGS := $(LDFLAGS) -L$(LIBDIR) +CXXFLAGS := $(CXXFLAGS) $(WARN) -MMD -fpic $(INCLUDES) ## Macros for linking, must be late evaluated diff --git a/qpid/cpp/src/qpid/Exception.cpp b/qpid/cpp/src/qpid/Exception.cpp index f89972f02b..06f05591fa 100644 --- a/qpid/cpp/src/qpid/Exception.cpp +++ b/qpid/cpp/src/qpid/Exception.cpp @@ -16,6 +16,6 @@ * */ -#include "qpid/Exception.h" +#include <qpid/Exception.h> qpid::Exception::~Exception() throw() {} diff --git a/qpid/cpp/src/qpid/QpidError.cpp b/qpid/cpp/src/qpid/QpidError.cpp index c1d33c9583..9bba5a7010 100644 --- a/qpid/cpp/src/qpid/QpidError.cpp +++ b/qpid/cpp/src/qpid/QpidError.cpp @@ -16,7 +16,7 @@ * */ -#include "qpid/QpidError.h" +#include <qpid/QpidError.h> #include <sstream> using namespace qpid; diff --git a/qpid/cpp/src/qpid/QpidError.h b/qpid/cpp/src/qpid/QpidError.h index 98a2efff15..c57256e01c 100644 --- a/qpid/cpp/src/qpid/QpidError.h +++ b/qpid/cpp/src/qpid/QpidError.h @@ -18,7 +18,7 @@ * */ #include <string> -#include "qpid/Exception.h" +#include <qpid/Exception.h> namespace qpid { diff --git a/qpid/cpp/src/qpid/apr/Acceptor.cpp b/qpid/cpp/src/qpid/apr/APRAcceptor.cpp index cbeea9902b..3aa4e6ede7 100644 --- a/qpid/cpp/src/qpid/apr/Acceptor.cpp +++ b/qpid/cpp/src/qpid/apr/APRAcceptor.cpp @@ -15,13 +15,40 @@ * limitations under the License. * */ -#include "Acceptor.h" +#include <qpid/sys/Acceptor.h> +#include <qpid/sys/SessionHandlerFactory.h> +#include "LFProcessor.h" +#include "LFSessionContext.h" #include "APRBase.h" #include "APRPool.h" -using namespace qpid::sys; +namespace qpid { +namespace sys { -Acceptor::Acceptor(int16_t port_, int backlog, int threads) : +class APRAcceptor : public Acceptor +{ + public: + APRAcceptor(int16_t port, int backlog, int threads); + virtual int16_t getPort() const; + virtual void run(qpid::sys::SessionHandlerFactory* factory); + virtual void shutdown(); + + private: + int16_t port; + LFProcessor processor; + apr_socket_t* socket; + volatile bool running; +}; + +// Define generic Acceptor::create() to return APRAcceptor. +Acceptor::shared_ptr Acceptor::create(int16_t port, int backlog, int threads) +{ + return Acceptor::shared_ptr(new APRAcceptor(port, backlog, threads)); +} +// Must define Acceptor virtual dtor. +Acceptor::~Acceptor() {} + +APRAcceptor::APRAcceptor(int16_t port_, int backlog, int threads) : port(port_), processor(APRPool::get(), threads, 1000, 5000000) { @@ -33,13 +60,13 @@ Acceptor::Acceptor(int16_t port_, int backlog, int threads) : CHECK_APR_SUCCESS(apr_socket_listen(socket, backlog)); } -int16_t Acceptor::getPort() const { +int16_t APRAcceptor::getPort() const { apr_sockaddr_t* address; CHECK_APR_SUCCESS(apr_socket_addr_get(&address, APR_LOCAL, socket)); return address->port; } -void Acceptor::run(SessionHandlerFactory* factory) { +void APRAcceptor::run(SessionHandlerFactory* factory) { running = true; processor.start(); std::cout << "Listening on port " << getPort() << "..." << std::endl; @@ -65,7 +92,7 @@ void Acceptor::run(SessionHandlerFactory* factory) { shutdown(); } -void Acceptor::shutdown() { +void APRAcceptor::shutdown() { // TODO aconway 2006-10-12: Cleanup, this is not thread safe. if (running) { running = false; @@ -75,3 +102,4 @@ void Acceptor::shutdown() { } +}} diff --git a/qpid/cpp/src/qpid/apr/APRBase.h b/qpid/cpp/src/qpid/apr/APRBase.h index b84e9860df..ee6ba51417 100644 --- a/qpid/cpp/src/qpid/apr/APRBase.h +++ b/qpid/cpp/src/qpid/apr/APRBase.h @@ -19,8 +19,8 @@ #define _APRBase_ #include <string> -#include "apr-1/apr_thread_mutex.h" -#include "apr-1/apr_errno.h" +#include <apr-1/apr_thread_mutex.h> +#include <apr-1/apr_errno.h> namespace qpid { namespace sys { diff --git a/qpid/cpp/src/qpid/apr/APRSocket.h b/qpid/cpp/src/qpid/apr/APRSocket.h index f7e7ad107b..28e0c7e6de 100644 --- a/qpid/cpp/src/qpid/apr/APRSocket.h +++ b/qpid/cpp/src/qpid/apr/APRSocket.h @@ -18,8 +18,8 @@ #ifndef _APRSocket_ #define _APRSocket_ -#include "apr-1/apr_network_io.h" -#include "qpid/framing/Buffer.h" +#include <apr-1/apr_network_io.h> +#include <qpid/framing/Buffer.h> namespace qpid { namespace sys { diff --git a/qpid/cpp/src/qpid/apr/Acceptor.h b/qpid/cpp/src/qpid/apr/Acceptor.h deleted file mode 100644 index 1813b391c1..0000000000 --- a/qpid/cpp/src/qpid/apr/Acceptor.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed 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. - * - */ -#ifndef _LFAcceptor_ -#define _LFAcceptor_ - -#include "LFProcessor.h" -#include "LFSessionContext.h" -#include "apr-1/apr_network_io.h" -#include "apr-1/apr_poll.h" -#include "apr-1/apr_time.h" -#include "Monitor.h" -#include "qpid/sys/Runnable.h" -#include "qpid/sys/SessionContext.h" -#include "qpid/sys/SessionHandlerFactory.h" -#include <qpid/SharedObject.h> - -namespace qpid { -namespace sys { - -/** APR Acceptor. */ -class Acceptor : public qpid::SharedObject<Acceptor> -{ - public: - Acceptor(int16_t port, int backlog, int threads); - virtual int16_t getPort() const; - virtual void run(qpid::sys::SessionHandlerFactory* factory); - virtual void shutdown(); - - private: - int16_t port; - LFProcessor processor; - apr_socket_t* socket; - volatile bool running; -}; - -} -} - - -#endif diff --git a/qpid/cpp/src/qpid/apr/LFProcessor.h b/qpid/cpp/src/qpid/apr/LFProcessor.h index dd85ad9e84..3eeecc7325 100644 --- a/qpid/cpp/src/qpid/apr/LFProcessor.h +++ b/qpid/cpp/src/qpid/apr/LFProcessor.h @@ -18,12 +18,12 @@ #ifndef _LFProcessor_ #define _LFProcessor_ -#include "apr-1/apr_poll.h" +#include <apr-1/apr_poll.h> #include <iostream> #include <vector> #include <qpid/sys/Monitor.h> -#include "qpid/sys/Runnable.h" -#include "qpid/sys/Thread.h" +#include <qpid/sys/Runnable.h> +#include <qpid/sys/Thread.h> namespace qpid { namespace sys { diff --git a/qpid/cpp/src/qpid/apr/LFSessionContext.cpp b/qpid/cpp/src/qpid/apr/LFSessionContext.cpp index 4a704013a8..ebb1fc9fb2 100644 --- a/qpid/cpp/src/qpid/apr/LFSessionContext.cpp +++ b/qpid/cpp/src/qpid/apr/LFSessionContext.cpp @@ -17,7 +17,7 @@ */ #include "LFSessionContext.h" #include "APRBase.h" -#include "qpid/QpidError.h" +#include <qpid/QpidError.h> #include <assert.h> using namespace qpid::sys; diff --git a/qpid/cpp/src/qpid/apr/LFSessionContext.h b/qpid/cpp/src/qpid/apr/LFSessionContext.h index 9b3104b085..83387c934f 100644 --- a/qpid/cpp/src/qpid/apr/LFSessionContext.h +++ b/qpid/cpp/src/qpid/apr/LFSessionContext.h @@ -20,15 +20,15 @@ #include <queue> -#include "apr-1/apr_network_io.h" -#include "apr-1/apr_poll.h" -#include "apr-1/apr_time.h" +#include <apr-1/apr_network_io.h> +#include <apr-1/apr_poll.h> +#include <apr-1/apr_time.h> -#include "qpid/framing/AMQFrame.h" -#include "qpid/framing/Buffer.h" -#include "qpid/sys/Monitor.h" -#include "qpid/sys/SessionContext.h" -#include "qpid/sys/SessionHandler.h" +#include <qpid/framing/AMQFrame.h> +#include <qpid/framing/Buffer.h> +#include <qpid/sys/Monitor.h> +#include <qpid/sys/SessionContext.h> +#include <qpid/sys/SessionHandler.h> #include "APRSocket.h" #include "LFProcessor.h" diff --git a/qpid/cpp/src/qpid/apr/Monitor.h b/qpid/cpp/src/qpid/apr/Monitor.h deleted file mode 100644 index 10bc20820e..0000000000 --- a/qpid/cpp/src/qpid/apr/Monitor.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed 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. - * - */ -#ifndef _Monitor_ -#define _Monitor_ - -#include <boost/noncopyable.hpp> -#include <qpid/sys/Time.h> -#include "apr-1/apr_thread_mutex.h" -#include "apr-1/apr_thread_cond.h" -#include "APRBase.h" -#include "APRPool.h" - -namespace qpid { -namespace sys { - -template <class L> -class ScopedLock -{ - public: - ScopedLock(L& l) : mutex(l) { l.lock(); } - ~ScopedLock() { mutex.unlock(); } - private: - L& mutex; -}; - - -class Mutex : private boost::noncopyable -{ - public: - typedef ScopedLock<Mutex> ScopedLock; - - inline Mutex(); - inline ~Mutex(); - inline void lock(); - inline void unlock(); - inline void trylock(); - - protected: - apr_thread_mutex_t* mutex; -}; - -/** A condition variable and a mutex */ -class Monitor : public Mutex -{ - public: - inline Monitor(); - inline ~Monitor(); - inline void wait(); - inline void wait(int64_t nsecs); - inline void notify(); - inline void notifyAll(); - - private: - apr_thread_cond_t* condition; -}; - - - -Mutex::Mutex() { - CHECK_APR_SUCCESS(apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_NESTED, APRPool::get())); -} - -Mutex::~Mutex(){ - CHECK_APR_SUCCESS(apr_thread_mutex_destroy(mutex)); -} - -void Mutex::lock() { - CHECK_APR_SUCCESS(apr_thread_mutex_lock(mutex)); -} -void Mutex::unlock() { - CHECK_APR_SUCCESS(apr_thread_mutex_unlock(mutex)); -} - -void Mutex::trylock() { - CHECK_APR_SUCCESS(apr_thread_mutex_trylock(mutex)); -} - -Monitor::Monitor() { - CHECK_APR_SUCCESS(apr_thread_cond_create(&condition, APRPool::get())); -} - -Monitor::~Monitor() { - CHECK_APR_SUCCESS(apr_thread_cond_destroy(condition)); -} - -void Monitor::wait() { - CHECK_APR_SUCCESS(apr_thread_cond_wait(condition, mutex)); -} - -void Monitor::wait(int64_t nsecs){ - // APR uses microseconds. - apr_status_t status = apr_thread_cond_timedwait( - condition, mutex, nsecs/1000); - if(!status == APR_TIMEUP) CHECK_APR_SUCCESS(status); -} - -void Monitor::notify(){ - CHECK_APR_SUCCESS(apr_thread_cond_signal(condition)); -} - -void Monitor::notifyAll(){ - CHECK_APR_SUCCESS(apr_thread_cond_broadcast(condition)); -} - - -}} - - -#endif diff --git a/qpid/cpp/src/qpid/apr/Socket.h b/qpid/cpp/src/qpid/apr/Socket.cpp index 9a519e7391..b6cb63b215 100644 --- a/qpid/cpp/src/qpid/apr/Socket.h +++ b/qpid/cpp/src/qpid/apr/Socket.cpp @@ -1,6 +1,3 @@ -#ifndef _apr_Socket_h -#define _apr_Socket_h - /* * * Copyright (c) 2006 The Apache Software Foundation @@ -19,32 +16,14 @@ * */ -#include <apr-1/apr_network_io.h> -#include "APRBase.h" -#include "APRPool.h" - -namespace qpid { -namespace sys { - -class Socket -{ - public: - inline Socket(); - inline ~Socket(); - inline void setTimeout(long msecs); - inline void connect(const std::string& host, int port); - inline void close(); - enum { SOCKET_TIMEOUT=-2, SOCKET_EOF=-3 }; +#include <qpid/sys/Socket.h> +#include <qpid/apr/APRBase.h> +#include <qpid/apr/APRPool.h> - inline ssize_t send(const char* data, size_t size); - inline ssize_t recv(char* data, size_t size); - private: - apr_socket_t* socket; -}; +using namespace qpid::sys; -inline Socket::Socket() { CHECK_APR_SUCCESS( @@ -53,17 +32,12 @@ Socket::Socket() APRPool::get())); } -inline -Socket::~Socket() { } - -inline void -Socket::setTimeout(long msecs) +void Socket::setTimeout(long msecs) { apr_socket_timeout_set(socket, msecs*1000); } -inline void -Socket::connect(const std::string& host, int port) +void Socket::connect(const std::string& host, int port) { apr_sockaddr_t* address; CHECK_APR_SUCCESS( @@ -73,35 +47,30 @@ Socket::connect(const std::string& host, int port) CHECK_APR_SUCCESS(apr_socket_connect(socket, address)); } -inline void -Socket::close() +void Socket::close() { + if (socket == 0) return; CHECK_APR_SUCCESS(apr_socket_close(socket)); socket = 0; } -inline ssize_t -Socket::send(const char* data, size_t size) +ssize_t Socket::send(const char* data, size_t size) { apr_size_t sent = size; apr_status_t status = apr_socket_send(socket, data, &sent); - if (!APR_STATUS_IS_TIMEUP(status)) return SOCKET_TIMEOUT; - if (!APR_STATUS_IS_EOF(status)) return SOCKET_EOF; + if (APR_STATUS_IS_TIMEUP(status)) return SOCKET_TIMEOUT; + if (APR_STATUS_IS_EOF(status)) return SOCKET_EOF; CHECK_APR_SUCCESS(status); return sent; } -inline ssize_t -Socket::recv(char* data, size_t size) +ssize_t Socket::recv(char* data, size_t size) { apr_size_t received = size; apr_status_t status = apr_socket_recv(socket, data, &received); - if (!APR_STATUS_IS_TIMEUP(status)) return SOCKET_TIMEOUT; + if (APR_STATUS_IS_TIMEUP(status)) return SOCKET_TIMEOUT; CHECK_APR_SUCCESS(status); return received; } -}} - -#endif /*!_apr_Socket_h*/ diff --git a/qpid/cpp/src/qpid/apr/Thread.cpp b/qpid/cpp/src/qpid/apr/Thread.cpp index 6d5cadb009..b26583d4c5 100644 --- a/qpid/cpp/src/qpid/apr/Thread.cpp +++ b/qpid/cpp/src/qpid/apr/Thread.cpp @@ -16,40 +16,15 @@ * */ -#include "Thread.h" -#include "APRPool.h" -#include "APRBase.h" -#include <apr-1/apr_portable.h> +#include <qpid/sys/Thread.h> using namespace qpid::sys; using qpid::sys::Runnable; -namespace { -void* APR_THREAD_FUNC run(apr_thread_t* thread, void *data) { +void* APR_THREAD_FUNC Thread::runRunnable(apr_thread_t* thread, void *data) { reinterpret_cast<Runnable*>(data)->run(); CHECK_APR_SUCCESS(apr_thread_exit(thread, APR_SUCCESS)); return NULL; } -} -Thread::Thread() : thread(0) {} -Thread::Thread(Runnable* runnable) { - CHECK_APR_SUCCESS( - apr_thread_create(&thread, NULL, run, runnable, APRPool::get())); -} - -void Thread::join(){ - apr_status_t status; - if (thread != 0) - CHECK_APR_SUCCESS(apr_thread_join(&status, thread)); -} - -Thread::Thread(apr_thread_t* t) : thread(t) {} - -Thread Thread::current(){ - apr_thread_t* thr; - apr_os_thread_t osthr = apr_os_thread_current(); - CHECK_APR_SUCCESS(apr_os_thread_put(&thr, &osthr, APRPool::get())); - return Thread(thr); -} diff --git a/qpid/cpp/src/qpid/broker/AccumulatedAck.cpp b/qpid/cpp/src/qpid/broker/AccumulatedAck.cpp index 84ddcee556..11ac94f06e 100644 --- a/qpid/cpp/src/qpid/broker/AccumulatedAck.cpp +++ b/qpid/cpp/src/qpid/broker/AccumulatedAck.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/broker/AccumulatedAck.h" +#include <qpid/broker/AccumulatedAck.h> using std::less_equal; using std::bind2nd; diff --git a/qpid/cpp/src/qpid/broker/AutoDelete.cpp b/qpid/cpp/src/qpid/broker/AutoDelete.cpp index d96105ba7d..3d8e233768 100644 --- a/qpid/cpp/src/qpid/broker/AutoDelete.cpp +++ b/qpid/cpp/src/qpid/broker/AutoDelete.cpp @@ -15,7 +15,8 @@ * limitations under the License. * */ -#include "qpid/broker/AutoDelete.h" +#include <qpid/broker/AutoDelete.h> +#include <qpid/sys/Time.h> using namespace qpid::broker; using namespace qpid::sys; @@ -59,7 +60,7 @@ void AutoDelete::run(){ Monitor::ScopedLock l(monitor); while(!stopped){ process(); - monitor.wait(msecsToNsecs(period)); + monitor.wait(period * Time::NSEC_PER_MSEC); } } diff --git a/qpid/cpp/src/qpid/broker/AutoDelete.h b/qpid/cpp/src/qpid/broker/AutoDelete.h index e0efe7b399..775d2850c8 100644 --- a/qpid/cpp/src/qpid/broker/AutoDelete.h +++ b/qpid/cpp/src/qpid/broker/AutoDelete.h @@ -21,9 +21,9 @@ #include <iostream> #include <queue> #include <qpid/sys/Monitor.h> -#include "qpid/broker/Queue.h" -#include "qpid/broker/QueueRegistry.h" -#include "qpid/sys/Thread.h" +#include <qpid/broker/Queue.h> +#include <qpid/broker/QueueRegistry.h> +#include <qpid/sys/Thread.h> namespace qpid { namespace broker{ diff --git a/qpid/cpp/src/qpid/broker/Binding.h b/qpid/cpp/src/qpid/broker/Binding.h index 0e8f9b5d6c..224276e49b 100644 --- a/qpid/cpp/src/qpid/broker/Binding.h +++ b/qpid/cpp/src/qpid/broker/Binding.h @@ -18,7 +18,7 @@ #ifndef _Binding_ #define _Binding_ -#include "qpid/framing/FieldTable.h" +#include <qpid/framing/FieldTable.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/Broker.cpp b/qpid/cpp/src/qpid/broker/Broker.cpp index 90a705f173..0e92dfd508 100644 --- a/qpid/cpp/src/qpid/broker/Broker.cpp +++ b/qpid/cpp/src/qpid/broker/Broker.cpp @@ -17,16 +17,16 @@ */ #include <iostream> #include <memory> -#include "qpid/broker/Broker.h" +#include <qpid/broker/Broker.h> using namespace qpid::broker; using namespace qpid::sys; Broker::Broker(const Configuration& config) : - acceptor(new Acceptor(config.getPort(), - config.getConnectionBacklog(), - config.getWorkerThreads())) + acceptor(Acceptor::create(config.getPort(), + config.getConnectionBacklog(), + config.getWorkerThreads())) { } diff --git a/qpid/cpp/src/qpid/broker/Broker.h b/qpid/cpp/src/qpid/broker/Broker.h index c4a3a3fd4a..857a527530 100644 --- a/qpid/cpp/src/qpid/broker/Broker.h +++ b/qpid/cpp/src/qpid/broker/Broker.h @@ -19,59 +19,59 @@ * */ -#include "qpid/broker/Configuration.h" -#include "qpid/broker/SessionHandlerFactoryImpl.h" -#include "qpid/sys/Runnable.h" -#include "qpid/sys/Acceptor.h" +#include <qpid/broker/Configuration.h> +#include <qpid/broker/SessionHandlerFactoryImpl.h> +#include <qpid/sys/Runnable.h> +#include <qpid/sys/Acceptor.h> #include <qpid/SharedObject.h> namespace qpid { - namespace broker { - /** - * A broker instance. - */ - class Broker : public qpid::sys::Runnable, - public qpid::SharedObject<Broker> - { - public: - static const int16_t DEFAULT_PORT; +namespace broker { +/** + * A broker instance. + */ +class Broker : public qpid::sys::Runnable, + public qpid::SharedObject<Broker> +{ + public: + static const int16_t DEFAULT_PORT; - virtual ~Broker(); + virtual ~Broker(); - /** - * Create a broker. - * @param port Port to listen on or 0 to pick a port dynamically. - */ - static shared_ptr create(int16_t port = DEFAULT_PORT); + /** + * Create a broker. + * @param port Port to listen on or 0 to pick a port dynamically. + */ + static shared_ptr create(int16_t port = DEFAULT_PORT); - /** - * Create a broker using a Configuration. - */ - static shared_ptr create(const Configuration& config); + /** + * Create a broker using a Configuration. + */ + static shared_ptr create(const Configuration& config); - /** - * Return listening port. If called before bind this is - * the configured port. If called after it is the actual - * port, which will be different if the configured port is - * 0. - */ - virtual int16_t getPort() const { return acceptor->getPort(); } + /** + * Return listening port. If called before bind this is + * the configured port. If called after it is the actual + * port, which will be different if the configured port is + * 0. + */ + virtual int16_t getPort() const { return acceptor->getPort(); } - /** - * Run the broker. Implements Runnable::run() so the broker - * can be run in a separate thread. - */ - virtual void run(); + /** + * Run the broker. Implements Runnable::run() so the broker + * can be run in a separate thread. + */ + virtual void run(); - /** Shut down the broker */ - virtual void shutdown(); + /** Shut down the broker */ + virtual void shutdown(); - private: - Broker(const Configuration& config); - qpid::sys::Acceptor::shared_ptr acceptor; - SessionHandlerFactoryImpl factory; - }; - } + private: + Broker(const Configuration& config); + qpid::sys::Acceptor::shared_ptr acceptor; + SessionHandlerFactoryImpl factory; +}; +} } diff --git a/qpid/cpp/src/qpid/broker/Channel.cpp b/qpid/cpp/src/qpid/broker/Channel.cpp index 947a97ae7c..c225036a07 100644 --- a/qpid/cpp/src/qpid/broker/Channel.cpp +++ b/qpid/cpp/src/qpid/broker/Channel.cpp @@ -15,8 +15,8 @@ * limitations under the License. * */ -#include "qpid/broker/Channel.h" -#include "qpid/QpidError.h" +#include <qpid/broker/Channel.h> +#include <qpid/QpidError.h> #include <iostream> #include <sstream> #include <assert.h> diff --git a/qpid/cpp/src/qpid/broker/Channel.h b/qpid/cpp/src/qpid/broker/Channel.h index 24dbf728ba..cc7b1ada77 100644 --- a/qpid/cpp/src/qpid/broker/Channel.h +++ b/qpid/cpp/src/qpid/broker/Channel.h @@ -22,26 +22,26 @@ #include <functional> #include <list> #include <map> -#include "qpid/broker/AccumulatedAck.h" -#include "qpid/broker/Binding.h" -#include "qpid/broker/Consumer.h" -#include "qpid/broker/DeletingTxOp.h" -#include "qpid/broker/DeliverableMessage.h" -#include "qpid/broker/DeliveryRecord.h" -#include "qpid/broker/Message.h" -#include "qpid/broker/MessageBuilder.h" -#include "qpid/broker/NameGenerator.h" -#include "qpid/broker/Prefetch.h" -#include "qpid/broker/Queue.h" -#include "qpid/broker/TransactionalStore.h" -#include "qpid/broker/TxAck.h" -#include "qpid/broker/TxBuffer.h" -#include "qpid/broker/TxPublish.h" -#include "qpid/sys/Monitor.h" -#include "qpid/framing/OutputHandler.h" -#include "qpid/framing/AMQContentBody.h" -#include "qpid/framing/AMQHeaderBody.h" -#include "qpid/framing/BasicPublishBody.h" +#include <qpid/broker/AccumulatedAck.h> +#include <qpid/broker/Binding.h> +#include <qpid/broker/Consumer.h> +#include <qpid/broker/DeletingTxOp.h> +#include <qpid/broker/DeliverableMessage.h> +#include <qpid/broker/DeliveryRecord.h> +#include <qpid/broker/Message.h> +#include <qpid/broker/MessageBuilder.h> +#include <qpid/broker/NameGenerator.h> +#include <qpid/broker/Prefetch.h> +#include <qpid/broker/Queue.h> +#include <qpid/broker/TransactionalStore.h> +#include <qpid/broker/TxAck.h> +#include <qpid/broker/TxBuffer.h> +#include <qpid/broker/TxPublish.h> +#include <qpid/sys/Monitor.h> +#include <qpid/framing/OutputHandler.h> +#include <qpid/framing/AMQContentBody.h> +#include <qpid/framing/AMQHeaderBody.h> +#include <qpid/framing/BasicPublishBody.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/Configuration.cpp b/qpid/cpp/src/qpid/broker/Configuration.cpp index 550b283d62..9e966e4259 100644 --- a/qpid/cpp/src/qpid/broker/Configuration.cpp +++ b/qpid/cpp/src/qpid/broker/Configuration.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/broker/Configuration.h" +#include <qpid/broker/Configuration.h> #include <string.h> using namespace qpid::broker; diff --git a/qpid/cpp/src/qpid/broker/Configuration.h b/qpid/cpp/src/qpid/broker/Configuration.h index e1e7c40947..f7900849c7 100644 --- a/qpid/cpp/src/qpid/broker/Configuration.h +++ b/qpid/cpp/src/qpid/broker/Configuration.h @@ -21,7 +21,7 @@ #include <cstdlib> #include <iostream> #include <vector> -#include "qpid/Exception.h" +#include <qpid/Exception.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/Consumer.h b/qpid/cpp/src/qpid/broker/Consumer.h index 73b7ca9ed1..6b0fc5fbf2 100644 --- a/qpid/cpp/src/qpid/broker/Consumer.h +++ b/qpid/cpp/src/qpid/broker/Consumer.h @@ -18,7 +18,7 @@ #ifndef _Consumer_ #define _Consumer_ -#include "qpid/broker/Message.h" +#include <qpid/broker/Message.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/DeletingTxOp.cpp b/qpid/cpp/src/qpid/broker/DeletingTxOp.cpp index ea3735f361..208c6f526d 100644 --- a/qpid/cpp/src/qpid/broker/DeletingTxOp.cpp +++ b/qpid/cpp/src/qpid/broker/DeletingTxOp.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/broker/DeletingTxOp.h" +#include <qpid/broker/DeletingTxOp.h> using namespace qpid::broker; diff --git a/qpid/cpp/src/qpid/broker/DeletingTxOp.h b/qpid/cpp/src/qpid/broker/DeletingTxOp.h index f450807256..0baf6819c9 100644 --- a/qpid/cpp/src/qpid/broker/DeletingTxOp.h +++ b/qpid/cpp/src/qpid/broker/DeletingTxOp.h @@ -18,7 +18,7 @@ #ifndef _DeletingTxOp_ #define _DeletingTxOp_ -#include "qpid/broker/TxOp.h" +#include <qpid/broker/TxOp.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/Deliverable.h b/qpid/cpp/src/qpid/broker/Deliverable.h index 5aded061b7..009397a7e5 100644 --- a/qpid/cpp/src/qpid/broker/Deliverable.h +++ b/qpid/cpp/src/qpid/broker/Deliverable.h @@ -18,7 +18,7 @@ #ifndef _Deliverable_ #define _Deliverable_ -#include "qpid/broker/Queue.h" +#include <qpid/broker/Queue.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/DeliverableMessage.cpp b/qpid/cpp/src/qpid/broker/DeliverableMessage.cpp index aff0012bf4..8fb1fdced3 100644 --- a/qpid/cpp/src/qpid/broker/DeliverableMessage.cpp +++ b/qpid/cpp/src/qpid/broker/DeliverableMessage.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/broker/DeliverableMessage.h" +#include <qpid/broker/DeliverableMessage.h> using namespace qpid::broker; diff --git a/qpid/cpp/src/qpid/broker/DeliverableMessage.h b/qpid/cpp/src/qpid/broker/DeliverableMessage.h index 9c65cf7103..b24bd0697d 100644 --- a/qpid/cpp/src/qpid/broker/DeliverableMessage.h +++ b/qpid/cpp/src/qpid/broker/DeliverableMessage.h @@ -18,9 +18,9 @@ #ifndef _DeliverableMessage_ #define _DeliverableMessage_ -#include "qpid/broker/Deliverable.h" -#include "qpid/broker/Message.h" -#include "qpid/broker/Queue.h" +#include <qpid/broker/Deliverable.h> +#include <qpid/broker/Message.h> +#include <qpid/broker/Queue.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp b/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp index a49c5fbc02..a78b30d4a3 100644 --- a/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp +++ b/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp @@ -15,8 +15,8 @@ * limitations under the License. * */ -#include "qpid/broker/DeliveryRecord.h" -#include "qpid/broker/Channel.h" +#include <qpid/broker/DeliveryRecord.h> +#include <qpid/broker/Channel.h> using namespace qpid::broker; diff --git a/qpid/cpp/src/qpid/broker/DeliveryRecord.h b/qpid/cpp/src/qpid/broker/DeliveryRecord.h index 5ec7be77cb..d8c55ef45d 100644 --- a/qpid/cpp/src/qpid/broker/DeliveryRecord.h +++ b/qpid/cpp/src/qpid/broker/DeliveryRecord.h @@ -20,10 +20,10 @@ #include <algorithm> #include <list> -#include "qpid/broker/AccumulatedAck.h" -#include "qpid/broker/Message.h" -#include "qpid/broker/Prefetch.h" -#include "qpid/broker/Queue.h" +#include <qpid/broker/AccumulatedAck.h> +#include <qpid/broker/Message.h> +#include <qpid/broker/Prefetch.h> +#include <qpid/broker/Queue.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/DirectExchange.cpp b/qpid/cpp/src/qpid/broker/DirectExchange.cpp index 3f9d23cdc7..27a10a8b47 100644 --- a/qpid/cpp/src/qpid/broker/DirectExchange.cpp +++ b/qpid/cpp/src/qpid/broker/DirectExchange.cpp @@ -15,8 +15,8 @@ * limitations under the License. * */ -#include "qpid/broker/DirectExchange.h" -#include "qpid/broker/ExchangeBinding.h" +#include <qpid/broker/DirectExchange.h> +#include <qpid/broker/ExchangeBinding.h> #include <iostream> using namespace qpid::broker; diff --git a/qpid/cpp/src/qpid/broker/DirectExchange.h b/qpid/cpp/src/qpid/broker/DirectExchange.h index 0ee9ce2705..3b182d32f5 100644 --- a/qpid/cpp/src/qpid/broker/DirectExchange.h +++ b/qpid/cpp/src/qpid/broker/DirectExchange.h @@ -20,11 +20,11 @@ #include <map> #include <vector> -#include "qpid/broker/Exchange.h" -#include "qpid/framing/FieldTable.h" -#include "qpid/broker/Message.h" -#include "qpid/sys/Monitor.h" -#include "qpid/broker/Queue.h" +#include <qpid/broker/Exchange.h> +#include <qpid/framing/FieldTable.h> +#include <qpid/broker/Message.h> +#include <qpid/sys/Monitor.h> +#include <qpid/broker/Queue.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/Exchange.h b/qpid/cpp/src/qpid/broker/Exchange.h index 20b70ed475..688529c912 100644 --- a/qpid/cpp/src/qpid/broker/Exchange.h +++ b/qpid/cpp/src/qpid/broker/Exchange.h @@ -19,9 +19,9 @@ #define _Exchange_ #include <boost/shared_ptr.hpp> -#include "qpid/broker/Deliverable.h" -#include "qpid/broker/Queue.h" -#include "qpid/framing/FieldTable.h" +#include <qpid/broker/Deliverable.h> +#include <qpid/broker/Queue.h> +#include <qpid/framing/FieldTable.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/ExchangeBinding.cpp b/qpid/cpp/src/qpid/broker/ExchangeBinding.cpp index 115bf4f9ec..759ecf81a8 100644 --- a/qpid/cpp/src/qpid/broker/ExchangeBinding.cpp +++ b/qpid/cpp/src/qpid/broker/ExchangeBinding.cpp @@ -15,8 +15,8 @@ * limitations under the License. * */ -#include "qpid/broker/ExchangeBinding.h" -#include "qpid/broker/Exchange.h" +#include <qpid/broker/ExchangeBinding.h> +#include <qpid/broker/Exchange.h> using namespace qpid::broker; using namespace qpid::framing; diff --git a/qpid/cpp/src/qpid/broker/ExchangeBinding.h b/qpid/cpp/src/qpid/broker/ExchangeBinding.h index 692aa8a57f..20e38a9554 100644 --- a/qpid/cpp/src/qpid/broker/ExchangeBinding.h +++ b/qpid/cpp/src/qpid/broker/ExchangeBinding.h @@ -18,9 +18,9 @@ #ifndef _ExchangeBinding_ #define _ExchangeBinding_ -#include "qpid/broker/Binding.h" -#include "qpid/framing/FieldTable.h" -#include "qpid/broker/Queue.h" +#include <qpid/broker/Binding.h> +#include <qpid/framing/FieldTable.h> +#include <qpid/broker/Queue.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp b/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp index 1c3a4af026..a00ba50c5c 100644 --- a/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp +++ b/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp @@ -15,11 +15,11 @@ * limitations under the License. * */ -#include "qpid/broker/ExchangeRegistry.h" -#include "qpid/broker/DirectExchange.h" -#include "qpid/broker/FanOutExchange.h" -#include "qpid/broker/HeadersExchange.h" -#include "qpid/broker/TopicExchange.h" +#include <qpid/broker/ExchangeRegistry.h> +#include <qpid/broker/DirectExchange.h> +#include <qpid/broker/FanOutExchange.h> +#include <qpid/broker/HeadersExchange.h> +#include <qpid/broker/TopicExchange.h> using namespace qpid::broker; using namespace qpid::sys; diff --git a/qpid/cpp/src/qpid/broker/ExchangeRegistry.h b/qpid/cpp/src/qpid/broker/ExchangeRegistry.h index 5d4cf10de8..083d0fb69c 100644 --- a/qpid/cpp/src/qpid/broker/ExchangeRegistry.h +++ b/qpid/cpp/src/qpid/broker/ExchangeRegistry.h @@ -19,8 +19,8 @@ #define _ExchangeRegistry_ #include <map> -#include "qpid/broker/Exchange.h" -#include "qpid/sys/Monitor.h" +#include <qpid/broker/Exchange.h> +#include <qpid/sys/Monitor.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/FanOutExchange.cpp b/qpid/cpp/src/qpid/broker/FanOutExchange.cpp index 2f8d4eadb2..5f88ce9108 100644 --- a/qpid/cpp/src/qpid/broker/FanOutExchange.cpp +++ b/qpid/cpp/src/qpid/broker/FanOutExchange.cpp @@ -15,8 +15,8 @@ * limitations under the License. * */ -#include "qpid/broker/FanOutExchange.h" -#include "qpid/broker/ExchangeBinding.h" +#include <qpid/broker/FanOutExchange.h> +#include <qpid/broker/ExchangeBinding.h> #include <algorithm> using namespace qpid::broker; diff --git a/qpid/cpp/src/qpid/broker/FanOutExchange.h b/qpid/cpp/src/qpid/broker/FanOutExchange.h index 910acdc203..7fb91a689b 100644 --- a/qpid/cpp/src/qpid/broker/FanOutExchange.h +++ b/qpid/cpp/src/qpid/broker/FanOutExchange.h @@ -20,11 +20,11 @@ #include <map> #include <vector> -#include "qpid/broker/Exchange.h" -#include "qpid/framing/FieldTable.h" -#include "qpid/broker/Message.h" -#include "qpid/sys/Monitor.h" -#include "qpid/broker/Queue.h" +#include <qpid/broker/Exchange.h> +#include <qpid/framing/FieldTable.h> +#include <qpid/broker/Message.h> +#include <qpid/sys/Monitor.h> +#include <qpid/broker/Queue.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/HeadersExchange.cpp b/qpid/cpp/src/qpid/broker/HeadersExchange.cpp index 0c4c290bbd..bca4eb7e3e 100644 --- a/qpid/cpp/src/qpid/broker/HeadersExchange.cpp +++ b/qpid/cpp/src/qpid/broker/HeadersExchange.cpp @@ -15,10 +15,10 @@ * limitations under the License. * */ -#include "qpid/broker/HeadersExchange.h" -#include "qpid/broker/ExchangeBinding.h" -#include "qpid/framing/Value.h" -#include "qpid/QpidError.h" +#include <qpid/broker/HeadersExchange.h> +#include <qpid/broker/ExchangeBinding.h> +#include <qpid/framing/Value.h> +#include <qpid/QpidError.h> #include <algorithm> diff --git a/qpid/cpp/src/qpid/broker/HeadersExchange.h b/qpid/cpp/src/qpid/broker/HeadersExchange.h index 77af612fe6..6aaea129e3 100644 --- a/qpid/cpp/src/qpid/broker/HeadersExchange.h +++ b/qpid/cpp/src/qpid/broker/HeadersExchange.h @@ -19,11 +19,11 @@ #define _HeadersExchange_ #include <vector> -#include "qpid/broker/Exchange.h" -#include "qpid/framing/FieldTable.h" -#include "qpid/broker/Message.h" -#include "qpid/sys/Monitor.h" -#include "qpid/broker/Queue.h" +#include <qpid/broker/Exchange.h> +#include <qpid/framing/FieldTable.h> +#include <qpid/broker/Message.h> +#include <qpid/sys/Monitor.h> +#include <qpid/broker/Queue.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/Message.cpp b/qpid/cpp/src/qpid/broker/Message.cpp index 112e8dd77d..139725820e 100644 --- a/qpid/cpp/src/qpid/broker/Message.cpp +++ b/qpid/cpp/src/qpid/broker/Message.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/broker/Message.h" +#include <qpid/broker/Message.h> #include <iostream> using namespace boost; diff --git a/qpid/cpp/src/qpid/broker/Message.h b/qpid/cpp/src/qpid/broker/Message.h index 06780ba6ed..d918fd9830 100644 --- a/qpid/cpp/src/qpid/broker/Message.h +++ b/qpid/cpp/src/qpid/broker/Message.h @@ -19,13 +19,13 @@ #define _Message_ #include <boost/shared_ptr.hpp> -#include "qpid/broker/ConnectionToken.h" -#include "qpid/broker/TxBuffer.h" -#include "qpid/framing/AMQContentBody.h" -#include "qpid/framing/AMQHeaderBody.h" -#include "qpid/framing/BasicHeaderProperties.h" -#include "qpid/framing/BasicPublishBody.h" -#include "qpid/framing/OutputHandler.h" +#include <qpid/broker/ConnectionToken.h> +#include <qpid/broker/TxBuffer.h> +#include <qpid/framing/AMQContentBody.h> +#include <qpid/framing/AMQHeaderBody.h> +#include <qpid/framing/BasicHeaderProperties.h> +#include <qpid/framing/BasicPublishBody.h> +#include <qpid/framing/OutputHandler.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/MessageBuilder.cpp b/qpid/cpp/src/qpid/broker/MessageBuilder.cpp index c8488292b7..9037b773ac 100644 --- a/qpid/cpp/src/qpid/broker/MessageBuilder.cpp +++ b/qpid/cpp/src/qpid/broker/MessageBuilder.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/broker/MessageBuilder.h" +#include <qpid/broker/MessageBuilder.h> using namespace qpid::broker; using namespace qpid::framing; diff --git a/qpid/cpp/src/qpid/broker/MessageBuilder.h b/qpid/cpp/src/qpid/broker/MessageBuilder.h index a5966574ad..832acdc971 100644 --- a/qpid/cpp/src/qpid/broker/MessageBuilder.h +++ b/qpid/cpp/src/qpid/broker/MessageBuilder.h @@ -18,12 +18,12 @@ #ifndef _MessageBuilder_ #define _MessageBuilder_ -#include "qpid/QpidError.h" -#include "qpid/broker/Exchange.h" -#include "qpid/broker/Message.h" -#include "qpid/framing/AMQContentBody.h" -#include "qpid/framing/AMQHeaderBody.h" -#include "qpid/framing/BasicPublishBody.h" +#include <qpid/QpidError.h> +#include <qpid/broker/Exchange.h> +#include <qpid/broker/Message.h> +#include <qpid/framing/AMQContentBody.h> +#include <qpid/framing/AMQHeaderBody.h> +#include <qpid/framing/BasicPublishBody.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/MessageStore.h b/qpid/cpp/src/qpid/broker/MessageStore.h index 276f33eacd..f3330889f6 100644 --- a/qpid/cpp/src/qpid/broker/MessageStore.h +++ b/qpid/cpp/src/qpid/broker/MessageStore.h @@ -18,9 +18,9 @@ #ifndef _MessageStore_ #define _MessageStore_ -#include "qpid/broker/Message.h" -#include "qpid/broker/Queue.h" -#include "qpid/broker/TransactionalStore.h" +#include <qpid/broker/Message.h> +#include <qpid/broker/Queue.h> +#include <qpid/broker/TransactionalStore.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/NameGenerator.cpp b/qpid/cpp/src/qpid/broker/NameGenerator.cpp index 5f1b1431f3..ec0e66c367 100644 --- a/qpid/cpp/src/qpid/broker/NameGenerator.cpp +++ b/qpid/cpp/src/qpid/broker/NameGenerator.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/broker/NameGenerator.h" +#include <qpid/broker/NameGenerator.h> #include <sstream> using namespace qpid::broker; diff --git a/qpid/cpp/src/qpid/broker/NameGenerator.h b/qpid/cpp/src/qpid/broker/NameGenerator.h index 71643ef675..9c5c69983f 100644 --- a/qpid/cpp/src/qpid/broker/NameGenerator.h +++ b/qpid/cpp/src/qpid/broker/NameGenerator.h @@ -18,7 +18,7 @@ #ifndef _NameGenerator_ #define _NameGenerator_ -#include "qpid/broker/Message.h" +#include <qpid/broker/Message.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/NullMessageStore.cpp b/qpid/cpp/src/qpid/broker/NullMessageStore.cpp index 87df407ad8..01b14e080f 100644 --- a/qpid/cpp/src/qpid/broker/NullMessageStore.cpp +++ b/qpid/cpp/src/qpid/broker/NullMessageStore.cpp @@ -16,10 +16,10 @@ * */ -#include "qpid/broker/NullMessageStore.h" +#include <qpid/broker/NullMessageStore.h> -#include "qpid/broker/Queue.h" -#include "qpid/broker/QueueRegistry.h" +#include <qpid/broker/Queue.h> +#include <qpid/broker/QueueRegistry.h> #include <iostream> diff --git a/qpid/cpp/src/qpid/broker/NullMessageStore.h b/qpid/cpp/src/qpid/broker/NullMessageStore.h index 3b34a7f6a0..2b4007c6d2 100644 --- a/qpid/cpp/src/qpid/broker/NullMessageStore.h +++ b/qpid/cpp/src/qpid/broker/NullMessageStore.h @@ -18,9 +18,9 @@ #ifndef _NullMessageStore_ #define _NullMessageStore_ -#include "qpid/broker/Message.h" -#include "qpid/broker/MessageStore.h" -#include "qpid/broker/Queue.h" +#include <qpid/broker/Message.h> +#include <qpid/broker/MessageStore.h> +#include <qpid/broker/Queue.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/Prefetch.h b/qpid/cpp/src/qpid/broker/Prefetch.h index d56799f835..afbc85fe94 100644 --- a/qpid/cpp/src/qpid/broker/Prefetch.h +++ b/qpid/cpp/src/qpid/broker/Prefetch.h @@ -18,7 +18,7 @@ #ifndef _Prefetch_ #define _Prefetch_ -#include "qpid/framing/amqp_types.h" +#include <qpid/framing/amqp_types.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/Queue.cpp b/qpid/cpp/src/qpid/broker/Queue.cpp index 2fe5de2dc9..4fae1086d5 100644 --- a/qpid/cpp/src/qpid/broker/Queue.cpp +++ b/qpid/cpp/src/qpid/broker/Queue.cpp @@ -15,9 +15,10 @@ * limitations under the License. * */ -#include "qpid/broker/Queue.h" -#include "qpid/broker/MessageStore.h" -#include "qpid/sys/Monitor.h" +#include <qpid/broker/Queue.h> +#include <qpid/broker/MessageStore.h> +#include <qpid/sys/Monitor.h> +#include <qpid/sys/Time.h> #include <iostream> using namespace qpid::broker; @@ -38,7 +39,7 @@ Queue::Queue(const string& _name, u_int32_t _autodelete, exclusive(0), persistenceId(0) { - if(autodelete) lastUsed = getTimeMsecs(); + if(autodelete) lastUsed = Time::now().msecs(); } Queue::~Queue(){ @@ -133,7 +134,7 @@ void Queue::consume(Consumer* c, bool requestExclusive){ void Queue::cancel(Consumer* c){ Mutex::ScopedLock locker(lock); consumers.erase(find(consumers.begin(), consumers.end(), c)); - if(autodelete && consumers.empty()) lastUsed = getTimeMsecs(); + if(autodelete && consumers.empty()) lastUsed = Time::now().msecs(); if(exclusive == c) exclusive = 0; } @@ -166,7 +167,7 @@ u_int32_t Queue::getConsumerCount() const{ bool Queue::canAutoDelete() const{ Mutex::ScopedLock locker(lock); - return lastUsed && (getTimeMsecs() - lastUsed > autodelete); + return lastUsed && (Time::now().msecs() - lastUsed > autodelete); } void Queue::enqueue(TransactionContext* ctxt, Message::shared_ptr& msg, const string * const xid) diff --git a/qpid/cpp/src/qpid/broker/Queue.h b/qpid/cpp/src/qpid/broker/Queue.h index 2f7ee3ec78..3788158379 100644 --- a/qpid/cpp/src/qpid/broker/Queue.h +++ b/qpid/cpp/src/qpid/broker/Queue.h @@ -21,12 +21,12 @@ #include <vector> #include <queue> #include <boost/shared_ptr.hpp> -#include "qpid/framing/amqp_types.h" -#include "qpid/broker/Binding.h" -#include "qpid/broker/ConnectionToken.h" -#include "qpid/broker/Consumer.h" -#include "qpid/broker/Message.h" -#include "qpid/sys/Monitor.h" +#include <qpid/framing/amqp_types.h> +#include <qpid/broker/Binding.h> +#include <qpid/broker/ConnectionToken.h> +#include <qpid/broker/Consumer.h> +#include <qpid/broker/Message.h> +#include <qpid/sys/Monitor.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/QueueRegistry.cpp b/qpid/cpp/src/qpid/broker/QueueRegistry.cpp index 1976da812d..f3b05f59b1 100644 --- a/qpid/cpp/src/qpid/broker/QueueRegistry.cpp +++ b/qpid/cpp/src/qpid/broker/QueueRegistry.cpp @@ -15,8 +15,8 @@ * limitations under the License. * */ -#include "qpid/broker/QueueRegistry.h" -#include "qpid/broker/SessionHandlerImpl.h" +#include <qpid/broker/QueueRegistry.h> +#include <qpid/broker/SessionHandlerImpl.h> #include <sstream> #include <assert.h> diff --git a/qpid/cpp/src/qpid/broker/QueueRegistry.h b/qpid/cpp/src/qpid/broker/QueueRegistry.h index e3d03a06b1..28ed2cd4c4 100644 --- a/qpid/cpp/src/qpid/broker/QueueRegistry.h +++ b/qpid/cpp/src/qpid/broker/QueueRegistry.h @@ -19,8 +19,8 @@ #define _QueueRegistry_ #include <map> -#include "qpid/sys/Monitor.h" -#include "qpid/broker/Queue.h" +#include <qpid/sys/Monitor.h> +#include <qpid/broker/Queue.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/SessionHandlerFactoryImpl.cpp b/qpid/cpp/src/qpid/broker/SessionHandlerFactoryImpl.cpp index 707881b6bb..cfcb5dd271 100644 --- a/qpid/cpp/src/qpid/broker/SessionHandlerFactoryImpl.cpp +++ b/qpid/cpp/src/qpid/broker/SessionHandlerFactoryImpl.cpp @@ -15,13 +15,13 @@ * limitations under the License. * */ -#include "qpid/broker/SessionHandlerFactoryImpl.h" +#include <qpid/broker/SessionHandlerFactoryImpl.h> -#include "qpid/broker/DirectExchange.h" -#include "qpid/broker/FanOutExchange.h" -#include "qpid/broker/HeadersExchange.h" -#include "qpid/broker/NullMessageStore.h" -#include "qpid/broker/SessionHandlerImpl.h" +#include <qpid/broker/DirectExchange.h> +#include <qpid/broker/FanOutExchange.h> +#include <qpid/broker/HeadersExchange.h> +#include <qpid/broker/NullMessageStore.h> +#include <qpid/broker/SessionHandlerImpl.h> using namespace qpid::broker; using namespace qpid::sys; diff --git a/qpid/cpp/src/qpid/broker/SessionHandlerFactoryImpl.h b/qpid/cpp/src/qpid/broker/SessionHandlerFactoryImpl.h index 6e679592ff..5f5d06f82f 100644 --- a/qpid/cpp/src/qpid/broker/SessionHandlerFactoryImpl.h +++ b/qpid/cpp/src/qpid/broker/SessionHandlerFactoryImpl.h @@ -18,16 +18,16 @@ #ifndef _SessionHandlerFactoryImpl_ #define _SessionHandlerFactoryImpl_ -#include "qpid/broker/AutoDelete.h" -#include "qpid/broker/ExchangeRegistry.h" -#include "qpid/broker/MessageStore.h" -#include "qpid/broker/QueueRegistry.h" -#include "qpid/framing/AMQFrame.h" -#include "qpid/framing/ProtocolInitiation.h" -#include "qpid/sys/SessionContext.h" -#include "qpid/sys/SessionHandler.h" -#include "qpid/sys/SessionHandlerFactory.h" -#include "qpid/sys/TimeoutHandler.h" +#include <qpid/broker/AutoDelete.h> +#include <qpid/broker/ExchangeRegistry.h> +#include <qpid/broker/MessageStore.h> +#include <qpid/broker/QueueRegistry.h> +#include <qpid/framing/AMQFrame.h> +#include <qpid/framing/ProtocolInitiation.h> +#include <qpid/sys/SessionContext.h> +#include <qpid/sys/SessionHandler.h> +#include <qpid/sys/SessionHandlerFactory.h> +#include <qpid/sys/TimeoutHandler.h> #include <memory> namespace qpid { diff --git a/qpid/cpp/src/qpid/broker/SessionHandlerImpl.cpp b/qpid/cpp/src/qpid/broker/SessionHandlerImpl.cpp index 5c46ed1b1b..e32f100e0f 100644 --- a/qpid/cpp/src/qpid/broker/SessionHandlerImpl.cpp +++ b/qpid/cpp/src/qpid/broker/SessionHandlerImpl.cpp @@ -16,10 +16,10 @@ * */ #include <iostream> -#include "qpid/broker/SessionHandlerImpl.h" -#include "qpid/broker/FanOutExchange.h" -#include "qpid/broker/HeadersExchange.h" -#include "qpid/broker/TopicExchange.h" +#include <qpid/broker/SessionHandlerImpl.h> +#include <qpid/broker/FanOutExchange.h> +#include <qpid/broker/HeadersExchange.h> +#include <qpid/broker/TopicExchange.h> #include "assert.h" using namespace boost; diff --git a/qpid/cpp/src/qpid/broker/SessionHandlerImpl.h b/qpid/cpp/src/qpid/broker/SessionHandlerImpl.h index 55cc2170ec..44e8386327 100644 --- a/qpid/cpp/src/qpid/broker/SessionHandlerImpl.h +++ b/qpid/cpp/src/qpid/broker/SessionHandlerImpl.h @@ -22,21 +22,21 @@ #include <sstream> #include <vector> #include <exception> -#include "qpid/framing/AMQFrame.h" -#include "qpid/framing/AMQP_ClientProxy.h" -#include "qpid/framing/AMQP_ServerOperations.h" -#include "qpid/broker/AutoDelete.h" -#include "qpid/broker/ExchangeRegistry.h" -#include "qpid/broker/Channel.h" -#include "qpid/broker/ConnectionToken.h" -#include "qpid/broker/DirectExchange.h" -#include "qpid/framing/OutputHandler.h" -#include "qpid/framing/ProtocolInitiation.h" -#include "qpid/broker/QueueRegistry.h" -#include "qpid/sys/SessionContext.h" -#include "qpid/sys/SessionHandler.h" -#include "qpid/sys/TimeoutHandler.h" -#include "qpid/broker/TopicExchange.h" +#include <qpid/framing/AMQFrame.h> +#include <qpid/framing/AMQP_ClientProxy.h> +#include <qpid/framing/AMQP_ServerOperations.h> +#include <qpid/broker/AutoDelete.h> +#include <qpid/broker/ExchangeRegistry.h> +#include <qpid/broker/Channel.h> +#include <qpid/broker/ConnectionToken.h> +#include <qpid/broker/DirectExchange.h> +#include <qpid/framing/OutputHandler.h> +#include <qpid/framing/ProtocolInitiation.h> +#include <qpid/broker/QueueRegistry.h> +#include <qpid/sys/SessionContext.h> +#include <qpid/sys/SessionHandler.h> +#include <qpid/sys/TimeoutHandler.h> +#include <qpid/broker/TopicExchange.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/TopicExchange.cpp b/qpid/cpp/src/qpid/broker/TopicExchange.cpp index eecd9918d4..302fc1f6c5 100644 --- a/qpid/cpp/src/qpid/broker/TopicExchange.cpp +++ b/qpid/cpp/src/qpid/broker/TopicExchange.cpp @@ -15,8 +15,8 @@ * limitations under the License. * */ -#include "qpid/broker/TopicExchange.h" -#include "qpid/broker/ExchangeBinding.h" +#include <qpid/broker/TopicExchange.h> +#include <qpid/broker/ExchangeBinding.h> #include <algorithm> using namespace qpid::broker; diff --git a/qpid/cpp/src/qpid/broker/TopicExchange.h b/qpid/cpp/src/qpid/broker/TopicExchange.h index a3e133845f..040be81a40 100644 --- a/qpid/cpp/src/qpid/broker/TopicExchange.h +++ b/qpid/cpp/src/qpid/broker/TopicExchange.h @@ -20,11 +20,11 @@ #include <map> #include <vector> -#include "qpid/broker/Exchange.h" -#include "qpid/framing/FieldTable.h" -#include "qpid/broker/Message.h" -#include "qpid/sys/Monitor.h" -#include "qpid/broker/Queue.h" +#include <qpid/broker/Exchange.h> +#include <qpid/framing/FieldTable.h> +#include <qpid/broker/Message.h> +#include <qpid/sys/Monitor.h> +#include <qpid/broker/Queue.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/TxAck.cpp b/qpid/cpp/src/qpid/broker/TxAck.cpp index 0bd525cc68..6b936430cf 100644 --- a/qpid/cpp/src/qpid/broker/TxAck.cpp +++ b/qpid/cpp/src/qpid/broker/TxAck.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/broker/TxAck.h" +#include <qpid/broker/TxAck.h> using std::bind1st; using std::bind2nd; diff --git a/qpid/cpp/src/qpid/broker/TxAck.h b/qpid/cpp/src/qpid/broker/TxAck.h index f284f8827d..40abac4020 100644 --- a/qpid/cpp/src/qpid/broker/TxAck.h +++ b/qpid/cpp/src/qpid/broker/TxAck.h @@ -21,9 +21,9 @@ #include <algorithm> #include <functional> #include <list> -#include "qpid/broker/AccumulatedAck.h" -#include "qpid/broker/DeliveryRecord.h" -#include "qpid/broker/TxOp.h" +#include <qpid/broker/AccumulatedAck.h> +#include <qpid/broker/DeliveryRecord.h> +#include <qpid/broker/TxOp.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/TxBuffer.cpp b/qpid/cpp/src/qpid/broker/TxBuffer.cpp index 920b9862b0..35fbe81846 100644 --- a/qpid/cpp/src/qpid/broker/TxBuffer.cpp +++ b/qpid/cpp/src/qpid/broker/TxBuffer.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/broker/TxBuffer.h" +#include <qpid/broker/TxBuffer.h> using std::mem_fun; using namespace qpid::broker; diff --git a/qpid/cpp/src/qpid/broker/TxBuffer.h b/qpid/cpp/src/qpid/broker/TxBuffer.h index dbf77304ed..1ff12192da 100644 --- a/qpid/cpp/src/qpid/broker/TxBuffer.h +++ b/qpid/cpp/src/qpid/broker/TxBuffer.h @@ -21,8 +21,8 @@ #include <algorithm> #include <functional> #include <vector> -#include "qpid/broker/TransactionalStore.h" -#include "qpid/broker/TxOp.h" +#include <qpid/broker/TransactionalStore.h> +#include <qpid/broker/TxOp.h> /** * Represents a single transaction. As such, an instance of this class diff --git a/qpid/cpp/src/qpid/broker/TxOp.h b/qpid/cpp/src/qpid/broker/TxOp.h index af6eaded23..bc36060847 100644 --- a/qpid/cpp/src/qpid/broker/TxOp.h +++ b/qpid/cpp/src/qpid/broker/TxOp.h @@ -18,7 +18,7 @@ #ifndef _TxOp_ #define _TxOp_ -#include "qpid/broker/TransactionalStore.h" +#include <qpid/broker/TransactionalStore.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/broker/TxPublish.cpp b/qpid/cpp/src/qpid/broker/TxPublish.cpp index 461ddfe052..6a2ad87aea 100644 --- a/qpid/cpp/src/qpid/broker/TxPublish.cpp +++ b/qpid/cpp/src/qpid/broker/TxPublish.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/broker/TxPublish.h" +#include <qpid/broker/TxPublish.h> using namespace qpid::broker; diff --git a/qpid/cpp/src/qpid/broker/TxPublish.h b/qpid/cpp/src/qpid/broker/TxPublish.h index f955ab4bc0..3ffa894de0 100644 --- a/qpid/cpp/src/qpid/broker/TxPublish.h +++ b/qpid/cpp/src/qpid/broker/TxPublish.h @@ -21,11 +21,11 @@ #include <algorithm> #include <functional> #include <list> -#include "qpid/broker/Deliverable.h" -#include "qpid/broker/Message.h" -#include "qpid/broker/MessageStore.h" -#include "qpid/broker/Queue.h" -#include "qpid/broker/TxOp.h" +#include <qpid/broker/Deliverable.h> +#include <qpid/broker/Message.h> +#include <qpid/broker/MessageStore.h> +#include <qpid/broker/Queue.h> +#include <qpid/broker/TxOp.h> namespace qpid { namespace broker { diff --git a/qpid/cpp/src/qpid/client/Channel.cpp b/qpid/cpp/src/qpid/client/Channel.cpp index fad648f27d..bf02cb3677 100644 --- a/qpid/cpp/src/qpid/client/Channel.cpp +++ b/qpid/cpp/src/qpid/client/Channel.cpp @@ -15,10 +15,10 @@ * limitations under the License. * */ -#include "qpid/client/Channel.h" -#include "qpid/sys/Monitor.h" -#include "qpid/client/Message.h" -#include "qpid/QpidError.h" +#include <qpid/client/Channel.h> +#include <qpid/sys/Monitor.h> +#include <qpid/client/Message.h> +#include <qpid/QpidError.h> using namespace boost; //to use dynamic_pointer_cast using namespace qpid::client; diff --git a/qpid/cpp/src/qpid/client/Channel.h b/qpid/cpp/src/qpid/client/Channel.h index daf2b6f9d9..6a6c9ce800 100644 --- a/qpid/cpp/src/qpid/client/Channel.h +++ b/qpid/cpp/src/qpid/client/Channel.h @@ -23,15 +23,15 @@ #ifndef _Channel_ #define _Channel_ -#include "qpid/framing/amqp_framing.h" -#include "qpid/client/Connection.h" -#include "qpid/client/Exchange.h" -#include "qpid/client/IncomingMessage.h" -#include "qpid/client/Message.h" -#include "qpid/client/MessageListener.h" -#include "qpid/client/Queue.h" -#include "qpid/client/ResponseHandler.h" -#include "qpid/client/ReturnedMessageHandler.h" +#include <qpid/framing/amqp_framing.h> +#include <qpid/client/Connection.h> +#include <qpid/client/Exchange.h> +#include <qpid/client/IncomingMessage.h> +#include <qpid/client/Message.h> +#include <qpid/client/MessageListener.h> +#include <qpid/client/Queue.h> +#include <qpid/client/ResponseHandler.h> +#include <qpid/client/ReturnedMessageHandler.h> namespace qpid { namespace client { diff --git a/qpid/cpp/src/qpid/client/Connection.cpp b/qpid/cpp/src/qpid/client/Connection.cpp index 21c514127d..b683ae1dec 100644 --- a/qpid/cpp/src/qpid/client/Connection.cpp +++ b/qpid/cpp/src/qpid/client/Connection.cpp @@ -15,10 +15,10 @@ * limitations under the License. * */ -#include "qpid/client/Connection.h" -#include "qpid/client/Channel.h" -#include "qpid/client/Message.h" -#include "qpid/QpidError.h" +#include <qpid/client/Connection.h> +#include <qpid/client/Channel.h> +#include <qpid/client/Message.h> +#include <qpid/QpidError.h> #include <iostream> using namespace qpid::client; diff --git a/qpid/cpp/src/qpid/client/Connection.h b/qpid/cpp/src/qpid/client/Connection.h index 4ff4e83859..fadd50cd97 100644 --- a/qpid/cpp/src/qpid/client/Connection.h +++ b/qpid/cpp/src/qpid/client/Connection.h @@ -21,18 +21,18 @@ #ifndef _Connection_ #define _Connection_ -#include "qpid/QpidError.h" -#include "qpid/client/Connector.h" -#include "qpid/sys/ShutdownHandler.h" -#include "qpid/sys/TimeoutHandler.h" - -#include "qpid/framing/amqp_framing.h" -#include "qpid/client/Exchange.h" -#include "qpid/client/IncomingMessage.h" -#include "qpid/client/Message.h" -#include "qpid/client/MessageListener.h" -#include "qpid/client/Queue.h" -#include "qpid/client/ResponseHandler.h" +#include <qpid/QpidError.h> +#include <qpid/client/Connector.h> +#include <qpid/sys/ShutdownHandler.h> +#include <qpid/sys/TimeoutHandler.h> + +#include <qpid/framing/amqp_framing.h> +#include <qpid/client/Exchange.h> +#include <qpid/client/IncomingMessage.h> +#include <qpid/client/Message.h> +#include <qpid/client/MessageListener.h> +#include <qpid/client/Queue.h> +#include <qpid/client/ResponseHandler.h> namespace qpid { namespace client { diff --git a/qpid/cpp/src/qpid/client/Connector.cpp b/qpid/cpp/src/qpid/client/Connector.cpp index 5d3a20be6a..6d8cae1169 100644 --- a/qpid/cpp/src/qpid/client/Connector.cpp +++ b/qpid/cpp/src/qpid/client/Connector.cpp @@ -89,7 +89,7 @@ void Connector::writeToSocket(char* data, size_t available){ while(written < available && !closed){ ssize_t sent = socket.send(data + written, available-written); if(sent > 0) { - lastOut = getTimeMsecs(); + lastOut = Time::now().msecs(); written += sent; } } @@ -97,7 +97,7 @@ void Connector::writeToSocket(char* data, size_t available){ void Connector::checkIdle(ssize_t status){ if(timeoutHandler){ - int64_t now = getTimeMsecs(); + int64_t now = Time::now().msecs(); if(status == Socket::SOCKET_TIMEOUT) { if(idleIn && (now - lastIn > idleIn)){ timeoutHandler->idleIn(); diff --git a/qpid/cpp/src/qpid/client/Connector.h b/qpid/cpp/src/qpid/client/Connector.h index 91ec58c95c..0b3ba43201 100644 --- a/qpid/cpp/src/qpid/client/Connector.h +++ b/qpid/cpp/src/qpid/client/Connector.h @@ -19,14 +19,14 @@ #define _Connector_ -#include "qpid/framing/InputHandler.h" -#include "qpid/framing/OutputHandler.h" -#include "qpid/framing/InitiationHandler.h" -#include "qpid/framing/ProtocolInitiation.h" -#include "qpid/sys/ShutdownHandler.h" -#include "qpid/sys/TimeoutHandler.h" -#include "qpid/sys/Thread.h" -#include "qpid/sys/Monitor.h" +#include <qpid/framing/InputHandler.h> +#include <qpid/framing/OutputHandler.h> +#include <qpid/framing/InitiationHandler.h> +#include <qpid/framing/ProtocolInitiation.h> +#include <qpid/sys/ShutdownHandler.h> +#include <qpid/sys/TimeoutHandler.h> +#include <qpid/sys/Thread.h> +#include <qpid/sys/Monitor.h> #include <qpid/sys/Socket.h> namespace qpid { diff --git a/qpid/cpp/src/qpid/client/Exchange.cpp b/qpid/cpp/src/qpid/client/Exchange.cpp index 078f15c3a7..e2af7440b1 100644 --- a/qpid/cpp/src/qpid/client/Exchange.cpp +++ b/qpid/cpp/src/qpid/client/Exchange.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/client/Exchange.h" +#include <qpid/client/Exchange.h> qpid::client::Exchange::Exchange(std::string _name, std::string _type) : name(_name), type(_type){} const std::string& qpid::client::Exchange::getName() const { return name; } diff --git a/qpid/cpp/src/qpid/client/IncomingMessage.cpp b/qpid/cpp/src/qpid/client/IncomingMessage.cpp index c385430a27..af874bc7a2 100644 --- a/qpid/cpp/src/qpid/client/IncomingMessage.cpp +++ b/qpid/cpp/src/qpid/client/IncomingMessage.cpp @@ -15,8 +15,8 @@ * limitations under the License. * */ -#include "qpid/client/IncomingMessage.h" -#include "qpid/QpidError.h" +#include <qpid/client/IncomingMessage.h> +#include <qpid/QpidError.h> #include <iostream> using namespace qpid::client; diff --git a/qpid/cpp/src/qpid/client/IncomingMessage.h b/qpid/cpp/src/qpid/client/IncomingMessage.h index fec620066b..e9426d0259 100644 --- a/qpid/cpp/src/qpid/client/IncomingMessage.h +++ b/qpid/cpp/src/qpid/client/IncomingMessage.h @@ -17,12 +17,12 @@ */ #include <string> #include <vector> -#include "qpid/framing/amqp_framing.h" +#include <qpid/framing/amqp_framing.h> #ifndef _IncomingMessage_ #define _IncomingMessage_ -#include "qpid/client/Message.h" +#include <qpid/client/Message.h> namespace qpid { namespace client { diff --git a/qpid/cpp/src/qpid/client/Message.cpp b/qpid/cpp/src/qpid/client/Message.cpp index 34220b595d..7a90bce79d 100644 --- a/qpid/cpp/src/qpid/client/Message.cpp +++ b/qpid/cpp/src/qpid/client/Message.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/client/Message.h" +#include <qpid/client/Message.h> using namespace qpid::client; using namespace qpid::framing; diff --git a/qpid/cpp/src/qpid/client/Message.h b/qpid/cpp/src/qpid/client/Message.h index 5b1c1d5de7..8a5399444b 100644 --- a/qpid/cpp/src/qpid/client/Message.h +++ b/qpid/cpp/src/qpid/client/Message.h @@ -16,7 +16,7 @@ * */ #include <string> -#include "qpid/framing/amqp_framing.h" +#include <qpid/framing/amqp_framing.h> #ifndef _Message_ #define _Message_ diff --git a/qpid/cpp/src/qpid/client/MessageListener.cpp b/qpid/cpp/src/qpid/client/MessageListener.cpp index f3bcb24c1a..756f12efef 100644 --- a/qpid/cpp/src/qpid/client/MessageListener.cpp +++ b/qpid/cpp/src/qpid/client/MessageListener.cpp @@ -16,6 +16,6 @@ * */ -#include "qpid/client/MessageListener.h" +#include <qpid/client/MessageListener.h> qpid::client::MessageListener::~MessageListener() {} diff --git a/qpid/cpp/src/qpid/client/MessageListener.h b/qpid/cpp/src/qpid/client/MessageListener.h index a28e26a8d2..a249af7f01 100644 --- a/qpid/cpp/src/qpid/client/MessageListener.h +++ b/qpid/cpp/src/qpid/client/MessageListener.h @@ -20,7 +20,7 @@ #ifndef _MessageListener_ #define _MessageListener_ -#include "qpid/client/Message.h" +#include <qpid/client/Message.h> namespace qpid { namespace client { diff --git a/qpid/cpp/src/qpid/client/Queue.cpp b/qpid/cpp/src/qpid/client/Queue.cpp index dc752c9fb2..fdbf1acf88 100644 --- a/qpid/cpp/src/qpid/client/Queue.cpp +++ b/qpid/cpp/src/qpid/client/Queue.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/client/Queue.h" +#include <qpid/client/Queue.h> qpid::client::Queue::Queue() : name(""), autodelete(true), exclusive(true){} diff --git a/qpid/cpp/src/qpid/client/ResponseHandler.cpp b/qpid/cpp/src/qpid/client/ResponseHandler.cpp index 5d2e03c9d9..2e097741fa 100644 --- a/qpid/cpp/src/qpid/client/ResponseHandler.cpp +++ b/qpid/cpp/src/qpid/client/ResponseHandler.cpp @@ -15,9 +15,9 @@ * limitations under the License. * */ -#include "qpid/client/ResponseHandler.h" -#include "qpid/sys/Monitor.h" -#include "qpid/QpidError.h" +#include <qpid/client/ResponseHandler.h> +#include <qpid/sys/Monitor.h> +#include <qpid/QpidError.h> using namespace qpid::sys; diff --git a/qpid/cpp/src/qpid/client/ResponseHandler.h b/qpid/cpp/src/qpid/client/ResponseHandler.h index 247c974c14..2559bfb688 100644 --- a/qpid/cpp/src/qpid/client/ResponseHandler.h +++ b/qpid/cpp/src/qpid/client/ResponseHandler.h @@ -16,7 +16,7 @@ * */ #include <string> -#include "qpid/framing/amqp_framing.h" +#include <qpid/framing/amqp_framing.h> #include <qpid/sys/Monitor.h> #ifndef _ResponseHandler_ diff --git a/qpid/cpp/src/qpid/client/ReturnedMessageHandler.cpp b/qpid/cpp/src/qpid/client/ReturnedMessageHandler.cpp index ca6fba2408..7dba78512d 100644 --- a/qpid/cpp/src/qpid/client/ReturnedMessageHandler.cpp +++ b/qpid/cpp/src/qpid/client/ReturnedMessageHandler.cpp @@ -16,6 +16,6 @@ * */ -#include "qpid/client/ReturnedMessageHandler.h" +#include <qpid/client/ReturnedMessageHandler.h> qpid::client::ReturnedMessageHandler::~ReturnedMessageHandler() {} diff --git a/qpid/cpp/src/qpid/client/ReturnedMessageHandler.h b/qpid/cpp/src/qpid/client/ReturnedMessageHandler.h index 5a4c4d5d1b..115f29bc15 100644 --- a/qpid/cpp/src/qpid/client/ReturnedMessageHandler.h +++ b/qpid/cpp/src/qpid/client/ReturnedMessageHandler.h @@ -20,7 +20,7 @@ #ifndef _ReturnedMessageHandler_ #define _ReturnedMessageHandler_ -#include "qpid/client/Message.h" +#include <qpid/client/Message.h> namespace qpid { namespace client { diff --git a/qpid/cpp/src/qpid/framing/AMQBody.cpp b/qpid/cpp/src/qpid/framing/AMQBody.cpp index 850635af15..5a09979ada 100644 --- a/qpid/cpp/src/qpid/framing/AMQBody.cpp +++ b/qpid/cpp/src/qpid/framing/AMQBody.cpp @@ -16,7 +16,7 @@ * */ -#include "qpid/framing/AMQBody.h" +#include <qpid/framing/AMQBody.h> #include <iostream> std::ostream& qpid::framing::operator<<(std::ostream& out, const qpid::framing::AMQBody& body) diff --git a/qpid/cpp/src/qpid/framing/AMQBody.h b/qpid/cpp/src/qpid/framing/AMQBody.h index be06e43388..5d2c2de115 100644 --- a/qpid/cpp/src/qpid/framing/AMQBody.h +++ b/qpid/cpp/src/qpid/framing/AMQBody.h @@ -16,8 +16,8 @@ * */ #include <boost/shared_ptr.hpp> -#include "qpid/framing/amqp_types.h" -#include "qpid/framing/Buffer.h" +#include <qpid/framing/amqp_types.h> +#include <qpid/framing/Buffer.h> #ifndef _AMQBody_ #define _AMQBody_ diff --git a/qpid/cpp/src/qpid/framing/AMQContentBody.cpp b/qpid/cpp/src/qpid/framing/AMQContentBody.cpp index 16a9e492ab..976731f0d7 100644 --- a/qpid/cpp/src/qpid/framing/AMQContentBody.cpp +++ b/qpid/cpp/src/qpid/framing/AMQContentBody.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/framing/AMQContentBody.h" +#include <qpid/framing/AMQContentBody.h> #include <iostream> qpid::framing::AMQContentBody::AMQContentBody(){ diff --git a/qpid/cpp/src/qpid/framing/AMQContentBody.h b/qpid/cpp/src/qpid/framing/AMQContentBody.h index 0aa1325642..91b243800f 100644 --- a/qpid/cpp/src/qpid/framing/AMQContentBody.h +++ b/qpid/cpp/src/qpid/framing/AMQContentBody.h @@ -15,9 +15,9 @@ * limitations under the License. * */ -#include "qpid/framing/amqp_types.h" -#include "qpid/framing/AMQBody.h" -#include "qpid/framing/Buffer.h" +#include <qpid/framing/amqp_types.h> +#include <qpid/framing/AMQBody.h> +#include <qpid/framing/Buffer.h> #ifndef _AMQContentBody_ #define _AMQContentBody_ diff --git a/qpid/cpp/src/qpid/framing/AMQDataBlock.h b/qpid/cpp/src/qpid/framing/AMQDataBlock.h index bdb4f55796..c869d2c048 100644 --- a/qpid/cpp/src/qpid/framing/AMQDataBlock.h +++ b/qpid/cpp/src/qpid/framing/AMQDataBlock.h @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/framing/Buffer.h" +#include <qpid/framing/Buffer.h> #ifndef _AMQDataBlock_ #define _AMQDataBlock_ diff --git a/qpid/cpp/src/qpid/framing/AMQFrame.cpp b/qpid/cpp/src/qpid/framing/AMQFrame.cpp index 2d89a8a797..58adcb5233 100644 --- a/qpid/cpp/src/qpid/framing/AMQFrame.cpp +++ b/qpid/cpp/src/qpid/framing/AMQFrame.cpp @@ -16,8 +16,8 @@ * limitations under the License. * */ -#include "qpid/framing/AMQFrame.h" -#include "qpid/QpidError.h" +#include <qpid/framing/AMQFrame.h> +#include <qpid/QpidError.h> using namespace qpid::framing; diff --git a/qpid/cpp/src/qpid/framing/AMQFrame.h b/qpid/cpp/src/qpid/framing/AMQFrame.h index 6f05aef584..2c086b4cb3 100644 --- a/qpid/cpp/src/qpid/framing/AMQFrame.h +++ b/qpid/cpp/src/qpid/framing/AMQFrame.h @@ -15,15 +15,15 @@ * limitations under the License. * */ -#include "qpid/framing/amqp_methods.h" -#include "qpid/framing/amqp_types.h" -#include "qpid/framing/AMQBody.h" -#include "qpid/framing/AMQDataBlock.h" -#include "qpid/framing/AMQMethodBody.h" -#include "qpid/framing/AMQHeaderBody.h" -#include "qpid/framing/AMQContentBody.h" -#include "qpid/framing/AMQHeartbeatBody.h" -#include "qpid/framing/Buffer.h" +#include <qpid/framing/amqp_methods.h> +#include <qpid/framing/amqp_types.h> +#include <qpid/framing/AMQBody.h> +#include <qpid/framing/AMQDataBlock.h> +#include <qpid/framing/AMQMethodBody.h> +#include <qpid/framing/AMQHeaderBody.h> +#include <qpid/framing/AMQContentBody.h> +#include <qpid/framing/AMQHeartbeatBody.h> +#include <qpid/framing/Buffer.h> #ifndef _AMQFrame_ #define _AMQFrame_ diff --git a/qpid/cpp/src/qpid/framing/AMQHeaderBody.cpp b/qpid/cpp/src/qpid/framing/AMQHeaderBody.cpp index 6bb24e67c7..0693456bf3 100644 --- a/qpid/cpp/src/qpid/framing/AMQHeaderBody.cpp +++ b/qpid/cpp/src/qpid/framing/AMQHeaderBody.cpp @@ -15,9 +15,9 @@ * limitations under the License. * */ -#include "qpid/framing/AMQHeaderBody.h" -#include "qpid/QpidError.h" -#include "qpid/framing/BasicHeaderProperties.h" +#include <qpid/framing/AMQHeaderBody.h> +#include <qpid/QpidError.h> +#include <qpid/framing/BasicHeaderProperties.h> qpid::framing::AMQHeaderBody::AMQHeaderBody(int classId) : weight(0), contentSize(0){ createProperties(classId); diff --git a/qpid/cpp/src/qpid/framing/AMQHeaderBody.h b/qpid/cpp/src/qpid/framing/AMQHeaderBody.h index 422a473200..07c4300e7e 100644 --- a/qpid/cpp/src/qpid/framing/AMQHeaderBody.h +++ b/qpid/cpp/src/qpid/framing/AMQHeaderBody.h @@ -15,10 +15,10 @@ * limitations under the License. * */ -#include "qpid/framing/amqp_types.h" -#include "qpid/framing/AMQBody.h" -#include "qpid/framing/Buffer.h" -#include "qpid/framing/HeaderProperties.h" +#include <qpid/framing/amqp_types.h> +#include <qpid/framing/AMQBody.h> +#include <qpid/framing/Buffer.h> +#include <qpid/framing/HeaderProperties.h> #ifndef _AMQHeaderBody_ #define _AMQHeaderBody_ diff --git a/qpid/cpp/src/qpid/framing/AMQHeartbeatBody.cpp b/qpid/cpp/src/qpid/framing/AMQHeartbeatBody.cpp index bcac68412b..6cdb9acd96 100644 --- a/qpid/cpp/src/qpid/framing/AMQHeartbeatBody.cpp +++ b/qpid/cpp/src/qpid/framing/AMQHeartbeatBody.cpp @@ -16,7 +16,7 @@ * */ -#include "qpid/framing/AMQHeartbeatBody.h" +#include <qpid/framing/AMQHeartbeatBody.h> #include <iostream> qpid::framing::AMQHeartbeatBody::~AMQHeartbeatBody() {} diff --git a/qpid/cpp/src/qpid/framing/AMQHeartbeatBody.h b/qpid/cpp/src/qpid/framing/AMQHeartbeatBody.h index 34222682e5..1f2c5c2fc6 100644 --- a/qpid/cpp/src/qpid/framing/AMQHeartbeatBody.h +++ b/qpid/cpp/src/qpid/framing/AMQHeartbeatBody.h @@ -15,9 +15,9 @@ * limitations under the License. * */ -#include "qpid/framing/amqp_types.h" -#include "qpid/framing/AMQBody.h" -#include "qpid/framing/Buffer.h" +#include <qpid/framing/amqp_types.h> +#include <qpid/framing/AMQBody.h> +#include <qpid/framing/Buffer.h> #ifndef _AMQHeartbeatBody_ #define _AMQHeartbeatBody_ diff --git a/qpid/cpp/src/qpid/framing/AMQMethodBody.cpp b/qpid/cpp/src/qpid/framing/AMQMethodBody.cpp index 803bab3517..59d5944f65 100644 --- a/qpid/cpp/src/qpid/framing/AMQMethodBody.cpp +++ b/qpid/cpp/src/qpid/framing/AMQMethodBody.cpp @@ -15,8 +15,8 @@ * limitations under the License. * */ -#include "qpid/framing/AMQMethodBody.h" -#include "qpid/QpidError.h" +#include <qpid/framing/AMQMethodBody.h> +#include <qpid/QpidError.h> void qpid::framing::AMQMethodBody::encode(Buffer& buffer) const{ buffer.putShort(amqpClassId()); diff --git a/qpid/cpp/src/qpid/framing/AMQMethodBody.h b/qpid/cpp/src/qpid/framing/AMQMethodBody.h index 59b297f19e..cb656199fa 100644 --- a/qpid/cpp/src/qpid/framing/AMQMethodBody.h +++ b/qpid/cpp/src/qpid/framing/AMQMethodBody.h @@ -16,10 +16,10 @@ * */ #include <iostream> -#include "qpid/framing/amqp_types.h" -#include "qpid/framing/AMQBody.h" -#include "qpid/framing/Buffer.h" -#include "qpid/framing/AMQP_ServerOperations.h" +#include <qpid/framing/amqp_types.h> +#include <qpid/framing/AMQBody.h> +#include <qpid/framing/Buffer.h> +#include <qpid/framing/AMQP_ServerOperations.h> #ifndef _AMQMethodBody_ #define _AMQMethodBody_ diff --git a/qpid/cpp/src/qpid/framing/BasicHeaderProperties.cpp b/qpid/cpp/src/qpid/framing/BasicHeaderProperties.cpp index 94e2ff3914..80221e2787 100644 --- a/qpid/cpp/src/qpid/framing/BasicHeaderProperties.cpp +++ b/qpid/cpp/src/qpid/framing/BasicHeaderProperties.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/framing/BasicHeaderProperties.h" +#include <qpid/framing/BasicHeaderProperties.h> //TODO: This could be easily generated from the spec diff --git a/qpid/cpp/src/qpid/framing/BasicHeaderProperties.h b/qpid/cpp/src/qpid/framing/BasicHeaderProperties.h index 3450782875..45539ca801 100644 --- a/qpid/cpp/src/qpid/framing/BasicHeaderProperties.h +++ b/qpid/cpp/src/qpid/framing/BasicHeaderProperties.h @@ -15,10 +15,10 @@ * limitations under the License. * */ -#include "qpid/framing/amqp_types.h" -#include "qpid/framing/amqp_methods.h" -#include "qpid/framing/Buffer.h" -#include "qpid/framing/HeaderProperties.h" +#include <qpid/framing/amqp_types.h> +#include <qpid/framing/amqp_methods.h> +#include <qpid/framing/Buffer.h> +#include <qpid/framing/HeaderProperties.h> #ifndef _BasicHeaderProperties_ #define _BasicHeaderProperties_ diff --git a/qpid/cpp/src/qpid/framing/BodyHandler.cpp b/qpid/cpp/src/qpid/framing/BodyHandler.cpp index 77e68cf313..f43fbb3976 100644 --- a/qpid/cpp/src/qpid/framing/BodyHandler.cpp +++ b/qpid/cpp/src/qpid/framing/BodyHandler.cpp @@ -16,7 +16,7 @@ * */ #include <boost/shared_ptr.hpp> -#include "qpid/framing/BodyHandler.h" +#include <qpid/framing/BodyHandler.h> using namespace qpid::framing; using namespace boost; diff --git a/qpid/cpp/src/qpid/framing/BodyHandler.h b/qpid/cpp/src/qpid/framing/BodyHandler.h index 0cd7f7fa11..280b449189 100644 --- a/qpid/cpp/src/qpid/framing/BodyHandler.h +++ b/qpid/cpp/src/qpid/framing/BodyHandler.h @@ -20,10 +20,10 @@ #ifndef _BodyHandler_ #define _BodyHandler_ -#include "qpid/framing/AMQMethodBody.h" -#include "qpid/framing/AMQHeaderBody.h" -#include "qpid/framing/AMQContentBody.h" -#include "qpid/framing/AMQHeartbeatBody.h" +#include <qpid/framing/AMQMethodBody.h> +#include <qpid/framing/AMQHeaderBody.h> +#include <qpid/framing/AMQContentBody.h> +#include <qpid/framing/AMQHeartbeatBody.h> namespace qpid { namespace framing { diff --git a/qpid/cpp/src/qpid/framing/Buffer.cpp b/qpid/cpp/src/qpid/framing/Buffer.cpp index 05e9be83a9..d14d51bb7a 100644 --- a/qpid/cpp/src/qpid/framing/Buffer.cpp +++ b/qpid/cpp/src/qpid/framing/Buffer.cpp @@ -15,8 +15,8 @@ * limitations under the License. * */ -#include "qpid/framing/Buffer.h" -#include "qpid/framing/FieldTable.h" +#include <qpid/framing/Buffer.h> +#include <qpid/framing/FieldTable.h> qpid::framing::Buffer::Buffer(u_int32_t _size) : size(_size), owner(true), position(0), limit(_size){ data = new char[size]; diff --git a/qpid/cpp/src/qpid/framing/Buffer.h b/qpid/cpp/src/qpid/framing/Buffer.h index 8eb92a1d27..8ae4c38a9c 100644 --- a/qpid/cpp/src/qpid/framing/Buffer.h +++ b/qpid/cpp/src/qpid/framing/Buffer.h @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/framing/amqp_types.h" +#include <qpid/framing/amqp_types.h> #ifndef _Buffer_ #define _Buffer_ diff --git a/qpid/cpp/src/qpid/framing/FieldTable.cpp b/qpid/cpp/src/qpid/framing/FieldTable.cpp index b4b245292f..faf4563f6a 100644 --- a/qpid/cpp/src/qpid/framing/FieldTable.cpp +++ b/qpid/cpp/src/qpid/framing/FieldTable.cpp @@ -15,10 +15,10 @@ * limitations under the License. * */ -#include "qpid/framing/FieldTable.h" -#include "qpid/QpidError.h" -#include "qpid/framing/Buffer.h" -#include "qpid/framing/Value.h" +#include <qpid/framing/FieldTable.h> +#include <qpid/QpidError.h> +#include <qpid/framing/Buffer.h> +#include <qpid/framing/Value.h> #include <assert.h> namespace qpid { diff --git a/qpid/cpp/src/qpid/framing/FieldTable.h b/qpid/cpp/src/qpid/framing/FieldTable.h index 6b4d9266c1..d2eb855295 100644 --- a/qpid/cpp/src/qpid/framing/FieldTable.h +++ b/qpid/cpp/src/qpid/framing/FieldTable.h @@ -19,7 +19,7 @@ #include <vector> #include <boost/shared_ptr.hpp> #include <map> -#include "qpid/framing/amqp_types.h" +#include <qpid/framing/amqp_types.h> #ifndef _FieldTable_ #define _FieldTable_ diff --git a/qpid/cpp/src/qpid/framing/HeaderProperties.h b/qpid/cpp/src/qpid/framing/HeaderProperties.h index a699c37163..620086fc44 100644 --- a/qpid/cpp/src/qpid/framing/HeaderProperties.h +++ b/qpid/cpp/src/qpid/framing/HeaderProperties.h @@ -15,8 +15,8 @@ * limitations under the License. * */ -#include "qpid/framing/amqp_types.h" -#include "qpid/framing/Buffer.h" +#include <qpid/framing/amqp_types.h> +#include <qpid/framing/Buffer.h> #ifndef _HeaderProperties_ #define _HeaderProperties_ diff --git a/qpid/cpp/src/qpid/framing/InitiationHandler.cpp b/qpid/cpp/src/qpid/framing/InitiationHandler.cpp index 7a15864216..7c083ca4ee 100644 --- a/qpid/cpp/src/qpid/framing/InitiationHandler.cpp +++ b/qpid/cpp/src/qpid/framing/InitiationHandler.cpp @@ -16,6 +16,6 @@ * */ -#include "qpid/framing/InitiationHandler.h" +#include <qpid/framing/InitiationHandler.h> qpid::framing::InitiationHandler::~InitiationHandler() {} diff --git a/qpid/cpp/src/qpid/framing/InitiationHandler.h b/qpid/cpp/src/qpid/framing/InitiationHandler.h index da902f0dff..d8f6790eee 100644 --- a/qpid/cpp/src/qpid/framing/InitiationHandler.h +++ b/qpid/cpp/src/qpid/framing/InitiationHandler.h @@ -20,7 +20,7 @@ #ifndef _InitiationHandler_ #define _InitiationHandler_ -#include "qpid/framing/ProtocolInitiation.h" +#include <qpid/framing/ProtocolInitiation.h> namespace qpid { namespace framing { diff --git a/qpid/cpp/src/qpid/framing/InputHandler.h b/qpid/cpp/src/qpid/framing/InputHandler.h index ef9827283c..ddfb210f4d 100644 --- a/qpid/cpp/src/qpid/framing/InputHandler.h +++ b/qpid/cpp/src/qpid/framing/InputHandler.h @@ -18,7 +18,7 @@ * */ -#include "qpid/framing/AMQFrame.h" +#include <qpid/framing/AMQFrame.h> #include <boost/noncopyable.hpp> namespace qpid { diff --git a/qpid/cpp/src/qpid/framing/OutputHandler.h b/qpid/cpp/src/qpid/framing/OutputHandler.h index b5554bba78..5fa0477572 100644 --- a/qpid/cpp/src/qpid/framing/OutputHandler.h +++ b/qpid/cpp/src/qpid/framing/OutputHandler.h @@ -19,7 +19,7 @@ * */ #include <boost/noncopyable.hpp> -#include "qpid/framing/AMQFrame.h" +#include <qpid/framing/AMQFrame.h> namespace qpid { namespace framing { diff --git a/qpid/cpp/src/qpid/framing/ProtocolInitiation.cpp b/qpid/cpp/src/qpid/framing/ProtocolInitiation.cpp index 23e2a24355..05a668bdce 100644 --- a/qpid/cpp/src/qpid/framing/ProtocolInitiation.cpp +++ b/qpid/cpp/src/qpid/framing/ProtocolInitiation.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/framing/ProtocolInitiation.h" +#include <qpid/framing/ProtocolInitiation.h> qpid::framing::ProtocolInitiation::ProtocolInitiation(){} diff --git a/qpid/cpp/src/qpid/framing/ProtocolInitiation.h b/qpid/cpp/src/qpid/framing/ProtocolInitiation.h index 7ce6af4a39..9eac25fa10 100644 --- a/qpid/cpp/src/qpid/framing/ProtocolInitiation.h +++ b/qpid/cpp/src/qpid/framing/ProtocolInitiation.h @@ -15,10 +15,10 @@ * limitations under the License. * */ -#include "qpid/framing/amqp_types.h" -#include "qpid/framing/Buffer.h" -#include "qpid/framing/AMQDataBlock.h" -#include "qpid/framing/ProtocolVersion.h" +#include <qpid/framing/amqp_types.h> +#include <qpid/framing/Buffer.h> +#include <qpid/framing/AMQDataBlock.h> +#include <qpid/framing/ProtocolVersion.h> #ifndef _ProtocolInitiation_ #define _ProtocolInitiation_ diff --git a/qpid/cpp/src/qpid/framing/ProtocolVersion.cpp b/qpid/cpp/src/qpid/framing/ProtocolVersion.cpp index 62fb11590e..c537ac46af 100644 --- a/qpid/cpp/src/qpid/framing/ProtocolVersion.cpp +++ b/qpid/cpp/src/qpid/framing/ProtocolVersion.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/framing/ProtocolVersion.h" +#include <qpid/framing/ProtocolVersion.h> #include <sstream> using namespace qpid::framing; diff --git a/qpid/cpp/src/qpid/framing/ProtocolVersion.h b/qpid/cpp/src/qpid/framing/ProtocolVersion.h index 25cf469943..6d6a4f6c4c 100644 --- a/qpid/cpp/src/qpid/framing/ProtocolVersion.h +++ b/qpid/cpp/src/qpid/framing/ProtocolVersion.h @@ -18,7 +18,7 @@ #ifndef _ProtocolVersion_ #define _ProtocolVersion_ -#include "qpid/framing/amqp_types.h" +#include <qpid/framing/amqp_types.h> namespace qpid { diff --git a/qpid/cpp/src/qpid/framing/ProtocolVersionException.cpp b/qpid/cpp/src/qpid/framing/ProtocolVersionException.cpp index 0ba500aad8..af31c6fbbb 100644 --- a/qpid/cpp/src/qpid/framing/ProtocolVersionException.cpp +++ b/qpid/cpp/src/qpid/framing/ProtocolVersionException.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/framing/ProtocolVersionException.h" +#include <qpid/framing/ProtocolVersionException.h> #include <sstream> using namespace qpid::framing; diff --git a/qpid/cpp/src/qpid/framing/ProtocolVersionException.h b/qpid/cpp/src/qpid/framing/ProtocolVersionException.h index 7decd8bcc6..66c4ea3e91 100644 --- a/qpid/cpp/src/qpid/framing/ProtocolVersionException.h +++ b/qpid/cpp/src/qpid/framing/ProtocolVersionException.h @@ -19,8 +19,8 @@ #ifndef _ProtocolVersionException_ #define _ProtocolVersionException_ -#include "qpid/Exception.h" -#include "qpid/framing/ProtocolVersion.h" +#include <qpid/Exception.h> +#include <qpid/framing/ProtocolVersion.h> #include <string> #include <vector> diff --git a/qpid/cpp/src/qpid/framing/Value.cpp b/qpid/cpp/src/qpid/framing/Value.cpp index 4a24ab4147..bcd5ff9c19 100644 --- a/qpid/cpp/src/qpid/framing/Value.cpp +++ b/qpid/cpp/src/qpid/framing/Value.cpp @@ -15,10 +15,10 @@ * limitations under the License. * */ -#include "qpid/framing/Value.h" -#include "qpid/framing/Buffer.h" -#include "qpid/framing/FieldTable.h" -#include "qpid/QpidError.h" +#include <qpid/framing/Value.h> +#include <qpid/framing/Buffer.h> +#include <qpid/framing/FieldTable.h> +#include <qpid/QpidError.h> namespace qpid { namespace framing { diff --git a/qpid/cpp/src/qpid/framing/Value.h b/qpid/cpp/src/qpid/framing/Value.h index 3c538719db..843745943a 100644 --- a/qpid/cpp/src/qpid/framing/Value.h +++ b/qpid/cpp/src/qpid/framing/Value.h @@ -17,8 +17,8 @@ */ #include <iostream> #include <vector> -#include "qpid/framing/amqp_types.h" -#include "qpid/framing/FieldTable.h" +#include <qpid/framing/amqp_types.h> +#include <qpid/framing/FieldTable.h> #ifndef _Value_ #define _Value_ diff --git a/qpid/cpp/src/qpid/framing/amqp_framing.h b/qpid/cpp/src/qpid/framing/amqp_framing.h index 34ebf665e7..605b341277 100644 --- a/qpid/cpp/src/qpid/framing/amqp_framing.h +++ b/qpid/cpp/src/qpid/framing/amqp_framing.h @@ -15,17 +15,17 @@ * limitations under the License. * */ -#include "qpid/framing/amqp_types.h" -#include "qpid/framing/AMQFrame.h" -#include "qpid/framing/AMQBody.h" -#include "qpid/framing/BodyHandler.h" -#include "qpid/framing/AMQMethodBody.h" -#include "qpid/framing/AMQHeaderBody.h" -#include "qpid/framing/AMQContentBody.h" -#include "qpid/framing/AMQHeartbeatBody.h" -#include "qpid/framing/amqp_methods.h" -#include "qpid/framing/InputHandler.h" -#include "qpid/framing/OutputHandler.h" -#include "qpid/framing/InitiationHandler.h" -#include "qpid/framing/ProtocolInitiation.h" -#include "qpid/framing/BasicHeaderProperties.h" +#include <qpid/framing/amqp_types.h> +#include <qpid/framing/AMQFrame.h> +#include <qpid/framing/AMQBody.h> +#include <qpid/framing/BodyHandler.h> +#include <qpid/framing/AMQMethodBody.h> +#include <qpid/framing/AMQHeaderBody.h> +#include <qpid/framing/AMQContentBody.h> +#include <qpid/framing/AMQHeartbeatBody.h> +#include <qpid/framing/amqp_methods.h> +#include <qpid/framing/InputHandler.h> +#include <qpid/framing/OutputHandler.h> +#include <qpid/framing/InitiationHandler.h> +#include <qpid/framing/ProtocolInitiation.h> +#include <qpid/framing/BasicHeaderProperties.h> diff --git a/qpid/cpp/src/qpid/posix/PosixAcceptor.cpp b/qpid/cpp/src/qpid/posix/PosixAcceptor.cpp new file mode 100644 index 0000000000..da9a25db67 --- /dev/null +++ b/qpid/cpp/src/qpid/posix/PosixAcceptor.cpp @@ -0,0 +1,45 @@ +/* + * + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed 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 <qpid/sys/Acceptor.h> +#include <qpid/Exception.h> + +namespace qpid { +namespace sys { + +namespace { +void fail() { throw qpid::Exception("PosixAcceptor not implemented"); } +} + +class PosixAcceptor : public Acceptor { + public: + virtual int16_t getPort() const { fail(); return 0; } + virtual void run(qpid::sys::SessionHandlerFactory* ) { fail(); } + virtual void shutdown() { fail(); } +}; + +// Define generic Acceptor::create() to return APRAcceptor. +Acceptor::shared_ptr Acceptor::create(int16_t , int, int ) +{ + return Acceptor::shared_ptr(new PosixAcceptor()); +} + +// Must define Acceptor virtual dtor. +Acceptor::~Acceptor() {} + +}} diff --git a/qpid/cpp/src/qpid/posix/Socket.cpp b/qpid/cpp/src/qpid/posix/Socket.cpp new file mode 100644 index 0000000000..0c03587406 --- /dev/null +++ b/qpid/cpp/src/qpid/posix/Socket.cpp @@ -0,0 +1,87 @@ +/* + * + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed 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 <sys/socket.h> +#include <netinet/in.h> +#include <netdb.h> + +#include <boost/format.hpp> + +#include <qpid/QpidError.h> +#include <qpid/posix/check.h> +#include <qpid/sys/Socket.h> + +using namespace qpid::sys; + +Socket::Socket() : socket(::socket (PF_INET, SOCK_STREAM, 0)) +{ + if (socket == 0) CHECK(-1); +} + +void +Socket::setTimeout(long msecs) +{ + struct timeval tv; + tv.tv_sec = msecs / 1000; + tv.tv_usec = (msecs % 1000)*1000; + setsockopt(socket, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv)); + setsockopt(socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)); +} + +void +Socket::connect(const std::string& host, int port) +{ + struct sockaddr_in name; + name.sin_family = AF_INET; + name.sin_port = htons(port); + struct hostent* hp = gethostbyname ( host.c_str() ); + if (hp == 0) CHECK(-1); // TODO aconway 2006-11-09: error message? + memcpy(&name.sin_addr.s_addr, hp->h_addr_list[0], hp->h_length); + CHECK(::connect(socket, (struct sockaddr*)(&name), sizeof(name))); +} + +void +Socket::close() +{ + if (socket == 0) return; + CHECK(::close(socket)); + socket = 0; +} + +ssize_t +Socket::send(const char* data, size_t size) +{ + ssize_t sent = ::send(socket, data, size, 0); + if (sent < 0) { + if (errno == ECONNRESET) return SOCKET_EOF; + if (errno == ETIMEDOUT) return SOCKET_TIMEOUT; + CHECK(sent); + } + return sent; +} + +ssize_t +Socket::recv(char* data, size_t size) +{ + ssize_t received = ::recv(socket, data, size, 0); + if (received < 0) { + if (errno == ETIMEDOUT) return SOCKET_TIMEOUT; + CHECK(received); + } + return received; +} diff --git a/qpid/cpp/src/qpid/sys/platform.h b/qpid/cpp/src/qpid/posix/Thread.cpp index 878c724953..fdd5f498db 100644 --- a/qpid/cpp/src/qpid/sys/platform.h +++ b/qpid/cpp/src/qpid/posix/Thread.cpp @@ -1,6 +1,3 @@ -#ifndef _sys_platform_h -#define _sys_platform_h - /* * * Copyright (c) 2006 The Apache Software Foundation @@ -19,11 +16,10 @@ * */ -/** - * Macros for including platform-specific headers and aliasing - * platform-specific classes into the qpid::sys namespace. - */ - -#define QPID_PLATFORM_H(HEADER) <qpid/PLATFORM/HEADER> +#include <qpid/sys/Thread.h> -#endif /*!_sys_platform_h*/ +void* qpid::sys::Thread::runRunnable(void* p) +{ + static_cast<Runnable*>(p)->run(); + return 0; +} diff --git a/qpid/cpp/src/qpid/apr/Thread.h b/qpid/cpp/src/qpid/posix/check.cpp index 0c717dea70..cf6ad81376 100644 --- a/qpid/cpp/src/qpid/apr/Thread.h +++ b/qpid/cpp/src/qpid/posix/check.cpp @@ -1,6 +1,3 @@ -#ifndef _apr_Thread_h -#define _apr_Thread_h - /* * * Copyright (c) 2006 The Apache Software Foundation @@ -19,27 +16,13 @@ * */ -#include <apr-1/apr_thread_proc.h> -#include <qpid/sys/Runnable.h> - -namespace qpid { -namespace sys { - -class Thread -{ - - public: - Thread(); - explicit Thread(qpid::sys::Runnable*); - void join(); - static Thread current(); - - private: - Thread(apr_thread_t*); - - apr_thread_t* thread; -}; - -}} +#include <qpid/QpidError.h> +#include "check.h" -#endif /*!_apr_Thread_h*/ +void qpid::sys::check(long result, const char* file, const int line) { + if (result != 0) { + char buf[512]; + char* msg = strerror_r(errno, buf, sizeof(buf)); + throw QpidError(errno, msg, file, line); + } +} diff --git a/qpid/cpp/src/qpid/apr/Time.cpp b/qpid/cpp/src/qpid/posix/check.h index 8b5590481d..2943188f98 100644 --- a/qpid/cpp/src/qpid/apr/Time.cpp +++ b/qpid/cpp/src/qpid/posix/check.h @@ -1,3 +1,6 @@ +#ifndef _posix_check_h +#define _posix_check_h + /* * * Copyright (c) 2006 The Apache Software Foundation @@ -16,24 +19,16 @@ * */ -#include <qpid/sys/Time.h> -#include "apr-1/apr_time.h" +#include <errno.h> namespace qpid { namespace sys { -int64_t getTimeNsecs() -{ - // APR returns microseconds. - return apr_time_now() * 1000; -} - -int64_t getTimeMsecs() -{ - // APR returns microseconds. - return apr_time_now() / 1000; -} +void check(long result, const char* file, const int line); +#define CHECK(N) qpid::sys::check(N, __FILE__, __LINE__) }} + +#endif /*!_posix_check_h*/ diff --git a/qpid/cpp/src/qpid/sys/Acceptor.h b/qpid/cpp/src/qpid/sys/Acceptor.h index c192cae811..aaced4a673 100644 --- a/qpid/cpp/src/qpid/sys/Acceptor.h +++ b/qpid/cpp/src/qpid/sys/Acceptor.h @@ -19,8 +19,26 @@ * */ -#include "platform.h" -#include QPID_PLATFORM_H(Acceptor.h) +#include <stdint.h> +#include <qpid/SharedObject.h> +namespace qpid { +namespace sys { +class SessionHandlerFactory; + +class Acceptor : public qpid::SharedObject<Acceptor> +{ + public: + static Acceptor::shared_ptr create(int16_t port, int backlog, int threads); + virtual ~Acceptor() = 0; + virtual int16_t getPort() const = 0; + virtual void run(qpid::sys::SessionHandlerFactory* factory) = 0; + virtual void shutdown() = 0; +}; + +}} + + + #endif /*!_sys_Acceptor_h*/ diff --git a/qpid/cpp/src/qpid/sys/Monitor.h b/qpid/cpp/src/qpid/sys/Monitor.h index 7d7b7ac0cf..f5810fb6a7 100644 --- a/qpid/cpp/src/qpid/sys/Monitor.h +++ b/qpid/cpp/src/qpid/sys/Monitor.h @@ -19,7 +19,209 @@ * */ -#include <qpid/sys/platform.h> -#include QPID_PLATFORM_H(Monitor.h) +#include <boost/noncopyable.hpp> +#ifdef USE_APR +# include <apr-1/apr_thread_mutex.h> +# include <apr-1/apr_thread_cond.h> +# include <qpid/apr/APRBase.h> +# include <qpid/apr/APRPool.h> +#else +# include <pthread.h> +# include <qpid/sys/Time.h> +# include <qpid/posix/check.h> +#endif + +namespace qpid { +namespace sys { + +template <class L> +class ScopedLock +{ + public: + ScopedLock(L& l) : mutex(l) { l.lock(); } + ~ScopedLock() { mutex.unlock(); } + private: + L& mutex; +}; + + +class Mutex : private boost::noncopyable +{ + public: + typedef ScopedLock<Mutex> ScopedLock; + + inline Mutex(); + inline ~Mutex(); + inline void lock(); + inline void unlock(); + inline void trylock(); + + protected: +#ifdef USE_APR + apr_thread_mutex_t* mutex; +#else + pthread_mutex_t mutex; +#endif +}; + +/** A condition variable and a mutex */ +class Monitor : public Mutex +{ + public: + inline Monitor(); + inline ~Monitor(); + inline void wait(); + inline bool wait(int64_t nsecs); + inline void notify(); + inline void notifyAll(); + + private: +#ifdef USE_APR + apr_thread_cond_t* condition; +#else + pthread_cond_t condition; +#endif +}; + + +// APR ================================================================ +#ifdef USE_APR + +Mutex::Mutex() { + CHECK_APR_SUCCESS(apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_NESTED, APRPool::get())); +} + +Mutex::~Mutex(){ + CHECK_APR_SUCCESS(apr_thread_mutex_destroy(mutex)); +} + +void Mutex::lock() { + CHECK_APR_SUCCESS(apr_thread_mutex_lock(mutex)); +} +void Mutex::unlock() { + CHECK_APR_SUCCESS(apr_thread_mutex_unlock(mutex)); +} + +void Mutex::trylock() { + CHECK_APR_SUCCESS(apr_thread_mutex_trylock(mutex)); +} + +Monitor::Monitor() { + CHECK_APR_SUCCESS(apr_thread_cond_create(&condition, APRPool::get())); +} + +Monitor::~Monitor() { + CHECK_APR_SUCCESS(apr_thread_cond_destroy(condition)); +} + +void Monitor::wait() { + CHECK_APR_SUCCESS(apr_thread_cond_wait(condition, mutex)); +} + +bool Monitor::wait(int64_t nsecs){ + // APR uses microseconds. + apr_status_t status = apr_thread_cond_timedwait( + condition, mutex, nsecs/1000); + if(status != APR_TIMEUP) CHECK_APR_SUCCESS(status); + return status == 0; +} + +void Monitor::notify(){ + CHECK_APR_SUCCESS(apr_thread_cond_signal(condition)); +} + +void Monitor::notifyAll(){ + CHECK_APR_SUCCESS(apr_thread_cond_broadcast(condition)); +} + + +}} + + +// POSIX ================================================================ +#else +/** + * PODMutex is a POD, can be static-initialized with + * PODMutex m = QPID_PODMUTEX_INITIALIZER + */ +struct PODMutex +{ + typedef ScopedLock<PODMutex> ScopedLock; + + inline void lock(); + inline void unlock(); + inline void trylock(); + + // Must be public to be a POD: + pthread_mutex_t mutex; +}; + +#define QPID_MUTEX_INITIALIZER { PTHREAD_MUTEX_INITIALIZER } + + +void PODMutex::lock() { + CHECK(pthread_mutex_lock(&mutex)); +} +void PODMutex::unlock() { + CHECK(pthread_mutex_unlock(&mutex)); +} + +void PODMutex::trylock() { + CHECK(pthread_mutex_trylock(&mutex)); +} + + +Mutex::Mutex() { + CHECK(pthread_mutex_init(&mutex, 0)); +} + +Mutex::~Mutex(){ + CHECK(pthread_mutex_destroy(&mutex)); +} + +void Mutex::lock() { + CHECK(pthread_mutex_lock(&mutex)); +} +void Mutex::unlock() { + CHECK(pthread_mutex_unlock(&mutex)); +} + +void Mutex::trylock() { + CHECK(pthread_mutex_trylock(&mutex)); +} + +Monitor::Monitor() { + CHECK(pthread_cond_init(&condition, 0)); +} + +Monitor::~Monitor() { + CHECK(pthread_cond_destroy(&condition)); +} + +void Monitor::wait() { + CHECK(pthread_cond_wait(&condition, &mutex)); +} + +bool Monitor::wait(int64_t nsecs){ + Time t(nsecs); + int status = pthread_cond_timedwait(&condition, &mutex, &t.getTimespec()); + if(status != 0) { + if (errno == ETIMEDOUT) return false; + CHECK(status); + } + return true; +} + +void Monitor::notify(){ + CHECK(pthread_cond_signal(&condition)); +} + +void Monitor::notifyAll(){ + CHECK(pthread_cond_broadcast(&condition)); +} + + +}} +#endif /*USE_APR*/ #endif /*!_sys_Monitor_h*/ diff --git a/qpid/cpp/src/qpid/sys/SessionContext.h b/qpid/cpp/src/qpid/sys/SessionContext.h index 1362b4f2f2..3beddaed8f 100644 --- a/qpid/cpp/src/qpid/sys/SessionContext.h +++ b/qpid/cpp/src/qpid/sys/SessionContext.h @@ -18,7 +18,7 @@ #ifndef _SessionContext_ #define _SessionContext_ -#include "qpid/framing/OutputHandler.h" +#include <qpid/framing/OutputHandler.h> namespace qpid { namespace sys { diff --git a/qpid/cpp/src/qpid/sys/SessionHandler.h b/qpid/cpp/src/qpid/sys/SessionHandler.h index 130e69caf4..ce8b51ad47 100644 --- a/qpid/cpp/src/qpid/sys/SessionHandler.h +++ b/qpid/cpp/src/qpid/sys/SessionHandler.h @@ -18,10 +18,10 @@ #ifndef _SessionHandler_ #define _SessionHandler_ -#include "qpid/framing/InputHandler.h" -#include "qpid/framing/InitiationHandler.h" -#include "qpid/framing/ProtocolInitiation.h" -#include "qpid/sys/TimeoutHandler.h" +#include <qpid/framing/InputHandler.h> +#include <qpid/framing/InitiationHandler.h> +#include <qpid/framing/ProtocolInitiation.h> +#include <qpid/sys/TimeoutHandler.h> namespace qpid { namespace sys { diff --git a/qpid/cpp/src/qpid/sys/Socket.h b/qpid/cpp/src/qpid/sys/Socket.h index 243764353e..9853d98496 100644 --- a/qpid/cpp/src/qpid/sys/Socket.h +++ b/qpid/cpp/src/qpid/sys/Socket.h @@ -19,9 +19,47 @@ * */ -#include <qpid/sys/platform.h> -#include QPID_PLATFORM_H(Socket.h) +#include <string> +#ifdef USE_APR +# include <apr-1/apr_network_io.h> +#endif + +namespace qpid { +namespace sys { + +class Socket +{ + public: + Socket(); + + /** Set timeout for read and write */ + void setTimeout(long msecs); + + void connect(const std::string& host, int port); + + void close(); + + enum { SOCKET_TIMEOUT=-2, SOCKET_EOF=-3 } ErrorCode; + + /** Returns bytes sent or an ErrorCode value < 0. */ + ssize_t send(const char* data, size_t size); + + /** + * Returns bytes received, an ErrorCode value < 0 or 0 + * if the connection closed in an orderly manner. + */ + ssize_t recv(char* data, size_t size); + + private: +#ifdef USE_APR + apr_socket_t* socket; +#else + int socket; +#endif +}; + +}} #endif /*!_sys_Socket_h*/ diff --git a/qpid/cpp/src/qpid/sys/Thread.h b/qpid/cpp/src/qpid/sys/Thread.h index d884add776..0cd7a5b2eb 100644 --- a/qpid/cpp/src/qpid/sys/Thread.h +++ b/qpid/cpp/src/qpid/sys/Thread.h @@ -19,9 +19,85 @@ * */ -#include <qpid/sys/platform.h> -#include QPID_PLATFORM_H(Thread.h) +#include <qpid/sys/Runnable.h> +#ifdef USE_APR +# include <apr-1/apr_thread_proc.h> +# include <apr-1/apr_portable.h> +# include <qpid/apr/APRPool.h> +# include <qpid/apr/APRBase.h> +#else +# include <qpid/posix/check.h> +# include <pthread.h> +#endif +namespace qpid { +namespace sys { + +class Thread +{ + public: + inline Thread(); + inline explicit Thread(qpid::sys::Runnable*); + inline void join(); + inline static Thread current(); + + private: +#ifdef USE_APR + static void* APR_THREAD_FUNC runRunnable(apr_thread_t* thread, void *data); + inline Thread(apr_thread_t* t); + apr_thread_t* thread; +#else + static void* runRunnable(void* runnable); + inline Thread(pthread_t); + pthread_t thread; +#endif +}; + + +Thread::Thread() : thread(0) {} + +// APR ================================================================ +#ifdef USE_APR + +Thread::Thread(Runnable* runnable) { + CHECK_APR_SUCCESS( + apr_thread_create(&thread, 0, runRunnable, runnable, APRPool::get())); +} + +void Thread::join(){ + apr_status_t status; + if (thread != 0) + CHECK_APR_SUCCESS(apr_thread_join(&status, thread)); +} + +Thread::Thread(apr_thread_t* t) : thread(t) {} + +Thread Thread::current(){ + apr_thread_t* thr; + apr_os_thread_t osthr = apr_os_thread_current(); + CHECK_APR_SUCCESS(apr_os_thread_put(&thr, &osthr, APRPool::get())); + return Thread(thr); +} + +// POSIX ================================================================ +#else + +Thread::Thread(Runnable* runnable) { + CHECK(pthread_create(&thread, NULL, runRunnable, runnable)); +} + +void Thread::join(){ + if (thread != 0) CHECK(pthread_join(thread, 0)); +} + +Thread::Thread(pthread_t thr) : thread(thr) {} + +Thread Thread::current() { + return Thread(pthread_self()); +} +#endif + +}} #endif /*!_sys_Thread_h*/ diff --git a/qpid/cpp/src/qpid/sys/Time.cpp b/qpid/cpp/src/qpid/sys/Time.cpp new file mode 100644 index 0000000000..f06bb3c2e2 --- /dev/null +++ b/qpid/cpp/src/qpid/sys/Time.cpp @@ -0,0 +1,60 @@ +/* + * + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed 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 "Time.h" + +namespace qpid { +namespace sys { + +// APR ================================================================ +#if USE_APR + +Time Time::now() { + return Time(apr_time_now(), NSEC_PER_USEC); +} + +void Time::set(int64_t ticks, long nsec_per_tick) { + time = (ticks * nsec_per_tick) / NSEC_PER_USEC; +} + +int64_t Time::nsecs() const { + return time * NSEC_PER_USEC; +} + +// POSIX================================================================ +#else + +Time Time::now() { + Time t; + clock_gettime(CLOCK_REALTIME, &t.time); + return t; +} + +void Time::set(int64_t ticks, long nsec_per_tick) { + int64_t ns = ticks * nsec_per_tick; + time.tv_sec = ns / NSEC_PER_SEC; + time.tv_nsec = ns % NSEC_PER_SEC; +} + +int64_t Time::nsecs() const { + return time.tv_sec * NSEC_PER_SEC + time.tv_nsec; +} + +#endif +}} + diff --git a/qpid/cpp/src/qpid/sys/Time.h b/qpid/cpp/src/qpid/sys/Time.h index 92e83116a5..6faaf5e367 100644 --- a/qpid/cpp/src/qpid/sys/Time.h +++ b/qpid/cpp/src/qpid/sys/Time.h @@ -21,17 +21,52 @@ #include <stdint.h> +#ifdef USE_APR +# include <apr-1/apr_time.h> +#else +# include <time.h> +#endif + namespace qpid { namespace sys { -inline int64_t msecsToNsecs(int64_t msecs) { return msecs * 1000 *1000; } -inline int64_t nsecsToMsecs(int64_t nsecs) { return nsecs / (1000 *1000); } +class Time +{ + public: + static Time now(); + + enum { + NSEC_PER_SEC=1000*1000*1000, + NSEC_PER_MSEC=1000*1000, + NSEC_PER_USEC=1000 + }; + + inline Time(int64_t ticks=0, long nsec_per_tick=1); + + void set(int64_t ticks, long nsec_per_tick=1); + + inline int64_t msecs() const; + inline int64_t usecs() const; + int64_t nsecs() const; + +#ifndef USE_APR + const struct timespec& getTimespec() const { return time; } + struct timespec& getTimespec() { return time; } +#endif + + private: +#ifdef USE_APR + apr_time_t time; +#else + struct timespec time; +#endif +}; + +Time::Time(int64_t ticks, long nsec_per_tick) { set(ticks, nsec_per_tick); } -/** Nanoseconds since epoch */ -int64_t getTimeNsecs(); +int64_t Time::msecs() const { return nsecs() / NSEC_PER_MSEC; } -/** Milliseconds since epoch */ -int64_t getTimeMsecs(); +int64_t Time::usecs() const { return nsecs() / NSEC_PER_USEC; } }} diff --git a/qpid/cpp/src/qpid/sys/doxygen_summary.h b/qpid/cpp/src/qpid/sys/doxygen_summary.h index af89154fdf..d7c513da50 100644 --- a/qpid/cpp/src/qpid/sys/doxygen_summary.h +++ b/qpid/cpp/src/qpid/sys/doxygen_summary.h @@ -22,13 +22,6 @@ // No code just a doxygen comment for the namespace /** \namspace qpid::sys - * IO classes used by client and broker. - * - * This namespace contains platform-neutral classes. Platform - * specific classes are in a sub-namespace named after the - * platform. At build time the appropriate platform classes are - * imported into this namespace so other code does not need to be awre - * of the difference. - * + * Portability wrappers for platform-specific details. */ #endif /*!_doxygen_summary_*/ diff --git a/qpid/cpp/src/qpidd.cpp b/qpid/cpp/src/qpidd.cpp index 2974cc8654..4823aff90d 100644 --- a/qpid/cpp/src/qpidd.cpp +++ b/qpid/cpp/src/qpidd.cpp @@ -15,9 +15,9 @@ * limitations under the License. * */ -#include "qpid/broker/Broker.h" -#include "qpid/broker/Configuration.h" -#include "apr-1/apr_signal.h" +#include <qpid/broker/Broker.h> +#include <qpid/broker/Configuration.h> +#include <apr-1/apr_signal.h> #include <iostream> #include <memory> diff --git a/qpid/cpp/test/client/client_test.cpp b/qpid/cpp/test/client/client_test.cpp index 8e9c58179a..a872e5e772 100644 --- a/qpid/cpp/test/client/client_test.cpp +++ b/qpid/cpp/test/client/client_test.cpp @@ -17,13 +17,13 @@ */ #include <iostream> -#include "qpid/QpidError.h" -#include "qpid/client/Channel.h" -#include "qpid/client/Connection.h" -#include "qpid/client/Message.h" -#include "qpid/client/MessageListener.h" -#include "qpid/sys/Monitor.h" -#include "qpid/framing/FieldTable.h" +#include <qpid/QpidError.h> +#include <qpid/client/Channel.h> +#include <qpid/client/Connection.h> +#include <qpid/client/Message.h> +#include <qpid/client/MessageListener.h> +#include <qpid/sys/Monitor.h> +#include <qpid/framing/FieldTable.h> using namespace qpid::client; using namespace qpid::sys; diff --git a/qpid/cpp/test/client/topic_listener.cpp b/qpid/cpp/test/client/topic_listener.cpp index 9aa93bc2b5..6f0ae48d24 100644 --- a/qpid/cpp/test/client/topic_listener.cpp +++ b/qpid/cpp/test/client/topic_listener.cpp @@ -15,12 +15,12 @@ * limitations under the License. * */ -#include "qpid/QpidError.h" -#include "qpid/client/Channel.h" -#include "qpid/client/Connection.h" -#include "qpid/client/Exchange.h" -#include "qpid/client/MessageListener.h" -#include "qpid/client/Queue.h" +#include <qpid/QpidError.h> +#include <qpid/client/Channel.h> +#include <qpid/client/Connection.h> +#include <qpid/client/Exchange.h> +#include <qpid/client/MessageListener.h> +#include <qpid/client/Queue.h> #include <qpid/sys/Time.h> #include <iostream> #include <sstream> @@ -102,7 +102,7 @@ Listener::Listener(Channel* _channel, const std::string& _responseq, bool tx) : void Listener::received(Message& message){ if(!init){ - start = getTimeMsecs(); + start = Time::now().msecs(); count = 0; init = true; } @@ -124,7 +124,7 @@ void Listener::shutdown(){ } void Listener::report(){ - int64_t finish = getTimeMsecs(); + int64_t finish = Time::now().msecs(); int64_t time = finish - start; std::stringstream reportstr; reportstr << "Received " << count << " messages in " << time << " ms."; diff --git a/qpid/cpp/test/client/topic_publisher.cpp b/qpid/cpp/test/client/topic_publisher.cpp index 1e1a91dfff..24393fac86 100644 --- a/qpid/cpp/test/client/topic_publisher.cpp +++ b/qpid/cpp/test/client/topic_publisher.cpp @@ -15,13 +15,13 @@ * limitations under the License. * */ -#include "qpid/QpidError.h" -#include "qpid/client/Channel.h" -#include "qpid/client/Connection.h" -#include "qpid/client/Exchange.h" -#include "qpid/client/MessageListener.h" -#include "qpid/client/Queue.h" -#include "qpid/sys/Monitor.h" +#include <qpid/QpidError.h> +#include <qpid/client/Channel.h> +#include <qpid/client/Connection.h> +#include <qpid/client/Exchange.h> +#include <qpid/client/MessageListener.h> +#include <qpid/client/Queue.h> +#include <qpid/sys/Monitor.h> #include "unistd.h" #include <qpid/sys/Time.h> #include <cstdlib> @@ -149,7 +149,7 @@ void Publisher::waitForCompletion(int msgs){ int64_t Publisher::publish(int msgs, int listeners, int size){ Message msg; msg.setData(generateData(size)); - int64_t start = getTimeMsecs(); + int64_t start = Time::now().msecs(); { Monitor::ScopedLock l(monitor); for(int i = 0; i < msgs; i++){ @@ -166,7 +166,7 @@ int64_t Publisher::publish(int msgs, int listeners, int size){ waitForCompletion(listeners); } - int64_t finish(getTimeMsecs()); + int64_t finish(Time::now().msecs()); return finish - start; } diff --git a/qpid/cpp/test/unit/qpid/apr/APRBaseTest.cpp b/qpid/cpp/test/unit/qpid/apr/APRBaseTest.cpp index a0f88f78db..76b61afc1d 100644 --- a/qpid/cpp/test/unit/qpid/apr/APRBaseTest.cpp +++ b/qpid/cpp/test/unit/qpid/apr/APRBaseTest.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/apr/APRBase.h" +#include <qpid/apr/APRBase.h> #include <qpid_test_plugin.h> #include <iostream> diff --git a/qpid/cpp/test/unit/qpid/broker/AccumulatedAckTest.cpp b/qpid/cpp/test/unit/qpid/broker/AccumulatedAckTest.cpp index 6cbdaacc32..193117221c 100644 --- a/qpid/cpp/test/unit/qpid/broker/AccumulatedAckTest.cpp +++ b/qpid/cpp/test/unit/qpid/broker/AccumulatedAckTest.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/broker/AccumulatedAck.h" +#include <qpid/broker/AccumulatedAck.h> #include <qpid_test_plugin.h> #include <iostream> #include <list> diff --git a/qpid/cpp/test/unit/qpid/broker/ChannelTest.cpp b/qpid/cpp/test/unit/qpid/broker/ChannelTest.cpp index 796c949363..373325e0eb 100644 --- a/qpid/cpp/test/unit/qpid/broker/ChannelTest.cpp +++ b/qpid/cpp/test/unit/qpid/broker/ChannelTest.cpp @@ -15,8 +15,8 @@ * limitations under the License. * */ -#include "qpid/broker/Channel.h" -#include "qpid/broker/Message.h" +#include <qpid/broker/Channel.h> +#include <qpid/broker/Message.h> #include <qpid_test_plugin.h> #include <iostream> #include <memory> diff --git a/qpid/cpp/test/unit/qpid/broker/ConfigurationTest.cpp b/qpid/cpp/test/unit/qpid/broker/ConfigurationTest.cpp index 8fd252a9a9..5af1286057 100644 --- a/qpid/cpp/test/unit/qpid/broker/ConfigurationTest.cpp +++ b/qpid/cpp/test/unit/qpid/broker/ConfigurationTest.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/broker/Configuration.h" +#include <qpid/broker/Configuration.h> #include <qpid_test_plugin.h> #include <iostream> diff --git a/qpid/cpp/test/unit/qpid/broker/ExchangeTest.cpp b/qpid/cpp/test/unit/qpid/broker/ExchangeTest.cpp index d20b7c171a..babceeace8 100644 --- a/qpid/cpp/test/unit/qpid/broker/ExchangeTest.cpp +++ b/qpid/cpp/test/unit/qpid/broker/ExchangeTest.cpp @@ -16,11 +16,11 @@ * */ -#include "qpid/broker/DeliverableMessage.h" -#include "qpid/broker/DirectExchange.h" -#include "qpid/broker/Exchange.h" -#include "qpid/broker/Queue.h" -#include "qpid/broker/TopicExchange.h" +#include <qpid/broker/DeliverableMessage.h> +#include <qpid/broker/DirectExchange.h> +#include <qpid/broker/Exchange.h> +#include <qpid/broker/Queue.h> +#include <qpid/broker/TopicExchange.h> #include <qpid_test_plugin.h> #include <iostream> diff --git a/qpid/cpp/test/unit/qpid/broker/HeadersExchangeTest.cpp b/qpid/cpp/test/unit/qpid/broker/HeadersExchangeTest.cpp index a57c1d8800..47bb172264 100644 --- a/qpid/cpp/test/unit/qpid/broker/HeadersExchangeTest.cpp +++ b/qpid/cpp/test/unit/qpid/broker/HeadersExchangeTest.cpp @@ -16,9 +16,9 @@ * */ -#include "qpid/broker/HeadersExchange.h" -#include "qpid/framing/FieldTable.h" -#include "qpid/framing/Value.h" +#include <qpid/broker/HeadersExchange.h> +#include <qpid/framing/FieldTable.h> +#include <qpid/framing/Value.h> #include <qpid_test_plugin.h> using namespace qpid::broker; diff --git a/qpid/cpp/test/unit/qpid/broker/MessageBuilderTest.cpp b/qpid/cpp/test/unit/qpid/broker/MessageBuilderTest.cpp index c04226647f..ed761d9702 100644 --- a/qpid/cpp/test/unit/qpid/broker/MessageBuilderTest.cpp +++ b/qpid/cpp/test/unit/qpid/broker/MessageBuilderTest.cpp @@ -15,8 +15,8 @@ * limitations under the License. * */ -#include "qpid/broker/Message.h" -#include "qpid/broker/MessageBuilder.h" +#include <qpid/broker/Message.h> +#include <qpid/broker/MessageBuilder.h> #include <qpid_test_plugin.h> #include <iostream> #include <memory> diff --git a/qpid/cpp/test/unit/qpid/broker/QueueRegistryTest.cpp b/qpid/cpp/test/unit/qpid/broker/QueueRegistryTest.cpp index 59034fb7c8..32111105f5 100644 --- a/qpid/cpp/test/unit/qpid/broker/QueueRegistryTest.cpp +++ b/qpid/cpp/test/unit/qpid/broker/QueueRegistryTest.cpp @@ -1,4 +1,4 @@ -#include "qpid/broker/QueueRegistry.h" +#include <qpid/broker/QueueRegistry.h> #include <qpid_test_plugin.h> #include <string> diff --git a/qpid/cpp/test/unit/qpid/broker/QueueTest.cpp b/qpid/cpp/test/unit/qpid/broker/QueueTest.cpp index ee64854dbb..903e045b89 100644 --- a/qpid/cpp/test/unit/qpid/broker/QueueTest.cpp +++ b/qpid/cpp/test/unit/qpid/broker/QueueTest.cpp @@ -15,8 +15,8 @@ * limitations under the License. * */ -#include "qpid/broker/Queue.h" -#include "qpid/broker/QueueRegistry.h" +#include <qpid/broker/Queue.h> +#include <qpid/broker/QueueRegistry.h> #include <qpid_test_plugin.h> #include <iostream> diff --git a/qpid/cpp/test/unit/qpid/broker/TopicExchangeTest.cpp b/qpid/cpp/test/unit/qpid/broker/TopicExchangeTest.cpp index 6a15573e51..681539223b 100644 --- a/qpid/cpp/test/unit/qpid/broker/TopicExchangeTest.cpp +++ b/qpid/cpp/test/unit/qpid/broker/TopicExchangeTest.cpp @@ -1,4 +1,4 @@ -#include "qpid/broker/TopicExchange.h" +#include <qpid/broker/TopicExchange.h> #include <qpid_test_plugin.h> using namespace qpid::broker; diff --git a/qpid/cpp/test/unit/qpid/broker/TxAckTest.cpp b/qpid/cpp/test/unit/qpid/broker/TxAckTest.cpp index b6f8fbc1a1..c94cb717f8 100644 --- a/qpid/cpp/test/unit/qpid/broker/TxAckTest.cpp +++ b/qpid/cpp/test/unit/qpid/broker/TxAckTest.cpp @@ -15,9 +15,9 @@ * limitations under the License. * */ -#include "qpid/broker/MessageStore.h" -#include "qpid/broker/QueueRegistry.h" -#include "qpid/broker/TxAck.h" +#include <qpid/broker/MessageStore.h> +#include <qpid/broker/QueueRegistry.h> +#include <qpid/broker/TxAck.h> #include <qpid_test_plugin.h> #include <iostream> #include <list> diff --git a/qpid/cpp/test/unit/qpid/broker/TxBufferTest.cpp b/qpid/cpp/test/unit/qpid/broker/TxBufferTest.cpp index e9c531fad1..f95644e34f 100644 --- a/qpid/cpp/test/unit/qpid/broker/TxBufferTest.cpp +++ b/qpid/cpp/test/unit/qpid/broker/TxBufferTest.cpp @@ -15,7 +15,7 @@ * limitations under the License. * */ -#include "qpid/broker/TxBuffer.h" +#include <qpid/broker/TxBuffer.h> #include <qpid_test_plugin.h> #include <iostream> #include <vector> diff --git a/qpid/cpp/test/unit/qpid/broker/TxPublishTest.cpp b/qpid/cpp/test/unit/qpid/broker/TxPublishTest.cpp index a3a72b9475..b1f0b5a289 100644 --- a/qpid/cpp/test/unit/qpid/broker/TxPublishTest.cpp +++ b/qpid/cpp/test/unit/qpid/broker/TxPublishTest.cpp @@ -15,9 +15,9 @@ * limitations under the License. * */ -#include "qpid/broker/MessageStore.h" -#include "qpid/broker/QueueRegistry.h" -#include "qpid/broker/TxPublish.h" +#include <qpid/broker/MessageStore.h> +#include <qpid/broker/QueueRegistry.h> +#include <qpid/broker/TxPublish.h> #include <qpid_test_plugin.h> #include <iostream> #include <list> diff --git a/qpid/cpp/test/unit/qpid/broker/ValueTest.cpp b/qpid/cpp/test/unit/qpid/broker/ValueTest.cpp index 8ea536f59f..ae30aebfdd 100644 --- a/qpid/cpp/test/unit/qpid/broker/ValueTest.cpp +++ b/qpid/cpp/test/unit/qpid/broker/ValueTest.cpp @@ -1,4 +1,4 @@ -#include "qpid/framing/Value.h" +#include <qpid/framing/Value.h> #include <qpid_test_plugin.h> using namespace qpid::framing; diff --git a/qpid/cpp/test/unit/qpid/framing/BodyHandlerTest.cpp b/qpid/cpp/test/unit/qpid/framing/BodyHandlerTest.cpp index d6edf37d51..c8e3012558 100644 --- a/qpid/cpp/test/unit/qpid/framing/BodyHandlerTest.cpp +++ b/qpid/cpp/test/unit/qpid/framing/BodyHandlerTest.cpp @@ -16,8 +16,8 @@ * */ #include <iostream> -#include "qpid/framing/amqp_framing.h" -#include "qpid_test_plugin.h" +#include <qpid/framing/amqp_framing.h> +#include <qpid_test_plugin.h> using namespace qpid::framing; class BodyHandlerTest : public CppUnit::TestCase diff --git a/qpid/cpp/test/unit/qpid/framing/FieldTableTest.cpp b/qpid/cpp/test/unit/qpid/framing/FieldTableTest.cpp index b11addfd0e..ea28b570d1 100644 --- a/qpid/cpp/test/unit/qpid/framing/FieldTableTest.cpp +++ b/qpid/cpp/test/unit/qpid/framing/FieldTableTest.cpp @@ -16,7 +16,7 @@ * */ #include <iostream> -#include "qpid/framing/amqp_framing.h" +#include <qpid/framing/amqp_framing.h> #include <qpid_test_plugin.h> using namespace qpid::framing; diff --git a/qpid/cpp/test/unit/qpid/framing/FramingTest.cpp b/qpid/cpp/test/unit/qpid/framing/FramingTest.cpp index ad2d651fe0..cfa5b4814e 100644 --- a/qpid/cpp/test/unit/qpid/framing/FramingTest.cpp +++ b/qpid/cpp/test/unit/qpid/framing/FramingTest.cpp @@ -15,8 +15,8 @@ * limitations under the License. * */ -#include "qpid/framing/ConnectionRedirectBody.h" -#include "qpid/framing/amqp_framing.h" +#include <qpid/framing/ConnectionRedirectBody.h> +#include <qpid/framing/amqp_framing.h> #include <iostream> #include <qpid_test_plugin.h> #include <sstream> diff --git a/qpid/cpp/test/unit/qpid/framing/HeaderTest.cpp b/qpid/cpp/test/unit/qpid/framing/HeaderTest.cpp index 8b613127b1..04af80acc8 100644 --- a/qpid/cpp/test/unit/qpid/framing/HeaderTest.cpp +++ b/qpid/cpp/test/unit/qpid/framing/HeaderTest.cpp @@ -16,7 +16,7 @@ * */ #include <iostream> -#include "qpid/framing/amqp_framing.h" +#include <qpid/framing/amqp_framing.h> #include <qpid_test_plugin.h> using namespace qpid::framing; |