From 95ad2adfc443b227eba224279188c36906c1db66 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 28 Jul 2011 18:28:56 +0000 Subject: Merge branch 'visibility-hidden' into qpid-3163 git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/qpid-3163@1151956 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/configure.ac | 34 ++++++++------ qpid/cpp/examples/messaging/OptionParser.cpp | 14 ++---- qpid/cpp/examples/messaging/OptionParser.h | 11 ++++- qpid/cpp/include/qmf/Subscription.h | 4 +- qpid/cpp/include/qmf/engine/ConnectionSettings.h | 6 +-- .../cpp/include/qmf/engine/QmfEngineImportExport.h | 25 ++++------ qpid/cpp/include/qpid/Address.h | 6 +-- qpid/cpp/include/qpid/Exception.h | 2 +- qpid/cpp/include/qpid/ImportExport.h | 15 +++++- qpid/cpp/include/qpid/Options.h | 6 +-- qpid/cpp/include/qpid/RangeSet.h | 4 +- qpid/cpp/include/qpid/SessionId.h | 2 +- qpid/cpp/include/qpid/Url.h | 4 +- qpid/cpp/include/qpid/agent/ManagementAgent.h | 4 +- qpid/cpp/include/qpid/client/Handle.h | 2 +- qpid/cpp/include/qpid/console/Broker.h | 2 +- qpid/cpp/include/qpid/console/Event.h | 2 +- qpid/cpp/include/qpid/console/Object.h | 4 +- qpid/cpp/include/qpid/console/SequenceManager.h | 2 +- qpid/cpp/include/qpid/console/SessionManager.h | 4 +- qpid/cpp/include/qpid/framing/FieldTable.h | 5 +- qpid/cpp/include/qpid/framing/FieldValue.h | 54 +++++++++++----------- qpid/cpp/include/qpid/framing/Uuid.h | 2 +- qpid/cpp/include/qpid/log/Options.h | 2 +- qpid/cpp/include/qpid/log/Selector.h | 2 +- qpid/cpp/include/qpid/log/SinkOptions.h | 2 +- qpid/cpp/include/qpid/log/Statement.h | 2 +- qpid/cpp/include/qpid/management/Buffer.h | 2 +- .../cpp/include/qpid/management/ManagementObject.h | 6 +-- qpid/cpp/include/qpid/management/Mutex.h | 2 +- qpid/cpp/include/qpid/sys/IOHandle.h | 4 +- qpid/cpp/include/qpid/sys/Thread.h | 2 +- qpid/cpp/include/qpid/sys/Time.h | 2 +- qpid/cpp/include/qpid/sys/posix/Mutex.h | 9 ++-- qpid/cpp/include/qpid/sys/posix/PrivatePosix.h | 12 +++-- qpid/cpp/managementgen/qmfgen/templates/Args.h | 9 ++-- qpid/cpp/managementgen/qmfgen/templates/Class.h | 7 +-- qpid/cpp/managementgen/qmfgen/templates/Event.h | 7 +-- qpid/cpp/managementgen/qmfgen/templates/Package.h | 9 ++-- .../cpp/managementgen/qmfgen/templates/V2Package.h | 9 ++-- qpid/cpp/rubygen/0-10/exceptions.rb | 11 +++-- .../rubygen/framing.0-10/MethodBodyConstVisitor.rb | 7 +-- qpid/cpp/rubygen/framing.0-10/Session.rb | 40 ++++++++-------- qpid/cpp/rubygen/framing.0-10/constants.rb | 17 +++---- qpid/cpp/src/Makefile.am | 21 ++++++--- qpid/cpp/src/qmf.mk | 7 +-- qpid/cpp/src/qmf/QueryImpl.h | 9 ++-- qpid/cpp/src/qmf/SchemaImpl.h | 9 ++-- qpid/cpp/src/qpid/DataDir.h | 4 +- qpid/cpp/src/qpid/DisableExceptionLogging.h | 2 +- qpid/cpp/src/qpid/Modules.h | 2 +- qpid/cpp/src/qpid/Plugin.h | 20 ++++---- qpid/cpp/src/qpid/RefCountedBuffer.h | 3 +- qpid/cpp/src/qpid/SaslFactory.h | 6 +-- qpid/cpp/src/qpid/SessionState.h | 16 +++---- qpid/cpp/src/qpid/amqp_0_10/Connection.h | 4 +- qpid/cpp/src/qpid/amqp_0_10/Exception.h | 26 +++++------ qpid/cpp/src/qpid/amqp_0_10/Map.h | 22 ++++----- qpid/cpp/src/qpid/assert.h | 10 ++-- qpid/cpp/src/qpid/broker/Bridge.h | 11 +++-- qpid/cpp/src/qpid/broker/Broker.cpp | 7 +-- qpid/cpp/src/qpid/broker/Broker.h | 7 +-- qpid/cpp/src/qpid/broker/BrokerImportExport.h | 25 ++++------ qpid/cpp/src/qpid/broker/Connection.cpp | 1 + qpid/cpp/src/qpid/broker/Connection.h | 3 +- qpid/cpp/src/qpid/broker/ConnectionFactory.h | 9 ++-- qpid/cpp/src/qpid/broker/Daemon.h | 7 +-- qpid/cpp/src/qpid/broker/DeliveryRecord.h | 16 +++---- qpid/cpp/src/qpid/broker/DirectExchange.h | 14 +++--- qpid/cpp/src/qpid/broker/DtxBuffer.h | 8 ++-- qpid/cpp/src/qpid/broker/DtxTimeout.h | 9 ++-- qpid/cpp/src/qpid/broker/DtxWorkRecord.h | 6 +-- qpid/cpp/src/qpid/broker/ExchangeRegistry.h | 12 ++--- qpid/cpp/src/qpid/broker/Fairshare.h | 7 +-- qpid/cpp/src/qpid/broker/FanOutExchange.h | 14 +++--- qpid/cpp/src/qpid/broker/HeadersExchange.h | 18 ++++---- qpid/cpp/src/qpid/broker/Link.h | 4 +- qpid/cpp/src/qpid/broker/LinkRegistry.h | 9 ++-- qpid/cpp/src/qpid/broker/Message.h | 24 +++++----- qpid/cpp/src/qpid/broker/PersistableMessage.h | 14 +++--- qpid/cpp/src/qpid/broker/Queue.h | 49 ++++++++++---------- qpid/cpp/src/qpid/broker/QueueCleaner.h | 6 +-- qpid/cpp/src/qpid/broker/QueueEvents.h | 8 ++-- qpid/cpp/src/qpid/broker/QueueFlowLimit.h | 7 +-- qpid/cpp/src/qpid/broker/QueueListeners.h | 13 +++--- qpid/cpp/src/qpid/broker/QueuePolicy.h | 14 +++--- qpid/cpp/src/qpid/broker/QueueRegistry.h | 14 +++--- qpid/cpp/src/qpid/broker/RecoveredDequeue.h | 7 +-- qpid/cpp/src/qpid/broker/RecoveredEnqueue.h | 9 ++-- qpid/cpp/src/qpid/broker/RetryList.h | 8 ++-- qpid/cpp/src/qpid/broker/SecureConnection.h | 7 +-- qpid/cpp/src/qpid/broker/SemanticState.h | 25 +++++----- qpid/cpp/src/qpid/broker/SignalHandler.h | 8 ++-- qpid/cpp/src/qpid/broker/TopicExchange.h | 6 +-- qpid/cpp/src/qpid/broker/TxAccept.h | 13 +++--- qpid/cpp/src/qpid/broker/TxBuffer.h | 20 ++++---- qpid/cpp/src/qpid/client/Bounds.h | 9 ++-- qpid/cpp/src/qpid/client/ConnectionImpl.h | 17 ++++--- qpid/cpp/src/qpid/client/Connector.h | 3 +- qpid/cpp/src/qpid/client/Demux.h | 8 ++-- qpid/cpp/src/qpid/client/Dispatcher.h | 6 +-- qpid/cpp/src/qpid/client/SessionImpl.h | 51 ++++++++++---------- qpid/cpp/src/qpid/client/SubscriptionImpl.h | 8 ++-- qpid/cpp/src/qpid/cluster/Cpg.cpp | 6 +-- qpid/cpp/src/qpid/cluster/Cpg.h | 40 ++++++++-------- qpid/cpp/src/qpid/framing/AMQMethodBody.h | 12 ++--- qpid/cpp/src/qpid/framing/AccumulatedAck.h | 8 ++-- qpid/cpp/src/qpid/framing/FrameDecoder.h | 10 ++-- qpid/cpp/src/qpid/framing/FrameSet.h | 14 +++--- qpid/cpp/src/qpid/framing/ProtocolInitiation.h | 12 ++--- qpid/cpp/src/qpid/framing/Proxy.h | 2 +- qpid/cpp/src/qpid/framing/SendContent.h | 6 +-- qpid/cpp/src/qpid/framing/SequenceNumberSet.h | 14 +++--- qpid/cpp/src/qpid/log/posix/SinkOptions.h | 2 +- qpid/cpp/src/qpid/management/ManagementAgent.h | 6 +-- qpid/cpp/src/qpid/messaging/AddressParser.h | 6 +-- qpid/cpp/src/qpid/sys/AsynchIO.h | 18 ++++---- qpid/cpp/src/qpid/sys/AsynchIOHandler.h | 2 +- qpid/cpp/src/qpid/sys/ClusterSafe.h | 10 ++-- qpid/cpp/src/qpid/sys/DispatchHandle.h | 14 +++--- qpid/cpp/src/qpid/sys/Dispatcher.h | 8 ++-- qpid/cpp/src/qpid/sys/LockFile.h | 6 +-- qpid/cpp/src/qpid/sys/PipeHandle.h | 14 +++--- qpid/cpp/src/qpid/sys/PollableCondition.h | 6 +-- qpid/cpp/src/qpid/sys/Poller.h | 20 ++++---- qpid/cpp/src/qpid/sys/Shlib.h | 14 +++--- qpid/cpp/src/qpid/sys/SocketAddress.h | 8 ++-- qpid/cpp/src/qpid/sys/Timer.h | 8 ++-- qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.h | 7 +-- qpid/cpp/src/qpid/sys/posix/Fork.h | 3 +- qpid/cpp/src/qpid/sys/posix/PidFile.h | 4 +- qpid/cpp/src/qpid/sys/posix/Shlib.cpp | 2 +- qpid/cpp/src/qpid/sys/rdma/ImportExport.h | 35 ++++++++++++++ qpid/cpp/src/qpid/sys/rdma/RdmaIO.h | 20 ++++---- qpid/cpp/src/qpid/sys/rdma/rdma_wrap.h | 13 +++--- qpid/cpp/src/qpid/sys/ssl/SslCommonImportExport.h | 35 ++++++++++++++ qpid/cpp/src/qpid/sys/ssl/SslIo.h | 19 ++++---- qpid/cpp/src/ssl.mk | 5 +- qpid/cpp/src/tests/unit_test.cpp | 5 ++ 139 files changed, 813 insertions(+), 680 deletions(-) create mode 100644 qpid/cpp/src/qpid/sys/rdma/ImportExport.h create mode 100644 qpid/cpp/src/qpid/sys/ssl/SslCommonImportExport.h diff --git a/qpid/cpp/configure.ac b/qpid/cpp/configure.ac index 43a32d3ad7..0a28b21968 100644 --- a/qpid/cpp/configure.ac +++ b/qpid/cpp/configure.ac @@ -27,7 +27,7 @@ AC_PROG_CC_STDC AM_PROG_CC_C_O AC_PROG_CXX AC_USE_SYSTEM_EXTENSIONS -AC_LANG([C++]) +AC_LANG([C++]) # Check for optional use of help2man AC_CHECK_PROG([HELP2MAN], [help2man], [help2man]) @@ -81,14 +81,15 @@ if test x$GXX = xyes; then gl_COMPILER_FLAGS(-Wvolatile-register-var) gl_COMPILER_FLAGS(-Winvalid-pch) gl_COMPILER_FLAGS(-Wno-system-headers) - gl_COMPILER_FLAGS(-Woverloaded-virtual) + gl_COMPILER_FLAGS(-Woverloaded-virtual) + gl_COMPILER_FLAGS(-Wno-attributes) AC_SUBST([WARNING_CFLAGS], [$COMPILER_FLAGS]) AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.]) COMPILER_FLAGS= fi else AC_CHECK_DECL([__SUNPRO_CC], [SUNCC=yes], [SUNCC=no]) - + # Set up for sun CC compiler if test x$SUNCC = xyes; then if test "${enableval}" = yes; then @@ -116,7 +117,7 @@ LIBS=$gl_saved_libs gl_CLOCK_TIME -# Enable Valgrind +# Enable Valgrind AC_ARG_ENABLE([valgrind], [AS_HELP_STRING([--enable-valgrind], [run valgrind memory checker on tests, if available (default yes)])], @@ -236,7 +237,7 @@ if test -n "$PERL"; then PERL_ARCHLIB=`perl -MConfig -e 'print "$Config{archlib}";'` AC_CHECK_FILE( ["$PERL_ARCHLIB/CORE/perl.h"], [AC_SUBST([PERL_INC], ["$PERL_ARCHLIB/CORE"])] ) -fi +fi AM_CONDITIONAL([HAVE_PERL_DEVEL], [test -n "$PERL" && test -n "$SWIG" && test -n "$PERL_INC"]) specdir=`pwd`/$srcdir/../specs @@ -261,7 +262,7 @@ tmp_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -L/usr/lib/openais -L/usr/lib64/openais -L/usr/lib/corosync -L/usr/lib64/corosync" AC_CHECK_LIB([cpg],[cpg_local_get],[have_libcpg=yes],) AC_CHECK_HEADERS([openais/cpg.h corosync/cpg.h],[have_cpg_h=yes],) -AC_ARG_WITH([cpg], +AC_ARG_WITH([cpg], [AS_HELP_STRING([--with-cpg], [Build with CPG support for clustering.])], [case "${withval}" in yes) # yes - require dependencies @@ -269,7 +270,7 @@ AC_ARG_WITH([cpg], test x$have_cpg_h = xyes || AC_MSG_ERROR([cpg.h not found, install openais-devel or corosync-devel]) with_cpg=yes ;; - no) with_cpg=no ;; + no) with_cpg=no ;; *) AC_MSG_ERROR([Bad value ${withval} for --with-cpg option]) ;; esac], [ # not specified - use if present @@ -282,7 +283,7 @@ AS_IF([test ! x$with_cpg = xyes], [LDFLAGS=$tmp_LDFLAGS]) AC_CHECK_LIB([cman],[cman_is_quorate],have_libcman=yes,) AC_CHECK_HEADERS([libcman.h],have_libcman_h=yes,) -AC_ARG_WITH([libcman], +AC_ARG_WITH([libcman], [AS_HELP_STRING([--with-libcman], [Integration with libcman quorum service.])], [case "${withval}" in yes) # yes - require dependencies @@ -290,7 +291,7 @@ AC_ARG_WITH([libcman], test x$have_libcman_h = xyes || AC_MSG_ERROR([libcman.h not found, install cman-devel or cmanlib-devel]) with_libcman=yes ;; - no) with_libcman=no ;; + no) with_libcman=no ;; *) AC_MSG_ERROR([Bad value ${withval} for --with-libcman option]) ;; esac], [ # not specified - use if present and we're using with_cpg @@ -442,9 +443,9 @@ AC_ARG_WITH([ssl], [ with_SSL=yes AC_PATH_PROG([NSPR_CONFIG], [nspr-config]) - AS_IF([test x$NSPR_CONFIG = x], [with_SSL=no], + AS_IF([test x$NSPR_CONFIG = x], [with_SSL=no], [AC_PATH_PROG([NSS_CONFIG], [nss-config]) - AS_IF([test x$NSS_CONFIG = x], [with_SSL=no], + AS_IF([test x$NSS_CONFIG = x], [with_SSL=no], [SSL_CFLAGS="`$NSPR_CONFIG --cflags` `$NSS_CONFIG --cflags`" SSL_LDFLAGS="`$NSPR_CONFIG --libs` `$NSS_CONFIG --libs`"])]) ] @@ -493,11 +494,11 @@ esac AM_CONDITIONAL([SUNOS], [test x$arch = xsolaris]) # Check for some syslog capabilities not present in all systems -AC_TRY_COMPILE([#include ], +AC_TRY_COMPILE([#include ], [int v = LOG_AUTHPRIV;], [AC_DEFINE([HAVE_LOG_AUTHPRIV], [1], [Set to 1 whether LOG_AUTHPRIV is supported.])],) -AC_TRY_COMPILE([#include ], +AC_TRY_COMPILE([#include ], [int v = LOG_FTP;], [AC_DEFINE([HAVE_LOG_FTP], [1], [Set to 1 whether LOG_FTP is supported.])],) @@ -521,6 +522,13 @@ AM_PATH_PYTHON() builddir_lib_suffix="/.libs" AC_SUBST([builddir_lib_suffix]) +# Enable -fvisibility=hidden if using a gcc that supports it +save_CXXFLAGS="$CXXFLAGS" +AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden]) +CXXFLAGS="$CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden" +AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]), + [CXXFLAGS="$save_CXXFLAGS" ; AC_MSG_RESULT([no])]); + # Files to generate AC_CONFIG_FILES([ Makefile diff --git a/qpid/cpp/examples/messaging/OptionParser.cpp b/qpid/cpp/examples/messaging/OptionParser.cpp index 661d0a988a..41a71af49a 100644 --- a/qpid/cpp/examples/messaging/OptionParser.cpp +++ b/qpid/cpp/examples/messaging/OptionParser.cpp @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -93,12 +93,6 @@ class OptionMatch std::string name; }; -class OptionsError : public qpid::types::Exception -{ - public: - OptionsError(const std::string& message) : qpid::types::Exception(message) {} -}; - Option::Option(const std::string& name, const std::string& desc) : description(desc) { std::string::size_type i = name.find(","); @@ -197,7 +191,7 @@ Option* OptionParser::getOption(const std::string& argument) throw OptionsError(error.str()); } else { return *i; - } + } } else { return 0; } @@ -251,7 +245,7 @@ bool OptionParser::parse(int argc, char** argv) OptionParser::~OptionParser() { - for (Options::iterator i = options.begin(); i != options.end(); ++i) { + for (Options::iterator i = options.begin(); i != options.end(); ++i) { delete *i; } } diff --git a/qpid/cpp/examples/messaging/OptionParser.h b/qpid/cpp/examples/messaging/OptionParser.h index 4cda53f92a..72fe2e4bf9 100644 --- a/qpid/cpp/examples/messaging/OptionParser.h +++ b/qpid/cpp/examples/messaging/OptionParser.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -25,6 +25,7 @@ #include #include #include +#include "qpid/CommonImportExport.h" class Option; @@ -53,4 +54,10 @@ class OptionParser Option* getOption(const std::string& argument); }; +class QPID_COMMON_CLASS_EXTERN OptionsError : public qpid::types::Exception +{ + public: + OptionsError(const std::string& message) : qpid::types::Exception(message) {} +}; + #endif /*!OPTIONPARSER_H*/ diff --git a/qpid/cpp/include/qmf/Subscription.h b/qpid/cpp/include/qmf/Subscription.h index 398a45b922..580a5ea296 100644 --- a/qpid/cpp/include/qmf/Subscription.h +++ b/qpid/cpp/include/qmf/Subscription.h @@ -9,9 +9,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY diff --git a/qpid/cpp/include/qmf/engine/ConnectionSettings.h b/qpid/cpp/include/qmf/engine/ConnectionSettings.h index 36312400b1..c570a6b9f5 100644 --- a/qpid/cpp/include/qmf/engine/ConnectionSettings.h +++ b/qpid/cpp/include/qmf/engine/ConnectionSettings.h @@ -9,9 +9,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -34,7 +34,7 @@ namespace engine { * * \ingroup qmfapi */ - class ConnectionSettings { + class QMFE_CLASS_EXTERN ConnectionSettings { public: /** diff --git a/qpid/cpp/include/qmf/engine/QmfEngineImportExport.h b/qpid/cpp/include/qmf/engine/QmfEngineImportExport.h index cf8fffdb17..580f805bba 100644 --- a/qpid/cpp/include/qmf/engine/QmfEngineImportExport.h +++ b/qpid/cpp/include/qmf/engine/QmfEngineImportExport.h @@ -20,23 +20,16 @@ * under the License. */ -#if defined(WIN32) && !defined(QPID_DECLARE_STATIC) -# if defined(QMF_EXPORT) || defined (qmfengine_EXPORTS) -# define QMFE_EXTERN __declspec(dllexport) -# else -# define QMFE_EXTERN __declspec(dllimport) -# endif -# ifdef _MSC_VER -# define QMFE_CLASS_EXTERN -# define QMFE_INLINE_EXTERN QMFE_EXTERN -# else -# define QMFE_CLASS_EXTERN QMFE_EXTERN -# define QMFE_INLINE_EXTERN -# endif +#include "qpid/ImportExport.h" + +#if defined(QMF_EXPORT) || defined (qmfengine_EXPORTS) +# define QMFE_EXTERN QPID_EXPORT +# define QMFE_CLASS_EXTERN QPID_CLASS_EXPORT +# define QMFE_INLINE_EXTERN QPID_INLINE_EXPORT #else -# define QMFE_EXTERN -# define QMFE_CLASS_EXTERN -# define QMFE_INLINE_EXTERN +# define QMFE_EXTERN QPID_IMPORT +# define QMFE_CLASS_EXTERN QPID_CLASS_IMPORT +# define QMFE_INLINE_EXTERN QPID_INLINE_IMPORT #endif #endif diff --git a/qpid/cpp/include/qpid/Address.h b/qpid/cpp/include/qpid/Address.h index f5b19d0532..a60942e4f0 100755 --- a/qpid/cpp/include/qpid/Address.h +++ b/qpid/cpp/include/qpid/Address.h @@ -29,13 +29,13 @@ namespace client { struct ConnectionSettings; } /** - * Contains the protocol address of an AMQP broker. + * Contains the protocol address of an AMQP broker. */ -struct Address { +struct QPID_COMMON_CLASS_EXTERN Address { public: static const std::string TCP; // Default TCP protocol tag. static const uint16_t AMQP_PORT=5672; // Default AMQP port. - + QPID_COMMON_INLINE_EXTERN explicit Address( const std::string& protocol_=std::string(), const std::string& host_=std::string(), diff --git a/qpid/cpp/include/qpid/Exception.h b/qpid/cpp/include/qpid/Exception.h index cbd175214d..9617076eab 100644 --- a/qpid/cpp/include/qpid/Exception.h +++ b/qpid/cpp/include/qpid/Exception.h @@ -82,7 +82,7 @@ struct QPID_COMMON_CLASS_EXTERN ClosedException : public Exception { /** * Exception representing transport failure */ -struct TransportFailure : public Exception { +struct QPID_COMMON_CLASS_EXTERN TransportFailure : public Exception { TransportFailure(const std::string& msg=std::string()) : Exception(msg) {} }; diff --git a/qpid/cpp/include/qpid/ImportExport.h b/qpid/cpp/include/qpid/ImportExport.h index e62399faf7..a169c7da49 100644 --- a/qpid/cpp/include/qpid/ImportExport.h +++ b/qpid/cpp/include/qpid/ImportExport.h @@ -56,10 +56,21 @@ # define QPID_INLINE_EXPORT # define QPID_INLINE_IMPORT # endif -#else +#elif __GNUC__ >= 4 // - // Non-Windows (Linux, etc.) definitions: + // GCC visibility attribute // +# define QPID_IMPORT __attribute__ ((visibility("default"))) +# define QPID_EXPORT __attribute__ ((visibility("default"))) +# define QPID_CLASS_EXPORT QPID_EXPORT +# define QPID_CLASS_IMPORT QPID_IMPORT +# define QPID_INLINE_EXPORT QPID_EXPORT +# define QPID_INLINE_IMPORT QPID_IMPORT + +#else + // + // No import/export definitions + // # define QPID_EXPORT # define QPID_IMPORT # define QPID_CLASS_EXPORT diff --git a/qpid/cpp/include/qpid/Options.h b/qpid/cpp/include/qpid/Options.h index 63d91c2d72..8f4cc1b1b2 100644 --- a/qpid/cpp/include/qpid/Options.h +++ b/qpid/cpp/include/qpid/Options.h @@ -53,7 +53,7 @@ QPID_COMMON_EXTERN std::string prettyArg(const std::string&, const std::string&) /** @internal Normally only constructed by optValue() */ template -class OptionValue : public po::typed_value { +class QPID_COMMON_CLASS_EXTERN OptionValue : public po::typed_value { public: OptionValue(T& value, const std::string& arg) : po::typed_value(&value), argName(arg) {} @@ -135,7 +135,7 @@ inline po::value_semantic* optValue(bool& value) { return po::bool_switch(&value struct Options : public po::options_description { - struct Exception : public qpid::Exception { + struct QPID_COMMON_CLASS_EXTERN Exception : public qpid::Exception { Exception(const std::string& msg) : qpid::Exception(msg) {} }; @@ -161,7 +161,7 @@ struct Options : public po::options_description { /** * Standard options for configuration */ -struct CommonOptions : public Options { +struct QPID_COMMON_CLASS_EXTERN CommonOptions : public Options { QPID_COMMON_EXTERN CommonOptions(const std::string& name=std::string(), const std::string& configfile=std::string()); bool help; diff --git a/qpid/cpp/include/qpid/RangeSet.h b/qpid/cpp/include/qpid/RangeSet.h index 36991fd784..32b623780e 100644 --- a/qpid/cpp/include/qpid/RangeSet.h +++ b/qpid/cpp/include/qpid/RangeSet.h @@ -190,8 +190,6 @@ class RangeSet static size_t accumulateSize(size_t s, const Range& r) { return s+r.size(); } Ranges ranges; - template friend std::ostream& operator<<(std::ostream& o, const RangeSet& r); - friend class iterator; }; @@ -204,7 +202,7 @@ template std::ostream& operator<<(std::ostream& o, const RangeSet& rs) { std::ostream_iterator > i(o, " "); o << "{ "; - std::copy(rs.ranges.begin(), rs.ranges.end(), i); + std::copy(rs.rangesBegin(), rs.rangesEnd(), i); return o << "}"; } diff --git a/qpid/cpp/include/qpid/SessionId.h b/qpid/cpp/include/qpid/SessionId.h index e18b360999..4720949175 100644 --- a/qpid/cpp/include/qpid/SessionId.h +++ b/qpid/cpp/include/qpid/SessionId.h @@ -39,7 +39,7 @@ namespace qpid { * The name must be unique among sessions with the same authentication * principal. */ -class SessionId : boost::totally_ordered1 { +class QPID_COMMON_CLASS_EXTERN SessionId : boost::totally_ordered1 { std::string userId; std::string name; public: diff --git a/qpid/cpp/include/qpid/Url.h b/qpid/cpp/include/qpid/Url.h index 915b08ac5f..8845fc4a60 100644 --- a/qpid/cpp/include/qpid/Url.h +++ b/qpid/cpp/include/qpid/Url.h @@ -30,7 +30,7 @@ namespace qpid { /** An AMQP URL contains a list of addresses */ -struct Url : public std::vector
{ +struct QPID_COMMON_CLASS_EXTERN Url : public std::vector
{ /** Url with the hostname as returned by gethostname(2) */ QPID_COMMON_EXTERN static Url getHostNameUrl(uint16_t port); @@ -39,7 +39,7 @@ struct Url : public std::vector
{ * on a multi-homed host. */ QPID_COMMON_EXTERN static Url getIpAddressesUrl(uint16_t port); - struct Invalid : public Exception { Invalid(const std::string& s); }; + struct QPID_COMMON_CLASS_EXTERN Invalid : public Exception { Invalid(const std::string& s); }; /** Convert to string form. */ QPID_COMMON_EXTERN std::string str() const; diff --git a/qpid/cpp/include/qpid/agent/ManagementAgent.h b/qpid/cpp/include/qpid/agent/ManagementAgent.h index e2451244c1..a818af9ca5 100644 --- a/qpid/cpp/include/qpid/agent/ManagementAgent.h +++ b/qpid/cpp/include/qpid/agent/ManagementAgent.h @@ -35,11 +35,11 @@ public: virtual void notify() = 0; }; -class ManagementAgent +class QMF_AGENT_CLASS_EXTERN ManagementAgent { public: - class Singleton { + class QMF_AGENT_CLASS_EXTERN Singleton { public: QMF_AGENT_EXTERN Singleton(bool disableManagement = false); QMF_AGENT_EXTERN ~Singleton(); diff --git a/qpid/cpp/include/qpid/client/Handle.h b/qpid/cpp/include/qpid/client/Handle.h index b8315481a9..622cdfa191 100644 --- a/qpid/cpp/include/qpid/client/Handle.h +++ b/qpid/cpp/include/qpid/client/Handle.h @@ -36,7 +36,7 @@ template class PrivateImplRef; * Handles can be null, like a 0 pointer. Use isValid(), isNull() or the * conversion to bool to test for a null handle. */ -template class Handle { +template class QPID_CLIENT_CLASS_EXTERN Handle { public: /**@return true if handle is valid, i.e. not null. */ diff --git a/qpid/cpp/include/qpid/console/Broker.h b/qpid/cpp/include/qpid/console/Broker.h index c2ba8ac81f..4e03d9482e 100644 --- a/qpid/cpp/include/qpid/console/Broker.h +++ b/qpid/cpp/include/qpid/console/Broker.h @@ -49,7 +49,7 @@ namespace console { * * \ingroup qpidconsoleapi */ - class Broker : public client::MessageListener { + class QPID_CONSOLE_CLASS_EXTERN Broker : public client::MessageListener { public: QPID_CONSOLE_EXTERN Broker(SessionManager& sm, client::ConnectionSettings& settings); diff --git a/qpid/cpp/include/qpid/console/Event.h b/qpid/cpp/include/qpid/console/Event.h index ef4ecc791c..2e3fd4a289 100644 --- a/qpid/cpp/include/qpid/console/Event.h +++ b/qpid/cpp/include/qpid/console/Event.h @@ -40,7 +40,7 @@ namespace console { * * \ingroup qmfconsoleapi */ - class Event { + class QPID_CONSOLE_CLASS_EXTERN Event { public: typedef enum { SEV_EMERGENCY = 0, SEV_ALERT = 1, SEV_CRITICAL = 2, SEV_ERROR = 3, diff --git a/qpid/cpp/include/qpid/console/Object.h b/qpid/cpp/include/qpid/console/Object.h index 5a29fdf792..7194d33ce5 100644 --- a/qpid/cpp/include/qpid/console/Object.h +++ b/qpid/cpp/include/qpid/console/Object.h @@ -52,10 +52,10 @@ namespace console { std::map > arguments; }; - class Object { + class QPID_CONSOLE_CLASS_EXTERN Object { public: typedef std::vector Vector; - struct AttributeMap : public std::map > { + struct QPID_CONSOLE_CLASS_EXTERN AttributeMap : public std::map > { QPID_CONSOLE_EXTERN void addRef(const std::string& key, const ObjectId& val); QPID_CONSOLE_EXTERN void addUint(const std::string& key, uint32_t val); QPID_CONSOLE_EXTERN void addInt(const std::string& key, int32_t val); diff --git a/qpid/cpp/include/qpid/console/SequenceManager.h b/qpid/cpp/include/qpid/console/SequenceManager.h index ea0ccf3f77..a06abaeb59 100644 --- a/qpid/cpp/include/qpid/console/SequenceManager.h +++ b/qpid/cpp/include/qpid/console/SequenceManager.h @@ -34,7 +34,7 @@ namespace console { * * \ingroup qpidconsoleapi */ - class SequenceManager { + class QPID_CONSOLE_CLASS_EXTERN SequenceManager { public: typedef std::set set; diff --git a/qpid/cpp/include/qpid/console/SessionManager.h b/qpid/cpp/include/qpid/console/SessionManager.h index b46af549ff..8b61634b94 100644 --- a/qpid/cpp/include/qpid/console/SessionManager.h +++ b/qpid/cpp/include/qpid/console/SessionManager.h @@ -47,14 +47,14 @@ class ConsoleListener; * * \ingroup qmfconsoleapi */ -class SessionManager +class QPID_CONSOLE_CLASS_EXTERN SessionManager { public: typedef std::vector NameVector; typedef std::vector KeyVector; QPID_CONSOLE_EXTERN ~SessionManager(); - struct Settings { + struct QPID_CONSOLE_CLASS_EXTERN Settings { bool rcvObjects; bool rcvEvents; bool rcvHeartbeats; diff --git a/qpid/cpp/include/qpid/framing/FieldTable.h b/qpid/cpp/include/qpid/framing/FieldTable.h index fed431129a..7a783849af 100644 --- a/qpid/cpp/include/qpid/framing/FieldTable.h +++ b/qpid/cpp/include/qpid/framing/FieldTable.h @@ -45,7 +45,7 @@ class Buffer; * * \ingroup clientapi */ -class FieldTable +class QPID_COMMON_CLASS_EXTERN FieldTable { public: typedef boost::shared_ptr ValuePtr; @@ -119,9 +119,6 @@ class FieldTable QPID_COMMON_EXTERN friend std::ostream& operator<<(std::ostream& out, const FieldTable& body); }; -//class FieldNotFoundException{}; -//class UnknownFieldName : public FieldNotFoundException{}; -//class IncorrectFieldType : public FieldNotFoundException{}; } } diff --git a/qpid/cpp/include/qpid/framing/FieldValue.h b/qpid/cpp/include/qpid/framing/FieldValue.h index 458de62fdf..abf98caead 100644 --- a/qpid/cpp/include/qpid/framing/FieldValue.h +++ b/qpid/cpp/include/qpid/framing/FieldValue.h @@ -138,7 +138,7 @@ inline std::ostream& operator<<(std::ostream& out, const FieldValue& v) { } template -class FixedWidthValue : public FieldValue::Data { +class QPID_COMMON_CLASS_EXTERN FixedWidthValue : public FieldValue::Data { uint8_t octets[width]; public: @@ -244,7 +244,7 @@ inline double FieldValue::get() const { } template <> -class FixedWidthValue<0> : public FieldValue::Data { +class QPID_COMMON_CLASS_EXTERN FixedWidthValue<0> : public FieldValue::Data { public: // Implicit default constructor is fine uint32_t encodedSize() const { return 0; } @@ -258,7 +258,7 @@ class FixedWidthValue<0> : public FieldValue::Data { }; template -class VariableWidthValue : public FieldValue::Data { +class QPID_COMMON_CLASS_EXTERN VariableWidthValue : public FieldValue::Data { std::vector octets; public: @@ -290,7 +290,7 @@ class VariableWidthValue : public FieldValue::Data { }; template -class EncodedValue : public FieldValue::Data { +class QPID_COMMON_CLASS_EXTERN EncodedValue : public FieldValue::Data { T value; public: @@ -324,7 +324,7 @@ class EncodedValue : public FieldValue::Data { template inline bool FieldValue::get(T& t) const { - const EncodedValue* v = dynamic_cast< EncodedValue* >(data.get()); + const EncodedValue* v = dynamic_cast< EncodedValue* >(data.get()); if (v != 0) { t = v->getValue(); return true; @@ -338,37 +338,37 @@ inline bool FieldValue::get(T& t) const } } -class Str8Value : public FieldValue { +class QPID_COMMON_CLASS_EXTERN Str8Value : public FieldValue { public: QPID_COMMON_EXTERN Str8Value(const std::string& v); }; -class Str16Value : public FieldValue { +class QPID_COMMON_CLASS_EXTERN Str16Value : public FieldValue { public: QPID_COMMON_EXTERN Str16Value(const std::string& v); }; -class Var16Value : public FieldValue { +class QPID_COMMON_CLASS_EXTERN Var16Value : public FieldValue { public: QPID_COMMON_EXTERN Var16Value(const std::string& v, uint8_t code); }; -class Var32Value : public FieldValue { +class QPID_COMMON_CLASS_EXTERN Var32Value : public FieldValue { public: QPID_COMMON_EXTERN Var32Value(const std::string& v, uint8_t code); }; -class Struct32Value : public FieldValue { +class QPID_COMMON_CLASS_EXTERN Struct32Value : public FieldValue { public: QPID_COMMON_EXTERN Struct32Value(const std::string& v); }; -class FloatValue : public FieldValue +class QPID_COMMON_CLASS_EXTERN FloatValue : public FieldValue { public: QPID_COMMON_EXTERN FloatValue(float f); }; -class DoubleValue : public FieldValue +class QPID_COMMON_CLASS_EXTERN DoubleValue : public FieldValue { public: QPID_COMMON_EXTERN DoubleValue(double f); @@ -377,81 +377,81 @@ class DoubleValue : public FieldValue /* * Basic integer value encodes as signed 32 bit */ -class IntegerValue : public FieldValue { +class QPID_COMMON_CLASS_EXTERN IntegerValue : public FieldValue { public: QPID_COMMON_EXTERN IntegerValue(int v); }; -class TimeValue : public FieldValue { +class QPID_COMMON_CLASS_EXTERN TimeValue : public FieldValue { public: QPID_COMMON_EXTERN TimeValue(uint64_t v); }; -class Integer64Value : public FieldValue { +class QPID_COMMON_CLASS_EXTERN Integer64Value : public FieldValue { public: QPID_COMMON_EXTERN Integer64Value(int64_t v); }; -class Unsigned64Value : public FieldValue { +class QPID_COMMON_CLASS_EXTERN Unsigned64Value : public FieldValue { public: QPID_COMMON_EXTERN Unsigned64Value(uint64_t v); }; -class FieldTableValue : public FieldValue { +class QPID_COMMON_CLASS_EXTERN FieldTableValue : public FieldValue { public: typedef FieldTable ValueType; QPID_COMMON_EXTERN FieldTableValue(const FieldTable&); }; -class ArrayValue : public FieldValue { +class QPID_COMMON_CLASS_EXTERN ArrayValue : public FieldValue { public: QPID_COMMON_EXTERN ArrayValue(const Array&); }; -class VoidValue : public FieldValue { +class QPID_COMMON_CLASS_EXTERN VoidValue : public FieldValue { public: QPID_COMMON_EXTERN VoidValue(); }; -class BoolValue : public FieldValue { +class QPID_COMMON_CLASS_EXTERN BoolValue : public FieldValue { public: QPID_COMMON_EXTERN BoolValue(bool); }; -class Unsigned8Value : public FieldValue { +class QPID_COMMON_CLASS_EXTERN Unsigned8Value : public FieldValue { public: QPID_COMMON_EXTERN Unsigned8Value(uint8_t); }; -class Unsigned16Value : public FieldValue { +class QPID_COMMON_CLASS_EXTERN Unsigned16Value : public FieldValue { public: QPID_COMMON_EXTERN Unsigned16Value(uint16_t); }; -class Unsigned32Value : public FieldValue { +class QPID_COMMON_CLASS_EXTERN Unsigned32Value : public FieldValue { public: QPID_COMMON_EXTERN Unsigned32Value(uint32_t); }; -class Integer8Value : public FieldValue { +class QPID_COMMON_CLASS_EXTERN Integer8Value : public FieldValue { public: QPID_COMMON_EXTERN Integer8Value(int8_t); }; -class Integer16Value : public FieldValue { +class QPID_COMMON_CLASS_EXTERN Integer16Value : public FieldValue { public: QPID_COMMON_EXTERN Integer16Value(int16_t); }; typedef IntegerValue Integer32Value; -class ListValue : public FieldValue { +class QPID_COMMON_CLASS_EXTERN ListValue : public FieldValue { public: typedef List ValueType; QPID_COMMON_EXTERN ListValue(const List&); }; -class UuidValue : public FieldValue { +class QPID_COMMON_CLASS_EXTERN UuidValue : public FieldValue { public: QPID_COMMON_EXTERN UuidValue(const unsigned char*); }; diff --git a/qpid/cpp/include/qpid/framing/Uuid.h b/qpid/cpp/include/qpid/framing/Uuid.h index ccfd7e9534..d50f46e472 100644 --- a/qpid/cpp/include/qpid/framing/Uuid.h +++ b/qpid/cpp/include/qpid/framing/Uuid.h @@ -41,7 +41,7 @@ class Buffer; * TODO: change this implementation as it leaks boost into the * client API */ -struct Uuid : public boost::array { +struct QPID_COMMON_CLASS_EXTERN Uuid : public boost::array { /** If unique is true, generate a unique ID else a null ID. */ QPID_COMMON_EXTERN Uuid(bool unique=false); diff --git a/qpid/cpp/include/qpid/log/Options.h b/qpid/cpp/include/qpid/log/Options.h index 17cbfde9bc..ef5b746ad4 100644 --- a/qpid/cpp/include/qpid/log/Options.h +++ b/qpid/cpp/include/qpid/log/Options.h @@ -28,7 +28,7 @@ namespace qpid { namespace log { /** Logging options for config parser. */ -struct Options : public qpid::Options { +struct QPID_COMMON_CLASS_EXTERN Options : public qpid::Options { /** Pass argv[0] for use in syslog output */ QPID_COMMON_EXTERN Options(const std::string& argv0_=std::string(), const std::string& name_="Logging options"); diff --git a/qpid/cpp/include/qpid/log/Selector.h b/qpid/cpp/include/qpid/log/Selector.h index 061152d7e2..a37f4770a0 100644 --- a/qpid/cpp/include/qpid/log/Selector.h +++ b/qpid/cpp/include/qpid/log/Selector.h @@ -32,7 +32,7 @@ struct Options; * * Thread object unsafe, pass-by-value type. */ -class Selector { +class QPID_COMMON_CLASS_EXTERN Selector { public: /** Empty selector selects nothing */ Selector() {} diff --git a/qpid/cpp/include/qpid/log/SinkOptions.h b/qpid/cpp/include/qpid/log/SinkOptions.h index 7ec2cfbc17..935804b0e4 100644 --- a/qpid/cpp/include/qpid/log/SinkOptions.h +++ b/qpid/cpp/include/qpid/log/SinkOptions.h @@ -35,7 +35,7 @@ class Logger; * can't be assumed to all have C++ iostreams or files. Thus, this class * is primarily for implementing in a platform-specific way. */ -struct SinkOptions : public qpid::Options { +struct QPID_COMMON_CLASS_EXTERN SinkOptions : public qpid::Options { // Create a platform's SinkOptions. Pass argv0 as the program name, // useful for syslog-type logging. diff --git a/qpid/cpp/include/qpid/log/Statement.h b/qpid/cpp/include/qpid/log/Statement.h index 7b3ab60b81..1871c864dd 100644 --- a/qpid/cpp/include/qpid/log/Statement.h +++ b/qpid/cpp/include/qpid/log/Statement.h @@ -56,7 +56,7 @@ struct LevelTraits { }; /** POD struct representing a logging statement in source code. */ -struct Statement { +struct QPID_COMMON_CLASS_EXTERN Statement { bool enabled; const char* file; int line; diff --git a/qpid/cpp/include/qpid/management/Buffer.h b/qpid/cpp/include/qpid/management/Buffer.h index c32494b8c0..205ab1f5b0 100644 --- a/qpid/cpp/include/qpid/management/Buffer.h +++ b/qpid/cpp/include/qpid/management/Buffer.h @@ -40,7 +40,7 @@ struct OutOfBounds : qpid::types::Exception { * This class is a wrapper around qpid::framing::Buffer that does not include any dependencies * from boost or from qpid::framing. */ -class Buffer +class QPID_COMMON_CLASS_EXTERN Buffer { public: QPID_COMMON_EXTERN Buffer(char* data=0, uint32_t size=0); diff --git a/qpid/cpp/include/qpid/management/ManagementObject.h b/qpid/cpp/include/qpid/management/ManagementObject.h index 16bf21038c..4fd9507097 100644 --- a/qpid/cpp/include/qpid/management/ManagementObject.h +++ b/qpid/cpp/include/qpid/management/ManagementObject.h @@ -37,7 +37,7 @@ class ObjectId; class ManagementObject; -class AgentAttachment { +class QPID_COMMON_CLASS_EXTERN AgentAttachment { friend class ObjectId; private: uint64_t first; @@ -48,7 +48,7 @@ public: }; -class ObjectId { +class QPID_COMMON_CLASS_EXTERN ObjectId { protected: const AgentAttachment* agent; uint64_t first; @@ -88,7 +88,7 @@ public: friend QPID_COMMON_EXTERN std::ostream& operator<<(std::ostream&, const ObjectId&); }; -class ManagementItem { +class QPID_COMMON_CLASS_EXTERN ManagementItem { public: static const uint8_t TYPE_U8 = 1; static const uint8_t TYPE_U16 = 2; diff --git a/qpid/cpp/include/qpid/management/Mutex.h b/qpid/cpp/include/qpid/management/Mutex.h index 67ae04bae9..59b3464f54 100644 --- a/qpid/cpp/include/qpid/management/Mutex.h +++ b/qpid/cpp/include/qpid/management/Mutex.h @@ -48,7 +48,7 @@ namespace qpid { L& mutex; }; - class Mutex { + class QPID_COMMON_CLASS_EXTERN Mutex { public: typedef ScopedLockTemplate ScopedLock; typedef ScopedUnlockTemplate ScopedUnlock; diff --git a/qpid/cpp/include/qpid/sys/IOHandle.h b/qpid/cpp/include/qpid/sys/IOHandle.h index 45fc8c240a..0a72f12165 100644 --- a/qpid/cpp/include/qpid/sys/IOHandle.h +++ b/qpid/cpp/include/qpid/sys/IOHandle.h @@ -33,14 +33,14 @@ namespace sys { */ class PollerHandle; class IOHandlePrivate; -class IOHandle { +class QPID_COMMON_CLASS_EXTERN IOHandle { friend class PollerHandle; friend class IOHandlePrivate; protected: IOHandlePrivate* const impl; - IOHandle(IOHandlePrivate*); + QPID_COMMON_EXTERN IOHandle(IOHandlePrivate*); QPID_COMMON_EXTERN virtual ~IOHandle(); }; diff --git a/qpid/cpp/include/qpid/sys/Thread.h b/qpid/cpp/include/qpid/sys/Thread.h index f556612908..cf4d10500f 100644 --- a/qpid/cpp/include/qpid/sys/Thread.h +++ b/qpid/cpp/include/qpid/sys/Thread.h @@ -44,7 +44,7 @@ namespace sys { class Runnable; class ThreadPrivate; -class Thread +class QPID_COMMON_CLASS_EXTERN Thread { boost::shared_ptr impl; diff --git a/qpid/cpp/include/qpid/sys/Time.h b/qpid/cpp/include/qpid/sys/Time.h index 9c5ac66e9a..e9e164b3fa 100644 --- a/qpid/cpp/include/qpid/sys/Time.h +++ b/qpid/cpp/include/qpid/sys/Time.h @@ -77,7 +77,7 @@ class Duration; * with one of the AbsTime constructors). However trying to add 2 AbsTimes * doesn't make sense. */ -class AbsTime { +class QPID_COMMON_CLASS_EXTERN AbsTime { friend class Duration; friend class Condition; diff --git a/qpid/cpp/include/qpid/sys/posix/Mutex.h b/qpid/cpp/include/qpid/sys/posix/Mutex.h index e2b21b5a56..bef35cc19f 100644 --- a/qpid/cpp/include/qpid/sys/posix/Mutex.h +++ b/qpid/cpp/include/qpid/sys/posix/Mutex.h @@ -20,6 +20,7 @@ */ #include "qpid/sys/posix/check.h" +#include "qpid/CommonImportExport.h" #include #include @@ -32,9 +33,9 @@ class Condition; /** * Mutex lock. */ -class Mutex : private boost::noncopyable { +class QPID_COMMON_CLASS_EXTERN Mutex : private boost::noncopyable { friend class Condition; - static const pthread_mutexattr_t* getAttribute(); + QPID_COMMON_EXTERN static const pthread_mutexattr_t* getAttribute(); public: typedef ::qpid::sys::ScopedLock ScopedLock; @@ -54,7 +55,7 @@ protected: /** * RW lock. */ -class RWlock : private boost::noncopyable { +class QPID_COMMON_CLASS_EXTERN RWlock : private boost::noncopyable { friend class Condition; public: @@ -78,7 +79,7 @@ protected: * PODMutex is a POD, can be static-initialized with * PODMutex m = QPID_PODMUTEX_INITIALIZER */ -struct PODMutex +struct QPID_COMMON_CLASS_EXTERN PODMutex { typedef ::qpid::sys::ScopedLock ScopedLock; diff --git a/qpid/cpp/include/qpid/sys/posix/PrivatePosix.h b/qpid/cpp/include/qpid/sys/posix/PrivatePosix.h index 79cb950275..2ff5f9e64c 100644 --- a/qpid/cpp/include/qpid/sys/posix/PrivatePosix.h +++ b/qpid/cpp/include/qpid/sys/posix/PrivatePosix.h @@ -24,6 +24,7 @@ #include "qpid/sys/Time.h" #include "qpid/sys/IOHandle.h" +#include "qpid/CommonImportExport.h" struct timespec; struct timeval; @@ -33,13 +34,14 @@ namespace qpid { namespace sys { // Private Time related implementation details -struct timespec& toTimespec(struct timespec& ts, const Duration& t); -struct timeval& toTimeval(struct timeval& tv, const Duration& t); -Duration toTime(const struct timespec& ts); +QPID_COMMON_EXTERN struct timespec& toTimespec(struct timespec& ts, const Duration& t); +QPID_COMMON_EXTERN struct timeval& toTimeval(struct timeval& tv, const Duration& t); +QPID_COMMON_EXTERN Duration toTime(const struct timespec& ts); // Private SocketAddress details class SocketAddress; -const struct addrinfo& getAddrInfo(const SocketAddress&); +// FIXME aconway 2011-03-22: ?? +const struct addrinfo& QPID_COMMON_EXTERN getAddrInfo(const SocketAddress&); // Private fd related implementation details class IOHandlePrivate { @@ -51,7 +53,7 @@ public: int fd; }; -int toFd(const IOHandlePrivate* h); +QPID_COMMON_EXTERN int toFd(const IOHandlePrivate* h); // Posix fd as an IOHandle class PosixIOHandle : public IOHandle { diff --git a/qpid/cpp/managementgen/qmfgen/templates/Args.h b/qpid/cpp/managementgen/qmfgen/templates/Args.h index 89a5bec9b9..857de769db 100644 --- a/qpid/cpp/managementgen/qmfgen/templates/Args.h +++ b/qpid/cpp/managementgen/qmfgen/templates/Args.h @@ -10,9 +10,9 @@ // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -23,13 +23,14 @@ /*MGEN:Root.Disclaimer*/ +#include "qpid/broker/BrokerImportExport.h" #include "qpid/management/Args.h" #include -namespace qmf { +namespace qmf { /*MGEN:Method.OpenNamespaces*/ - class Args/*MGEN:Method.NameCamel*/ : public ::qpid::management::Args +class QPID_BROKER_CLASS_EXTERN Args/*MGEN:Method.NameCamel*/ : public ::qpid::management::Args { public: /*MGEN:Method.Arguments*/ diff --git a/qpid/cpp/managementgen/qmfgen/templates/Class.h b/qpid/cpp/managementgen/qmfgen/templates/Class.h index 4bcd423a26..f14aaa953b 100644 --- a/qpid/cpp/managementgen/qmfgen/templates/Class.h +++ b/qpid/cpp/managementgen/qmfgen/templates/Class.h @@ -10,9 +10,9 @@ // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -24,6 +24,7 @@ /*MGEN:Root.Disclaimer*/ #include "qpid/management/ManagementObject.h" +#include "qpid/broker/BrokerImportExport.h" namespace qpid { namespace management { @@ -34,7 +35,7 @@ namespace qpid { namespace qmf { /*MGEN:Class.OpenNamespaces*/ -class /*MGEN:Class.NameCap*/ : public ::qpid::management::ManagementObject +class QPID_BROKER_CLASS_EXTERN /*MGEN:Class.NameCap*/ : public ::qpid::management::ManagementObject { private: diff --git a/qpid/cpp/managementgen/qmfgen/templates/Event.h b/qpid/cpp/managementgen/qmfgen/templates/Event.h index 4f912cf220..3187e273cc 100644 --- a/qpid/cpp/managementgen/qmfgen/templates/Event.h +++ b/qpid/cpp/managementgen/qmfgen/templates/Event.h @@ -10,9 +10,9 @@ // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -24,11 +24,12 @@ /*MGEN:Root.Disclaimer*/ #include "qpid/management/ManagementEvent.h" +#include "qpid/broker/BrokerImportExport.h" namespace qmf { /*MGEN:Event.OpenNamespaces*/ -class Event/*MGEN:Event.NameCap*/ : public ::qpid::management::ManagementEvent +class QPID_BROKER_CLASS_EXTERN Event/*MGEN:Event.NameCap*/ : public ::qpid::management::ManagementEvent { private: static void writeSchema (std::string& schema); diff --git a/qpid/cpp/managementgen/qmfgen/templates/Package.h b/qpid/cpp/managementgen/qmfgen/templates/Package.h index 569c7cfb33..727e8a4076 100644 --- a/qpid/cpp/managementgen/qmfgen/templates/Package.h +++ b/qpid/cpp/managementgen/qmfgen/templates/Package.h @@ -10,9 +10,9 @@ // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -24,11 +24,12 @@ /*MGEN:Root.Disclaimer*/ #include "qpid//*MGEN:Class.AgentHeaderLocation*//ManagementAgent.h" +#include "qpid/broker/BrokerImportExport.h" namespace qmf { /*MGEN:Class.OpenNamespaces*/ -class Package +class QPID_BROKER_CLASS_EXTERN Package { public: Package (::qpid::management::ManagementAgent* agent); @@ -36,6 +37,6 @@ class Package }; }/*MGEN:Class.CloseNamespaces*/ - + #endif /*!_MANAGEMENT_PACKAGE_/*MGEN:Schema.PackageNameUpper*/_*/ diff --git a/qpid/cpp/managementgen/qmfgen/templates/V2Package.h b/qpid/cpp/managementgen/qmfgen/templates/V2Package.h index 1d4f907ab3..906cc28862 100644 --- a/qpid/cpp/managementgen/qmfgen/templates/V2Package.h +++ b/qpid/cpp/managementgen/qmfgen/templates/V2Package.h @@ -10,9 +10,9 @@ // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -27,11 +27,12 @@ #include #include #include +#include namespace qmf { /*MGEN:Class.OpenNamespaces*/ -class PackageDefinition +class QPID_BROKER_CLASS_EXTERN PackageDefinition { public: ~PackageDefinition() {} @@ -41,6 +42,6 @@ class PackageDefinition }; }/*MGEN:Class.CloseNamespaces*/ - + #endif /*!_QMF_PACKAGE_/*MGEN:Schema.PackageNameUpper*/_*/ diff --git a/qpid/cpp/rubygen/0-10/exceptions.rb b/qpid/cpp/rubygen/0-10/exceptions.rb index 02e3a5d547..726f2fc4fb 100755 --- a/qpid/cpp/rubygen/0-10/exceptions.rb +++ b/qpid/cpp/rubygen/0-10/exceptions.rb @@ -33,7 +33,8 @@ class GenExceptions < CppGen name=c.name.typename+suffix+"Exception" genl doxygen_comment { genl c.doc } - struct(name, "public #{base}") { + cpp_extern_class("QPID_COMMON_CLASS_EXTERN", name, "public #{base}") { + public genl "#{name}(const std::string& msg=std::string())" genl " : #{base}(#{ns}::#{c.name.shout}, msg) {}" protected @@ -41,11 +42,11 @@ class GenExceptions < CppGen } } end - + def gen_exceptions() - h_file("#{@dir}/exceptions") { + h_file("#{@dir}/exceptions") { include "qpid/amqp_0_10/Exception" - namespace("#{@ns}") { + namespace("#{@ns}") { error_code = @amqp.class_("execution").domain("error-code").enum exceptions_for_enum(error_code, "SessionAbortedException", "execution") genl @@ -62,7 +63,7 @@ class GenExceptions < CppGen } } end - + def generate() gen_exceptions end diff --git a/qpid/cpp/rubygen/framing.0-10/MethodBodyConstVisitor.rb b/qpid/cpp/rubygen/framing.0-10/MethodBodyConstVisitor.rb index d784e589df..69111af4aa 100755 --- a/qpid/cpp/rubygen/framing.0-10/MethodBodyConstVisitor.rb +++ b/qpid/cpp/rubygen/framing.0-10/MethodBodyConstVisitor.rb @@ -21,7 +21,7 @@ $: << ".." # Include .. in load path require 'cppgen' class MethodBodyConstVisitorGen < CppGen - + def initialize(outdir, amqp) super(outdir, amqp) @namespace="qpid::framing" @@ -31,9 +31,10 @@ class MethodBodyConstVisitorGen < CppGen def generate() h_file("#{@filename}") { - namespace(@namespace) { + include("qpid/CommonImportExport.h") + namespace(@namespace) { @amqp.methods_.each { |m| genl "class #{m.body_name};" } - cpp_class("MethodBodyConstVisitor") { + cpp_extern_class("QPID_COMMON_CLASS_EXTERN", "MethodBodyConstVisitor") { genl "public:" genl "virtual ~MethodBodyConstVisitor() {}" @amqp.methods_.each { |m| genl "virtual void visit(const #{m.body_name}&) = 0;" } diff --git a/qpid/cpp/rubygen/framing.0-10/Session.rb b/qpid/cpp/rubygen/framing.0-10/Session.rb index e800df9b2e..15079192f8 100755 --- a/qpid/cpp/rubygen/framing.0-10/Session.rb +++ b/qpid/cpp/rubygen/framing.0-10/Session.rb @@ -18,7 +18,7 @@ # under the License. # # Usage: output_directory xml_spec_file [xml_spec_file...] -# +# $: << '..' require 'cppgen' @@ -31,7 +31,7 @@ class CppGen gen_methods.each { |m| m.set_sync_default(sync_default) } end - + # Generates a doxygen comment for AmqpMethod m. def doxygen(m) doxygen_comment { @@ -125,7 +125,7 @@ end class SessionNoKeywordGen < CppGen include SyncAsync - + def initialize(outdir, amqp, async) super(outdir, amqp) @async=async @@ -140,25 +140,25 @@ class SessionNoKeywordGen < CppGen h_file(@file) { include "qpid/client/#{@version_base}.h" include "qpid/client/ClientImportExport.h" - namespace(@namespace) { + namespace(@namespace) { doxygen_comment { genl "AMQP #{@amqp.version} #{sync_adjective} session API." genl @amqp.class_("session").doc # FIXME aconway 2008-05-23: additional doc on sync/async use. } - cpp_class(@classname, "public #{@version_base}") { + cpp_extern_class("QPID_CLIENT_CLASS_EXTERN", @classname, "public #{@version_base}") { public decl_ctor_opeq() session_methods(sync_default).each { |m| genl doxygen(m) - args=m.sig_c_default.join(", ") - genl "QPID_CLIENT_EXTERN #{m.return_type(@async)} #{m.session_function}(#{args});" + args=m.sig_c_default.join(", ") + genl "QPID_CLIENT_EXTERN #{m.return_type(@async)} #{m.session_function}(#{args});" } } }} - cpp_file(@file) { + cpp_file(@file) { include "qpid/client/#{@classname}" include "qpid/framing/all_method_bodies.h" include "qpid/client/SessionImpl.h" @@ -228,11 +228,11 @@ class SessionGen < CppGen # Generate keyword tag declarations. genl "#define BOOST_PARAMETER_MAX_ARITY #{max_arity}" include "" - namespace("qpid::client::arg") { + namespace("qpid::client::arg") { keyword_methods.map{ |m| m.param_names_c }.flatten.uniq.each { |k| genl "BOOST_PARAMETER_KEYWORD(keyword_tags, #{k})" }} - } + } public_api("#{@fqclass.file}.h") h_file(@fqclass.file) { include @fqbase.file @@ -263,7 +263,7 @@ declarations. \\ingroup clientapi -\\details +\\details

Publishing Messages

    @@ -274,7 +274,7 @@ declarations. for (int i=0; i<10; i++) { message.setData(message_data.str()); - async(session).messageTransfer(arg::content=message, arg::destination="amq.direct"); + async(session).messageTransfer(arg::content=message, arg::destination="amq.direct"); } session.sync(); @@ -359,23 +359,23 @@ session.sync();

    Accepting, Acquiring, Rejecting, or Releasing Messages

    • messageAccept() — acknowledges messages

      -
      SequenceSet tobeAccepted; 
      -toAccepted.add(msg.getId()); 
      +
      SequenceSet tobeAccepted;
      +toAccepted.add(msg.getId());
       session.messageAccept(toBeAccepted);
    • messageAcquire()

      SequenceSet tobeAcquired;
      -toBeAcquired.add(msg.getId()); 
      +toBeAcquired.add(msg.getId());
       session.messageAcquire(toBeAcquired);
    • messageReject()

      -
      SequenceSet tobeRejected; 
      -toRejected.add(msg.getId()); 
      +
      SequenceSet tobeRejected;
      +toRejected.add(msg.getId());
       session.messageReject(toBeRejected);
    • messageRelease()

      -
      SequenceSet tobeReleased; 
      -toReleased.add(msg.getId()); 
      +
      SequenceSet tobeReleased;
      +toReleased.add(msg.getId());
       session.messageRelease(toBeReleased);
    @@ -394,7 +394,7 @@ session.messageRelease(toBeReleased); EOS } # Session class. - cpp_class(@classname,"public #{@base}") { + cpp_extern_class("QPID_COMMON_CLASS_EXTERN", @classname,"public #{@base}") { public decl_ctor_opeq() private diff --git a/qpid/cpp/rubygen/framing.0-10/constants.rb b/qpid/cpp/rubygen/framing.0-10/constants.rb index 85bfb96ac0..63bf107e38 100755 --- a/qpid/cpp/rubygen/framing.0-10/constants.rb +++ b/qpid/cpp/rubygen/framing.0-10/constants.rb @@ -21,7 +21,7 @@ $: << ".." # Include .. in load path require 'cppgen' class ConstantsGen < CppGen - + def initialize(outdir, amqp) super(outdir, amqp) @namespace="qpid::framing" @@ -51,11 +51,11 @@ class ConstantsGen < CppGen def typecode_h_cpp path="#{@dir}/TypeCode" - public_api(path+".h") + public_api(path+".h") h_file(path) { include("") include("\"qpid/sys/IntegerTypes.h\"") - namespace(@namespace) { + namespace(@namespace) { scope("enum TypeCode {", "};") { genl @amqp.types.map { |t| "#{typecode_enum t} = #{t.code}" if t.code }.compact.join(",\n") } @@ -80,7 +80,7 @@ EOS include("qpid/Exception.h") include("qpid/Msg.h") include("") - namespace(@namespace) { + namespace(@namespace) { scope("const char* typeName(TypeCode t) {") { scope("switch (t) {") { @amqp.types.each { |t| genl "case #{typecode_enum t}: return \"#{t.name}\";" if t.code } @@ -105,7 +105,7 @@ EOS } } end - + def enum_h() public_api("#{@dir}/enum.h") h_file("#{@dir}/enum.h") { @@ -125,7 +125,7 @@ EOS def declare_enum(enum) # Generated like this: enum containing_class::Foo { FOO_X, FOO_Y; } name="#{enum.parent.name.caps}" - prefix=enum.parent.name.shout+"_" + prefix=enum.parent.name.shout+"_" scope("enum #{name} {","};") { genl enum.choices.collect { |c| "#{prefix}#{c.name.shout}=#{c.value}" }.join(",\n") } @@ -136,7 +136,8 @@ EOS value="#{package}::#{enum.parent.name.shout}_#{c.name.shout}" genl doxygen_comment { genl c.doc } - struct(c.name.caps+"Exception", base) { + cpp_extern_class("QPID_COMMON_CLASS_EXTERN", c.name.caps+"Exception", "public #{base}") { + public genl "std::string getPrefix() const { return \"#{c.name}\"; }" genl "#{c.name.caps}Exception(const std::string& msg=std::string()) : #{base}(#{value}, \"\"+msg) {}" } @@ -156,7 +157,7 @@ EOS enum = @amqp.class_(class_name).domain(domain_name).enum enum.choices.each { |c| assign = "holder = new #{c.name.caps}Exception(text); " unless c.name == "normal" - genl "case #{c.value}: #{assign}break;" + genl "case #{c.value}: #{assign}break;" } genl "default: holder = new #{invalid}(QPID_MSG(\"Bad #{enum.parent.name}: \" << code << \": \" << text));" } diff --git a/qpid/cpp/src/Makefile.am b/qpid/cpp/src/Makefile.am index 15021cc68b..c73a15b564 100644 --- a/qpid/cpp/src/Makefile.am +++ b/qpid/cpp/src/Makefile.am @@ -134,7 +134,11 @@ AM_CXXFLAGS += -DBOOST_FILESYSTEM_VERSION=2 ## Automake macros to build libraries and executables. qpidd_CXXFLAGS = $(AM_CXXFLAGS) -DQPIDD_MODULE_DIR=\"$(dmoduleexecdir)\" -DQPIDD_CONF_FILE=\"$(sysconfdir)/qpidd.conf\" -libqpidclient_la_CXXFLAGS = $(AM_CXXFLAGS) -DQPIDC_MODULE_DIR=\"$(cmoduleexecdir)\" -DQPIDC_CONF_FILE=\"$(confdir)/qpidc.conf\" +libqpidclient_la_CXXFLAGS = \ + $(AM_CXXFLAGS) \ + -DQPIDC_MODULE_DIR=\"$(cmoduleexecdir)\" \ + -DQPIDC_CONF_FILE=\"$(confdir)/qpidc.conf\" \ + -Dqpidclient_EXPORTS qpidd_LDADD = \ libqpidbroker.la \ @@ -148,6 +152,7 @@ qpidd_SOURCES = qpidd.cpp qpidd.h $(posix_qpidd_src) ## Platform specific code. # Posix-specific code +libqpidcommon_la_CXXFLAGS=$(AM_CXXFLAGS) -Dqpidcommon_EXPORTS libqpidcommon_la_SOURCES += \ qpid/log/posix/SinkOptions.cpp \ qpid/sys/posix/IOHandle.cpp \ @@ -230,7 +235,7 @@ librdmawrap_la_LIBADD = \ -lrdmacm \ -libverbs librdmawrap_la_CXXFLAGS = \ - $(AM_CXXFLAGS) -Wno-missing-field-initializers + $(AM_CXXFLAGS) -Wno-missing-field-initializers -Drdmawrap_EXPORTS lib_LTLIBRARIES += \ librdmawrap.la RDMAWRAP_VERSION_INFO = 2:0:0 @@ -244,7 +249,7 @@ rdma_la_LIBADD = \ -libverbs rdma_la_LDFLAGS = $(PLUGINLDFLAGS) rdma_la_CXXFLAGS = \ - $(AM_CXXFLAGS) -Wno-missing-field-initializers + $(AM_CXXFLAGS) -Wno-missing-field-initializers -Drdma_EXPORTS dmoduleexec_LTLIBRARIES += \ rdma.la @@ -256,7 +261,7 @@ rdmaconnector_la_LIBADD = \ -libverbs rdmaconnector_la_LDFLAGS = $(PLUGINLDFLAGS) rdmaconnector_la_CXXFLAGS = \ - $(AM_CXXFLAGS) -Wno-missing-field-initializers + $(AM_CXXFLAGS) -Wno-missing-field-initializers -Drdmaconnector_EXPORTS cmoduleexec_LTLIBRARIES += \ rdmaconnector.la @@ -360,7 +365,7 @@ libqpidcommon_la_SOURCES += \ qpid/amqp_0_10/SessionHandler.cpp \ qpid/amqp_0_10/SessionHandler.h \ qpid/amqp_0_10/apply.h \ - qpid/assert.cpp qpid/assert.h \ + qpid/assert.cpp \ qpid/assert.h \ qpid/framing/AMQBody.cpp \ qpid/framing/AMQBody.h \ @@ -508,6 +513,7 @@ QPIDCOMMON_VERSION_INFO = 2:0:0 libqpidcommon_la_LDFLAGS=-version-info $(QPIDCOMMON_VERSION_INFO) libqpidbroker_la_LIBADD = libqpidcommon.la +libqpidbroker_la_CXXFLAGS = $(AM_CXXFLAGS) -Dqpidbroker_EXPORTS libqpidbroker_la_SOURCES = \ $(mgen_broker_cpp) \ $(posix_broker_src) \ @@ -683,7 +689,6 @@ QPIDBROKER_VERSION_INFO = 2:0:0 libqpidbroker_la_LDFLAGS = -version-info $(QPIDBROKER_VERSION_INFO) libqpidclient_la_LIBADD = libqpidcommon.la -luuid - libqpidclient_la_SOURCES = \ $(rgen_client_srcs) \ qpid/client/Bounds.cpp \ @@ -742,7 +747,8 @@ libqpidclient_la_SOURCES = \ QPIDCLIENT_VERSION_INFO = 2:0:0 libqpidclient_la_LDFLAGS = -version-info $(QPIDCLIENT_VERSION_INFO) -libqpidtypes_la_LIBADD= -luuid +libqpidtypes_la_LIBADD=-luuid +libqpidtypes_la_CXXFLAGS = $(AM_CXXFLAGS) -Dqpidtypes_EXPORTS libqpidtypes_la_SOURCES= \ qpid/types/Exception.cpp \ qpid/types/Uuid.cpp \ @@ -753,6 +759,7 @@ QPIDTYPES_VERSION_INFO = 1:0:0 libqpidtypes_la_LDFLAGS = -version-info $(QPIDTYPES_VERSION_INFO) libqpidmessaging_la_LIBADD = libqpidclient.la libqpidtypes.la +libqpidmessaging_la_CXXFLAGS = $(AM_CXXFLAGS) -Dqpidmessaging_EXPORTS libqpidmessaging_la_SOURCES = \ qpid/messaging/Address.cpp \ qpid/messaging/AddressParser.h \ diff --git a/qpid/cpp/src/qmf.mk b/qpid/cpp/src/qmf.mk index f3462f1a93..aee51475f9 100644 --- a/qpid/cpp/src/qmf.mk +++ b/qpid/cpp/src/qmf.mk @@ -6,9 +6,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -19,7 +19,7 @@ # # qmf library makefile fragment, to be included in Makefile.am -# +# lib_LTLIBRARIES += \ libqmf.la \ libqmfengine.la \ @@ -155,6 +155,7 @@ libqmfengine_la_SOURCES = \ qmf/engine/ValueImpl.h libqmf_la_LIBADD = libqmfengine.la +libqmf_la_CXXFLAGS = $(AM_CXXFLAGS) -Dqmf_EXPORTS libqmf2_la_LIBADD = libqpidmessaging.la libqpidtypes.la libqmfengine_la_LIBADD = libqpidclient.la diff --git a/qpid/cpp/src/qmf/QueryImpl.h b/qpid/cpp/src/qmf/QueryImpl.h index 27ec427684..32fdc4d715 100644 --- a/qpid/cpp/src/qmf/QueryImpl.h +++ b/qpid/cpp/src/qmf/QueryImpl.h @@ -9,9 +9,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -21,6 +21,7 @@ * */ +#include "qmf/ImportExport.h" #include "qpid/RefCounted.h" #include "qmf/Query.h" #include "qmf/DataAddr.h" @@ -30,7 +31,7 @@ #include namespace qmf { - class QueryImpl : public virtual qpid::RefCounted { + class QMF_CLASS_EXTERN QueryImpl : public virtual qpid::RefCounted { public: // // Public impl-only methods @@ -66,7 +67,7 @@ namespace qmf { void parsePredicate(const std::string& s); }; - struct QueryImplAccess + struct QMF_CLASS_EXTERN QueryImplAccess { static QueryImpl& get(Query&); static const QueryImpl& get(const Query&); diff --git a/qpid/cpp/src/qmf/SchemaImpl.h b/qpid/cpp/src/qmf/SchemaImpl.h index 1c88f87808..77d64bd964 100644 --- a/qpid/cpp/src/qmf/SchemaImpl.h +++ b/qpid/cpp/src/qmf/SchemaImpl.h @@ -9,9 +9,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -21,6 +21,7 @@ * */ +#include "qmf/ImportExport.h" #include "qpid/RefCounted.h" #include "qmf/PrivateImplRef.h" #include "qmf/exceptions.h" @@ -37,7 +38,7 @@ namespace management { }} namespace qmf { - class SchemaImpl : public virtual qpid::RefCounted { + class QMF_CLASS_EXTERN SchemaImpl : public virtual qpid::RefCounted { public: // // Impl-only public methods @@ -85,7 +86,7 @@ namespace qmf { bool isCompatibleType(int qmfType, qpid::types::VariantType qpidType) const; }; - struct SchemaImplAccess + struct QMF_CLASS_EXTERN SchemaImplAccess { static SchemaImpl& get(Schema&); static const SchemaImpl& get(const Schema&); diff --git a/qpid/cpp/src/qpid/DataDir.h b/qpid/cpp/src/qpid/DataDir.h index 828299f3ba..a653201828 100644 --- a/qpid/cpp/src/qpid/DataDir.h +++ b/qpid/cpp/src/qpid/DataDir.h @@ -34,7 +34,7 @@ namespace qpid { /** * DataDir class. */ -class DataDir +class QPID_COMMON_CLASS_EXTERN DataDir { const bool enabled; const std::string dirPath; @@ -48,7 +48,7 @@ class DataDir bool isEnabled() { return enabled; } const std::string& getPath() { return dirPath; } }; - + } // namespace qpid #endif /*!QPID_DATADIR_H*/ diff --git a/qpid/cpp/src/qpid/DisableExceptionLogging.h b/qpid/cpp/src/qpid/DisableExceptionLogging.h index 04a9240513..48fcb08ce0 100644 --- a/qpid/cpp/src/qpid/DisableExceptionLogging.h +++ b/qpid/cpp/src/qpid/DisableExceptionLogging.h @@ -29,7 +29,7 @@ namespace qpid { * Temporarily disable logging in qpid::Exception constructor. * Used by log::Logger to avoid logging exceptions during Logger construction. */ -struct DisableExceptionLogging +struct QPID_COMMON_CLASS_EXTERN DisableExceptionLogging { QPID_COMMON_EXTERN DisableExceptionLogging(); QPID_COMMON_EXTERN ~DisableExceptionLogging(); diff --git a/qpid/cpp/src/qpid/Modules.h b/qpid/cpp/src/qpid/Modules.h index 159dd156c1..38011cd496 100644 --- a/qpid/cpp/src/qpid/Modules.h +++ b/qpid/cpp/src/qpid/Modules.h @@ -29,7 +29,7 @@ namespace qpid { -struct ModuleOptions : public qpid::Options { +struct QPID_COMMON_CLASS_EXTERN ModuleOptions : public qpid::Options { std::string loadDir; std::vector load; bool noLoad; diff --git a/qpid/cpp/src/qpid/Plugin.h b/qpid/cpp/src/qpid/Plugin.h index 4e057872b9..a0beba0d92 100644 --- a/qpid/cpp/src/qpid/Plugin.h +++ b/qpid/cpp/src/qpid/Plugin.h @@ -34,18 +34,18 @@ struct Options; /** * Plug-in base class. */ -class Plugin : private boost::noncopyable { +class QPID_COMMON_CLASS_EXTERN Plugin : private boost::noncopyable { public: typedef std::vector Plugins; /** Default value returned by initOrder() */ static const int DEFAULT_INIT_ORDER=1000; - + /** * Base interface for targets that can receive plug-ins. * Also allows plug-ins to attach a a function to be called * when the target is 'finalized'. */ - class Target : private boost::noncopyable + class QPID_COMMON_CLASS_EXTERN Target : private boost::noncopyable { public: /** Calls finalize() if not already called. */ @@ -63,19 +63,19 @@ class Plugin : private boost::noncopyable { /** * Constructor registers the plug-in to appear in getPlugins(). - * + * * A concrete Plugin is instantiated as a global or static - * member variable in a library so it is registered during + * member variable in a library so it is registered during * initialization when the library is loaded. */ QPID_COMMON_EXTERN Plugin(); - + QPID_COMMON_EXTERN virtual ~Plugin(); /** * Configuration options for the plugin. * Then will be updated during option parsing by the host program. - * + * * @return An options group or 0 for no options. Default returns 0. * Plugin retains ownership of return value. */ @@ -94,7 +94,7 @@ class Plugin : private boost::noncopyable { /** * Initialize Plugin functionality on a Target. Called after * initializing the target. - * + * * Plugins should ignore targets they don't recognize. * * Called after the target is fully initialized. @@ -108,7 +108,7 @@ class Plugin : private boost::noncopyable { * a lower/higher value than DEFAULT_INIT_ORDER. */ QPID_COMMON_EXTERN virtual int initOrder() const; - + /** List of registered Plugin objects. * Caller must not delete plugin pointers. */ @@ -123,7 +123,7 @@ class Plugin : private boost::noncopyable { /** For each registered plugin, add plugin.getOptions() to opts. */ QPID_COMMON_EXTERN static void addOptions(Options& opts); }; - + } // namespace qpid #endif /*!QPID_PLUGIN_H*/ diff --git a/qpid/cpp/src/qpid/RefCountedBuffer.h b/qpid/cpp/src/qpid/RefCountedBuffer.h index f0ea86130b..8c23a3ae93 100644 --- a/qpid/cpp/src/qpid/RefCountedBuffer.h +++ b/qpid/cpp/src/qpid/RefCountedBuffer.h @@ -24,13 +24,14 @@ #include #include +#include "qpid/CommonImportExport.h" namespace qpid { /** * Reference-counted byte buffer. No alignment guarantees. */ -class RefCountedBuffer : public RefCounted { +class QPID_COMMON_CLASS_EXTERN RefCountedBuffer : public RefCounted { public: /** Create a reference counted buffer of size n */ static BufferRef create(size_t n); diff --git a/qpid/cpp/src/qpid/SaslFactory.h b/qpid/cpp/src/qpid/SaslFactory.h index 8554597147..8b15f62ba0 100644 --- a/qpid/cpp/src/qpid/SaslFactory.h +++ b/qpid/cpp/src/qpid/SaslFactory.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -31,7 +31,7 @@ namespace qpid { * Factory for instances of the Sasl interface through which Sasl * support is provided to a ConnectionHandler. */ -class SaslFactory +class QPID_COMMON_CLASS_EXTERN SaslFactory { public: QPID_COMMON_EXTERN std::auto_ptr create(const std::string & userName, const std::string & password, const std::string & serviceName, const std::string & hostName, int minSsf, int maxSsf, bool allowInteraction=true ); diff --git a/qpid/cpp/src/qpid/SessionState.h b/qpid/cpp/src/qpid/SessionState.h index 02853b1143..4f1d504450 100644 --- a/qpid/cpp/src/qpid/SessionState.h +++ b/qpid/cpp/src/qpid/SessionState.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -38,7 +38,7 @@ using framing::SequenceNumber; using framing::SequenceSet; /** A point in the session. Points to command id + offset */ -struct SessionPoint : boost::totally_ordered1 { +struct QPID_COMMON_CLASS_EXTERN SessionPoint : boost::totally_ordered1 { QPID_COMMON_EXTERN SessionPoint(SequenceNumber command = 0, uint64_t offset = 0); SequenceNumber command; @@ -59,7 +59,7 @@ QPID_COMMON_EXTERN std::ostream& operator<<(std::ostream&, const SessionPoint&); * * We only issue/use contiguous confirmations, out-of-order confirmation * is ignored. Out of order completion is fully supported. - * + * * Raises NotImplemented if the command point is set greater than the * max currently received command data, either explicitly via * session.command-point or implicitly via session.gap. @@ -71,21 +71,21 @@ QPID_COMMON_EXTERN std::ostream& operator<<(std::ostream&, const SessionPoint&); * could be extended to support partial replay without * source-incompatbile API changes. */ -class SessionState { +class QPID_COMMON_CLASS_EXTERN SessionState { typedef std::vector ReplayList; public: typedef boost::iterator_range ReplayRange; - struct Configuration { + struct QPID_COMMON_CLASS_EXTERN Configuration { QPID_COMMON_EXTERN Configuration(size_t flush=1024*1024, size_t hard=0); size_t replayFlushLimit; // Flush when the replay list >= N bytes. 0 disables. size_t replayHardLimit; // Kill session if replay list > N bytes. 0 disables. }; QPID_COMMON_EXTERN SessionState(const SessionId& =SessionId(), const Configuration& =Configuration()); - + QPID_COMMON_EXTERN virtual ~SessionState(); bool hasState() const; @@ -186,7 +186,7 @@ class SessionState { * So called 'push' bridges work by faking a subscribe request * (and the accompanying flows etc) to the local broker to initiate * the outflow of messages for the bridge. - * + * * As the peer doesn't send these it cannot include them in its * session state. To keep the session state on either side of the * bridge in sync, this hack allows the tracking of state for diff --git a/qpid/cpp/src/qpid/amqp_0_10/Connection.h b/qpid/cpp/src/qpid/amqp_0_10/Connection.h index 995d824796..cbf0eefba8 100644 --- a/qpid/cpp/src/qpid/amqp_0_10/Connection.h +++ b/qpid/cpp/src/qpid/amqp_0_10/Connection.h @@ -40,8 +40,8 @@ class ConnectionInputHandlerFactory; namespace amqp_0_10 { -class Connection : public sys::ConnectionCodec, - public sys::ConnectionOutputHandler +class QPID_BROKER_CLASS_EXTERN Connection : public sys::ConnectionCodec, + public sys::ConnectionOutputHandler { typedef std::deque FrameQueue; diff --git a/qpid/cpp/src/qpid/amqp_0_10/Exception.h b/qpid/cpp/src/qpid/amqp_0_10/Exception.h index 6d526c1706..c417262c45 100644 --- a/qpid/cpp/src/qpid/amqp_0_10/Exception.h +++ b/qpid/cpp/src/qpid/amqp_0_10/Exception.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -28,11 +28,11 @@ namespace qpid { namespace amqp_0_10 { -/** +/** * Raised when the connection is unexpectedly closed. Sessions with * non-0 timeout may be available for re-attachment on another connection. */ -struct ConnectionException : public qpid::Exception { +struct QPID_COMMON_CLASS_EXTERN ConnectionException : public qpid::Exception { // FIXME aconway 2008-04-04: Merge qpid::ConnectionException // into this when the old code is removed. typedef connection::CloseCode Code; @@ -45,21 +45,21 @@ struct ConnectionException : public qpid::Exception { * Raised when a session is unexpectedly detached for any reason, or * if an attempt is made to use a session that is not attached. */ -struct SessionException : public qpid::Exception { +struct QPID_COMMON_CLASS_EXTERN SessionException : public qpid::Exception { // FIXME aconway 2008-04-04: should not have a code at this level. // Leave in place till old preview code is gone. - SessionException(int /*code*/, const std::string& msg) : qpid::Exception(msg) {} + SessionException(int /*code*/, const std::string& msg) : qpid::Exception(msg) {} }; /** Raised when the state of a session has been destroyed */ -struct SessionDestroyedException : public SessionException { +struct QPID_COMMON_CLASS_EXTERN SessionDestroyedException : public SessionException { // FIXME aconway 2008-04-04: should not have a code at this level. // Leave in place till old preview code is gone. - SessionDestroyedException(int code, const std::string& msg) : SessionException(code, msg){} + SessionDestroyedException(int code, const std::string& msg) : SessionException(code, msg){} }; /** Raised when a session is destroyed due to an execution.exception */ -struct SessionAbortedException : public SessionDestroyedException { +struct QPID_COMMON_CLASS_EXTERN SessionAbortedException : public SessionDestroyedException { typedef execution::ErrorCode Code; SessionAbortedException(Code c, const std::string m) : SessionDestroyedException(c, m), code(c) {} @@ -70,7 +70,7 @@ struct SessionAbortedException : public SessionDestroyedException { * Raised when a session with 0 timeout is unexpectedly detached * and therefore expires and is destroyed. */ -struct SessionExpiredException : public SessionDestroyedException { +struct QPID_COMMON_CLASS_EXTERN SessionExpiredException : public SessionDestroyedException { typedef session::DetachCode Code; SessionExpiredException(Code c, const std::string m) : SessionDestroyedException(c, m), code(c) {} @@ -80,17 +80,17 @@ struct SessionExpiredException : public SessionDestroyedException { /** * Raised when a session with non-0 timeout is unexpectedly detached * or if an attempt is made to use a session that is not attached. - * + * * The session is not necessarily destroyed, it may be possible to * re-attach. */ -struct SessionDetachedException : public SessionException { +struct QPID_COMMON_CLASS_EXTERN SessionDetachedException : public SessionException { typedef session::DetachCode Code; SessionDetachedException(Code c, const std::string m) : SessionException(c, m), code(c) {} Code code; }; - + }} // namespace qpid::amqp_0_10 #endif /*!QPID_AMQP_0_10_EXCEPTION_H*/ diff --git a/qpid/cpp/src/qpid/amqp_0_10/Map.h b/qpid/cpp/src/qpid/amqp_0_10/Map.h index 4093b1a0aa..2980e58e26 100644 --- a/qpid/cpp/src/qpid/amqp_0_10/Map.h +++ b/qpid/cpp/src/qpid/amqp_0_10/Map.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on ang * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -38,9 +38,9 @@ namespace amqp_0_10 { class Map; -class MapValue { +class QPID_COMMON_CLASS_EXTERN MapValue { public: - struct BadTypeException : public Exception {}; + struct QPID_COMMON_CLASS_EXTERN BadTypeException : public Exception {}; template struct Visitor { typedef R result_type; }; @@ -56,7 +56,7 @@ class MapValue { template typename V::result_type apply_visitor(const V&); uint8_t getCode() const { return code; } - + bool operator==(const MapValue&) const; template void serialize(S& s) { s(code); s.split(*this); } @@ -67,7 +67,7 @@ class MapValue { DecodeVisitor dv(blob, s); qpid::amqp_0_10::apply_visitor(dv, code); } - + private: // TODO aconway 2008-04-15: Estimate required size, we will get a @@ -85,7 +85,7 @@ class MapValue { Blob blob; }; -class Map : public std::map { +class QPID_COMMON_CLASS_EXTERN Map : public std::map { public: template void serialize(S& s) { s.split(*this); } template void encode(S& s) const; @@ -93,7 +93,7 @@ class Map : public std::map { void encode(Codec::Size& s) const { s.raw(0, contentSize() + 4/*size*/); } template void decode(S& s); - + private: uint32_t contentSize() const; }; @@ -122,7 +122,7 @@ template struct MapValue::VisitVisitor { return visitor(*reinterpret_cast(blob.get())); } }; - + template typename V::result_type MapValue::apply_visitor(V& v) { VisitVisitor visitor(v, blob); return qpid::amqp_0_10::apply_visitor(visitor, code); @@ -137,13 +137,13 @@ template struct MapValue::GetVisitor { R* operator()(R& r) { return &r; } template R* operator()(T&) { return 0; } }; - + template struct MapValue::DecodeVisitor { typedef void result_type; MapValue::Blob& blob; D& decoder; DecodeVisitor(Blob& b, D& d) : blob(b), decoder(d) {} - + template void operator()(T*) { T t; decoder(t); diff --git a/qpid/cpp/src/qpid/assert.h b/qpid/cpp/src/qpid/assert.h index 49e7c5355d..b7bfea0995 100644 --- a/qpid/cpp/src/qpid/assert.h +++ b/qpid/cpp/src/qpid/assert.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -23,15 +23,15 @@ */ #include - +#include "qpid/CommonImportExport.h" /** - * Abort if !expr in debug mode, throw an exception if NDEBUG is set. + * Abort if !expr in debug mode, throw an exception if NDEBUG is set. */ #define QPID_ASSERT(expr) ((expr) ? static_cast(0) : ::qpid::assert_fail(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) namespace qpid { -void assert_fail(char const * expr, char const * function, char const * file, long line); +QPID_COMMON_EXTERN void assert_fail(char const * expr, char const * function, char const * file, long line); } // namespace qpid diff --git a/qpid/cpp/src/qpid/broker/Bridge.h b/qpid/cpp/src/qpid/broker/Bridge.h index a846254c57..ec9e534f5e 100644 --- a/qpid/cpp/src/qpid/broker/Bridge.h +++ b/qpid/cpp/src/qpid/broker/Bridge.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -31,6 +31,7 @@ #include "qpid/broker/Exchange.h" #include "qmf/org/apache/qpid/broker/ArgsLinkBridge.h" #include "qmf/org/apache/qpid/broker/Bridge.h" +#include "qpid/broker/BrokerImportExport.h" #include #include @@ -43,7 +44,9 @@ class ConnectionState; class Link; class LinkRegistry; -class Bridge : public PersistableConfig, public management::Manageable, public Exchange::DynamicBridge +class QPID_BROKER_CLASS_EXTERN Bridge : + public PersistableConfig, public management::Manageable, + public Exchange::DynamicBridge { public: typedef boost::shared_ptr shared_ptr; @@ -68,7 +71,7 @@ public: void setPersistenceId(uint64_t id) const; uint64_t getPersistenceId() const { return persistenceId; } uint32_t encodedSize() const; - void encode(framing::Buffer& buffer) const; + void encode(framing::Buffer& buffer) const; const std::string& getName() const; static Bridge::shared_ptr decode(LinkRegistry& links, framing::Buffer& buffer); diff --git a/qpid/cpp/src/qpid/broker/Broker.cpp b/qpid/cpp/src/qpid/broker/Broker.cpp index 240766c443..8bcfd45312 100644 --- a/qpid/cpp/src/qpid/broker/Broker.cpp +++ b/qpid/cpp/src/qpid/broker/Broker.cpp @@ -20,6 +20,7 @@ */ #include "qpid/broker/Broker.h" +#include "qpid/broker/BrokerImportExport.h" #include "qpid/broker/ConnectionState.h" #include "qpid/broker/DirectExchange.h" #include "qpid/broker/FanOutExchange.h" @@ -508,7 +509,7 @@ const std::string _TRUE("true"); const std::string _FALSE("false"); } -struct InvalidBindingIdentifier : public qpid::Exception +struct QPID_BROKER_CLASS_EXTERN InvalidBindingIdentifier : public qpid::Exception { InvalidBindingIdentifier(const std::string& name) : qpid::Exception(name) {} std::string getPrefix() const { return "invalid binding"; } @@ -543,13 +544,13 @@ struct BindingIdentifier } }; -struct ObjectAlreadyExists : public qpid::Exception +struct QPID_BROKER_CLASS_EXTERN ObjectAlreadyExists : public qpid::Exception { ObjectAlreadyExists(const std::string& name) : qpid::Exception(name) {} std::string getPrefix() const { return "object already exists"; } }; -struct UnknownObjectType : public qpid::Exception +struct QPID_BROKER_CLASS_EXTERN UnknownObjectType : public qpid::Exception { UnknownObjectType(const std::string& type) : qpid::Exception(type) {} std::string getPrefix() const { return "unknown object type"; } diff --git a/qpid/cpp/src/qpid/broker/Broker.h b/qpid/cpp/src/qpid/broker/Broker.h index 6d585bf614..eb83f9fa91 100644 --- a/qpid/cpp/src/qpid/broker/Broker.h +++ b/qpid/cpp/src/qpid/broker/Broker.h @@ -84,9 +84,10 @@ struct NoSuchTransportException : qpid::Exception /** * A broker instance. */ -class Broker : public sys::Runnable, public Plugin::Target, - public management::Manageable, - public RefCounted +class QPID_BROKER_CLASS_EXTERN Broker : + public sys::Runnable, public Plugin::Target, + public management::Manageable, + public RefCounted { public: diff --git a/qpid/cpp/src/qpid/broker/BrokerImportExport.h b/qpid/cpp/src/qpid/broker/BrokerImportExport.h index ee05788063..a767dadb87 100644 --- a/qpid/cpp/src/qpid/broker/BrokerImportExport.h +++ b/qpid/cpp/src/qpid/broker/BrokerImportExport.h @@ -20,23 +20,16 @@ * under the License. */ -#if defined(WIN32) && !defined(QPID_DECLARE_STATIC) -# if defined(BROKER_EXPORT) || defined (qpidbroker_EXPORTS) -# define QPID_BROKER_EXTERN __declspec(dllexport) -# else -# define QPID_BROKER_EXTERN __declspec(dllimport) -# endif -# ifdef _MSC_VER -# define QPID_BROKER_CLASS_EXTERN -# define QPID_BROKER_INLINE_EXTERN QPID_BROKER_EXTERN -# else -# define QPID_BROKER_CLASS_EXTERN QPID_BROKER_EXTERN -# define QPID_BROKER_INLINE_EXTERN -# endif +#include "qpid/ImportExport.h" + +#if defined(BROKER_EXPORT) || defined (qpidbroker_EXPORTS) +# define QPID_BROKER_EXTERN QPID_EXPORT +# define QPID_BROKER_CLASS_EXTERN QPID_CLASS_EXPORT +# define QPID_BROKER_INLINE_EXTERN QPID_INLINE_EXPORT #else -# define QPID_BROKER_EXTERN -# define QPID_BROKER_CLASS_EXTERN -# define QPID_BROKER_INLINE_EXTERN +# define QPID_BROKER_EXTERN QPID_IMPORT +# define QPID_BROKER_CLASS_EXTERN QPID_CLASS_IMPORT +# define QPID_BROKER_INLINE_EXTERN QPID_INLINE_IMPORT #endif #endif diff --git a/qpid/cpp/src/qpid/broker/Connection.cpp b/qpid/cpp/src/qpid/broker/Connection.cpp index c07e63e68c..33c8b9f33e 100644 --- a/qpid/cpp/src/qpid/broker/Connection.cpp +++ b/qpid/cpp/src/qpid/broker/Connection.cpp @@ -18,6 +18,7 @@ * under the License. * */ + #include "qpid/broker/Connection.h" #include "qpid/broker/SessionOutputException.h" #include "qpid/broker/SessionState.h" diff --git a/qpid/cpp/src/qpid/broker/Connection.h b/qpid/cpp/src/qpid/broker/Connection.h index 8f1aa701ef..814457420e 100644 --- a/qpid/cpp/src/qpid/broker/Connection.h +++ b/qpid/cpp/src/qpid/broker/Connection.h @@ -29,6 +29,7 @@ #include +#include "qpid/broker/BrokerImportExport.h" #include "qpid/broker/ConnectionHandler.h" #include "qpid/broker/ConnectionState.h" #include "qpid/broker/SessionHandler.h" @@ -63,7 +64,7 @@ class LinkRegistry; class SecureConnection; struct ConnectionTimeoutTask; -class Connection : public sys::ConnectionInputHandler, +class QPID_BROKER_CLASS_EXTERN Connection : public sys::ConnectionInputHandler, public ConnectionState, public RefCounted { diff --git a/qpid/cpp/src/qpid/broker/ConnectionFactory.h b/qpid/cpp/src/qpid/broker/ConnectionFactory.h index 7c1a9a08e1..2a18bb0041 100644 --- a/qpid/cpp/src/qpid/broker/ConnectionFactory.h +++ b/qpid/cpp/src/qpid/broker/ConnectionFactory.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -22,16 +22,17 @@ #define _ConnectionFactory_ #include "qpid/sys/ConnectionCodec.h" +#include "qpid/broker/BrokerImportExport.h" namespace qpid { namespace broker { class Broker; -class ConnectionFactory : public sys::ConnectionCodec::Factory +class QPID_BROKER_CLASS_EXTERN ConnectionFactory : public sys::ConnectionCodec::Factory { public: ConnectionFactory(Broker& b); - + virtual ~ConnectionFactory(); sys::ConnectionCodec* diff --git a/qpid/cpp/src/qpid/broker/Daemon.h b/qpid/cpp/src/qpid/broker/Daemon.h index a9cd98bce2..20ead1e979 100644 --- a/qpid/cpp/src/qpid/broker/Daemon.h +++ b/qpid/cpp/src/qpid/broker/Daemon.h @@ -19,6 +19,7 @@ * */ +#include "qpid/broker/BrokerImportExport.h" #include "qpid/sys/IntegerTypes.h" #include #include @@ -33,11 +34,11 @@ namespace broker { * Tools for forking and managing a daemon process. * NB: Only one Daemon instance is allowed in a process. */ -class Daemon : private boost::noncopyable +class QPID_BROKER_CLASS_EXTERN Daemon : private boost::noncopyable { public: /** Check daemon is running on port, throw exception if not */ - static pid_t getPid(std::string pidDir, uint16_t port); + QPID_BROKER_EXTERN static pid_t getPid(std::string pidDir, uint16_t port); Daemon(std::string pidDir); @@ -68,7 +69,7 @@ class Daemon : private boost::noncopyable *@param port returned by parent call to wait(). */ void ready(uint16_t port); - + private: static std::string pidFile(std::string pidDir, uint16_t port); diff --git a/qpid/cpp/src/qpid/broker/DeliveryRecord.h b/qpid/cpp/src/qpid/broker/DeliveryRecord.h index d388ba94be..cb986df92c 100644 --- a/qpid/cpp/src/qpid/broker/DeliveryRecord.h +++ b/qpid/cpp/src/qpid/broker/DeliveryRecord.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -42,7 +42,7 @@ struct AckRange; /** * Record of a delivery for which an ack is outstanding. */ -class DeliveryRecord +class QPID_BROKER_CLASS_EXTERN DeliveryRecord { QueuedMessage msg; mutable boost::shared_ptr queue; @@ -66,16 +66,16 @@ class DeliveryRecord public: QPID_BROKER_EXTERN DeliveryRecord(const QueuedMessage& msg, - const boost::shared_ptr& queue, + const boost::shared_ptr& queue, const std::string& tag, bool acquired, bool accepted, bool windowing, uint32_t credit=0 // Only used if msg is empty. ); - + bool coveredBy(const framing::SequenceSet* const range) const { return range->contains(id); } - + void dequeue(TransactionContext* ctxt = 0) const; void requeue() const; void release(bool setRedelivered); @@ -95,7 +95,7 @@ class DeliveryRecord bool isAccepted() const { return !acceptExpected; } bool isEnded() const { return ended; } bool isWindowing() const { return windowing; } - + uint32_t getCredit() const; const std::string& getTag() const { return tag; } @@ -132,7 +132,7 @@ typedef DeliveryRecord::DeliveryRecords DeliveryRecords; struct AckRange { DeliveryRecords::iterator start; - DeliveryRecords::iterator end; + DeliveryRecords::iterator end; AckRange(DeliveryRecords::iterator _start, DeliveryRecords::iterator _end) : start(_start), end(_end) {} }; diff --git a/qpid/cpp/src/qpid/broker/DirectExchange.h b/qpid/cpp/src/qpid/broker/DirectExchange.h index a6f9cf91af..bb85a85b7a 100644 --- a/qpid/cpp/src/qpid/broker/DirectExchange.h +++ b/qpid/cpp/src/qpid/broker/DirectExchange.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -31,7 +31,7 @@ namespace qpid { namespace broker { -class DirectExchange : public virtual Exchange { +class QPID_BROKER_CLASS_EXTERN DirectExchange : public virtual Exchange { typedef qpid::sys::CopyOnWriteArray Queues; struct BoundKey { Queues queues; @@ -43,16 +43,16 @@ class DirectExchange : public virtual Exchange { public: static const std::string typeName; - + QPID_BROKER_EXTERN DirectExchange(const std::string& name, management::Manageable* parent = 0, Broker* broker = 0); QPID_BROKER_EXTERN DirectExchange(const std::string& _name, - bool _durable, + bool _durable, const qpid::framing::FieldTable& _args, management::Manageable* parent = 0, Broker* broker = 0); - virtual std::string getType() const { return typeName; } - + virtual std::string getType() const { return typeName; } + QPID_BROKER_EXTERN virtual bool bind(boost::shared_ptr queue, const std::string& routingKey, const qpid::framing::FieldTable* args); diff --git a/qpid/cpp/src/qpid/broker/DtxBuffer.h b/qpid/cpp/src/qpid/broker/DtxBuffer.h index 1511cb032f..d31b36083a 100644 --- a/qpid/cpp/src/qpid/broker/DtxBuffer.h +++ b/qpid/cpp/src/qpid/broker/DtxBuffer.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -27,11 +27,11 @@ namespace qpid { namespace broker { - class DtxBuffer : public TxBuffer{ + class QPID_BROKER_CLASS_EXTERN DtxBuffer : public TxBuffer{ sys::Mutex lock; const std::string xid; bool ended; - bool suspended; + bool suspended; bool failed; bool expired; diff --git a/qpid/cpp/src/qpid/broker/DtxTimeout.h b/qpid/cpp/src/qpid/broker/DtxTimeout.h index 680a210e4f..48ac64a629 100644 --- a/qpid/cpp/src/qpid/broker/DtxTimeout.h +++ b/qpid/cpp/src/qpid/broker/DtxTimeout.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -23,13 +23,14 @@ #include "qpid/Exception.h" #include "qpid/sys/Timer.h" +#include "qpid/broker/BrokerImportExport.h" namespace qpid { namespace broker { class DtxManager; -struct DtxTimeoutException : public Exception {}; +struct QPID_BROKER_CLASS_EXTERN DtxTimeoutException : public Exception {}; struct DtxTimeout : public sys::TimerTask { @@ -37,7 +38,7 @@ struct DtxTimeout : public sys::TimerTask DtxManager& mgr; const std::string xid; - DtxTimeout(uint32_t timeout, DtxManager& mgr, const std::string& xid); + DtxTimeout(uint32_t timeout, DtxManager& mgr, const std::string& xid); void fire(); }; diff --git a/qpid/cpp/src/qpid/broker/DtxWorkRecord.h b/qpid/cpp/src/qpid/broker/DtxWorkRecord.h index aec2d2aed4..6db14be449 100644 --- a/qpid/cpp/src/qpid/broker/DtxWorkRecord.h +++ b/qpid/cpp/src/qpid/broker/DtxWorkRecord.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -43,7 +43,7 @@ namespace broker { * across potentially multiple channels. Identified by a xid. Allows * that work to be prepared, committed and rolled-back. */ -class DtxWorkRecord +class QPID_BROKER_CLASS_EXTERN DtxWorkRecord { typedef std::vector Work; diff --git a/qpid/cpp/src/qpid/broker/ExchangeRegistry.h b/qpid/cpp/src/qpid/broker/ExchangeRegistry.h index 2b75a8f3cf..3b8cb2d7e9 100644 --- a/qpid/cpp/src/qpid/broker/ExchangeRegistry.h +++ b/qpid/cpp/src/qpid/broker/ExchangeRegistry.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -40,9 +40,9 @@ namespace broker { struct UnknownExchangeTypeException{}; -class ExchangeRegistry{ +class QPID_BROKER_CLASS_EXTERN ExchangeRegistry{ public: - typedef boost::function5 FactoryFunction; ExchangeRegistry (Broker* b = 0) : parent(0), broker(b) {} @@ -50,7 +50,7 @@ class ExchangeRegistry{ (const std::string& name, const std::string& type); QPID_BROKER_EXTERN std::pair declare (const std::string& name, - const std::string& type, + const std::string& type, bool durable, const qpid::framing::FieldTable& args = framing::FieldTable()); QPID_BROKER_EXTERN void destroy(const std::string& name); @@ -75,7 +75,7 @@ class ExchangeRegistry{ for (ExchangeMap::const_iterator i = exchanges.begin(); i != exchanges.end(); ++i) f(i->second); } - + private: typedef std::map ExchangeMap; typedef std::map FunctionMap; diff --git a/qpid/cpp/src/qpid/broker/Fairshare.h b/qpid/cpp/src/qpid/broker/Fairshare.h index 1b25721e0c..31a9353357 100644 --- a/qpid/cpp/src/qpid/broker/Fairshare.h +++ b/qpid/cpp/src/qpid/broker/Fairshare.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -22,6 +22,7 @@ * */ #include "qpid/broker/PriorityQueue.h" +#include "qpid/broker/BrokerImportExport.h" namespace qpid { namespace framing { @@ -34,7 +35,7 @@ namespace broker { * from each priority level that are dispatched before allowing * dispatch from the next level. */ -class Fairshare : public PriorityQueue +class QPID_BROKER_CLASS_EXTERN Fairshare : public PriorityQueue { public: Fairshare(size_t levels, uint limit); diff --git a/qpid/cpp/src/qpid/broker/FanOutExchange.h b/qpid/cpp/src/qpid/broker/FanOutExchange.h index 1a7d486796..4d96e789d9 100644 --- a/qpid/cpp/src/qpid/broker/FanOutExchange.h +++ b/qpid/cpp/src/qpid/broker/FanOutExchange.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -32,22 +32,22 @@ namespace qpid { namespace broker { -class FanOutExchange : public virtual Exchange { +class QPID_BROKER_CLASS_EXTERN FanOutExchange : public virtual Exchange { typedef qpid::sys::CopyOnWriteArray BindingsArray; BindingsArray bindings; FedBinding fedBinding; public: static const std::string typeName; - + QPID_BROKER_EXTERN FanOutExchange(const std::string& name, management::Manageable* parent = 0, Broker* broker = 0); QPID_BROKER_EXTERN FanOutExchange(const std::string& _name, - bool _durable, + bool _durable, const qpid::framing::FieldTable& _args, management::Manageable* parent = 0, Broker* broker = 0); - virtual std::string getType() const { return typeName; } - + virtual std::string getType() const { return typeName; } + QPID_BROKER_EXTERN virtual bool bind(Queue::shared_ptr queue, const std::string& routingKey, const qpid::framing::FieldTable* args); diff --git a/qpid/cpp/src/qpid/broker/HeadersExchange.h b/qpid/cpp/src/qpid/broker/HeadersExchange.h index 3b939d6851..08ac549395 100644 --- a/qpid/cpp/src/qpid/broker/HeadersExchange.h +++ b/qpid/cpp/src/qpid/broker/HeadersExchange.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -33,7 +33,7 @@ namespace qpid { namespace broker { -class HeadersExchange : public virtual Exchange { +class QPID_BROKER_CLASS_EXTERN HeadersExchange : public virtual Exchange { struct BoundKey { @@ -44,12 +44,12 @@ class HeadersExchange : public virtual Exchange { struct MatchArgs { - const Queue::shared_ptr queue; + const Queue::shared_ptr queue; const qpid::framing::FieldTable* args; MatchArgs(Queue::shared_ptr q, const qpid::framing::FieldTable* a); bool operator()(BoundKey & bk); }; - + struct MatchKey { const Queue::shared_ptr queue; @@ -86,12 +86,12 @@ class HeadersExchange : public virtual Exchange { QPID_BROKER_EXTERN HeadersExchange(const std::string& name, management::Manageable* parent = 0, Broker* broker = 0); QPID_BROKER_EXTERN HeadersExchange(const std::string& _name, - bool _durable, + bool _durable, const qpid::framing::FieldTable& _args, management::Manageable* parent = 0, Broker* broker = 0); - - virtual std::string getType() const { return typeName; } - + + virtual std::string getType() const { return typeName; } + QPID_BROKER_EXTERN virtual bool bind(Queue::shared_ptr queue, const std::string& routingKey, const qpid::framing::FieldTable* args); diff --git a/qpid/cpp/src/qpid/broker/Link.h b/qpid/cpp/src/qpid/broker/Link.h index 4badd8b3a1..2827d6b719 100644 --- a/qpid/cpp/src/qpid/broker/Link.h +++ b/qpid/cpp/src/qpid/broker/Link.h @@ -32,6 +32,7 @@ #include "qpid/management/Manageable.h" #include "qpid/management/ManagementAgent.h" #include "qmf/org/apache/qpid/broker/Link.h" +#include "qpid/broker/BrokerImportExport.h" #include namespace qpid { @@ -41,7 +42,8 @@ namespace qpid { class Broker; class Connection; - class Link : public PersistableConfig, public management::Manageable { + class QPID_BROKER_CLASS_EXTERN Link : + public PersistableConfig, public management::Manageable { private: sys::Mutex lock; LinkRegistry* links; diff --git a/qpid/cpp/src/qpid/broker/LinkRegistry.h b/qpid/cpp/src/qpid/broker/LinkRegistry.h index 4c97e4f9d8..55cc6915bb 100644 --- a/qpid/cpp/src/qpid/broker/LinkRegistry.h +++ b/qpid/cpp/src/qpid/broker/LinkRegistry.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -29,6 +29,7 @@ #include "qpid/sys/Mutex.h" #include "qpid/sys/Timer.h" #include "qpid/management/Manageable.h" +#include "qpid/broker/BrokerImportExport.h" #include #include #include @@ -39,7 +40,7 @@ namespace broker { class Link; class Broker; class Connection; - class LinkRegistry { + class QPID_BROKER_CLASS_EXTERN LinkRegistry { // Declare a timer task to manage the establishment of link connections and the // re-establishment of lost link connections. @@ -150,7 +151,7 @@ namespace broker { */ void setPassive(bool); - + /** Iterate over each link in the registry. Used for cluster updates. */ void eachLink(boost::function)> f); /** Iterate over each bridge in the registry. Used for cluster updates. */ diff --git a/qpid/cpp/src/qpid/broker/Message.h b/qpid/cpp/src/qpid/broker/Message.h index d85ee434db..e8f1aa9497 100644 --- a/qpid/cpp/src/qpid/broker/Message.h +++ b/qpid/cpp/src/qpid/broker/Message.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -34,12 +34,12 @@ #include namespace qpid { - + namespace framing { class FieldTable; class SequenceNumber; } - + namespace broker { class ConnectionToken; class Exchange; @@ -48,14 +48,14 @@ class MessageStore; class Queue; class ExpiryPolicy; -class Message : public PersistableMessage { +class QPID_BROKER_CLASS_EXTERN Message : public PersistableMessage { public: typedef boost::function&)> MessageCallback; - + QPID_BROKER_EXTERN Message(const framing::SequenceNumber& id = framing::SequenceNumber()); QPID_BROKER_EXTERN Message(const Message&); QPID_BROKER_EXTERN ~Message(); - + uint64_t getPersistenceId() const { return persistenceId; } void setPersistenceId(uint64_t _persistenceId) const { persistenceId = _persistenceId; } @@ -85,8 +85,8 @@ public: sys::AbsTime getExpiration() const { return expiration; } void adjustTtl(); - framing::FrameSet& getFrames() { return frames; } - const framing::FrameSet& getFrames() const { return frames; } + framing::FrameSet& getFrames() { return frames; } + const framing::FrameSet& getFrames() const { return frames; } template T* getProperties() { qpid::framing::AMQHeaderBody* p = frames.getHeaders(); @@ -135,7 +135,7 @@ public: QPID_BROKER_EXTERN void decodeHeader(framing::Buffer& buffer); QPID_BROKER_EXTERN void decodeContent(framing::Buffer& buffer); - + void QPID_BROKER_EXTERN tryReleaseContent(); void releaseContent(); void releaseContent(MessageStore* s);//deprecated, use 'setStore(store); releaseContent();' instead @@ -149,10 +149,10 @@ public: bool isExcluded(const std::vector& excludes) const; void addTraceId(const std::string& id); - + void forcePersistent(); bool isForcedPersistent(); - + /** Call cb when dequeue is complete, may call immediately. Holds cb by reference. */ void setDequeueCompleteCallback(MessageCallback& cb); diff --git a/qpid/cpp/src/qpid/broker/PersistableMessage.h b/qpid/cpp/src/qpid/broker/PersistableMessage.h index d29c2c45b4..8abeb5c546 100644 --- a/qpid/cpp/src/qpid/broker/PersistableMessage.h +++ b/qpid/cpp/src/qpid/broker/PersistableMessage.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -41,7 +41,7 @@ class MessageStore; /** * Base class for persistable messages. */ -class PersistableMessage : public Persistable +class QPID_BROKER_CLASS_EXTERN PersistableMessage : public Persistable { typedef std::list< boost::weak_ptr > syncList; sys::Mutex asyncDequeueLock; @@ -75,7 +75,7 @@ class PersistableMessage : public Persistable bool blocked; bool requested; bool released; - + ContentReleaseState(); }; ContentReleaseState contentReleaseState; @@ -102,7 +102,7 @@ class PersistableMessage : public Persistable PersistableMessage(); void flush(); - + QPID_BROKER_EXTERN bool isContentReleased() const; QPID_BROKER_EXTERN void setStore(MessageStore*); @@ -126,14 +126,14 @@ class PersistableMessage : public Persistable QPID_BROKER_EXTERN bool isDequeueComplete(); - + QPID_BROKER_EXTERN void dequeueComplete(); QPID_BROKER_EXTERN void dequeueAsync(PersistableQueue::shared_ptr queue, MessageStore* _store); bool isStoredOnQueue(PersistableQueue::shared_ptr queue); - + void addToSyncList(PersistableQueue::shared_ptr queue, MessageStore* _store); }; diff --git a/qpid/cpp/src/qpid/broker/Queue.h b/qpid/cpp/src/qpid/broker/Queue.h index c4f1bcc07e..8456061b6f 100644 --- a/qpid/cpp/src/qpid/broker/Queue.h +++ b/qpid/cpp/src/qpid/broker/Queue.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -67,20 +67,21 @@ class Exchange; * registered consumers or be stored until dequeued or until one * or more consumers registers. */ -class Queue : public boost::enable_shared_from_this, - public PersistableQueue, public management::Manageable { - +class QPID_BROKER_CLASS_EXTERN Queue : + public boost::enable_shared_from_this, + public PersistableQueue, public management::Manageable +{ struct UsageBarrier { Queue& parent; uint count; - + UsageBarrier(Queue&); bool acquire(); void release(); void destroy(); }; - + struct ScopedUse { UsageBarrier& barrier; @@ -88,7 +89,7 @@ class Queue : public boost::enable_shared_from_this, ScopedUse(UsageBarrier& b) : barrier(b), acquired(barrier.acquire()) {} ~ScopedUse() { if (acquired) barrier.release(); } }; - + typedef std::set< boost::shared_ptr > Observers; enum ConsumeCode {NO_MESSAGES=0, CANT_CONSUME=1, CONSUMED=2}; @@ -184,8 +185,8 @@ class Queue : public boost::enable_shared_from_this, typedef std::vector vector; QPID_BROKER_EXTERN Queue(const std::string& name, - bool autodelete = false, - MessageStore* const store = 0, + bool autodelete = false, + MessageStore* const store = 0, const OwnershipToken* const owner = 0, management::Manageable* parent = 0, Broker* broker = 0); @@ -245,11 +246,11 @@ class Queue : public boost::enable_shared_from_this, bool exclusive = false); QPID_BROKER_EXTERN void cancel(Consumer::shared_ptr c); - uint32_t purge(const uint32_t purge_request=0, boost::shared_ptr dest=boost::shared_ptr()); //defaults to all messages + uint32_t purge(const uint32_t purge_request=0, boost::shared_ptr dest=boost::shared_ptr()); //defaults to all messages QPID_BROKER_EXTERN void purgeExpired(); //move qty # of messages to destination Queue destq - uint32_t move(const Queue::shared_ptr destq, uint32_t qty); + uint32_t move(const Queue::shared_ptr destq, uint32_t qty); QPID_BROKER_EXTERN uint32_t getMessageCount() const; QPID_BROKER_EXTERN uint32_t getEnqueueCompleteMessageCount() const; @@ -288,8 +289,8 @@ class Queue : public boost::enable_shared_from_this, * Inform queue of messages that were enqueued, have since * been acquired but not yet accepted or released (and * thus are still logically on the queue) - used in - * clustered broker. - */ + * clustered broker. + */ void updateEnqueued(const QueuedMessage& msg); /** @@ -300,20 +301,20 @@ class Queue : public boost::enable_shared_from_this, * accepted it). */ bool isEnqueued(const QueuedMessage& msg); - + /** - * Gets the next available message + * Gets the next available message */ QPID_BROKER_EXTERN QueuedMessage get(); /** Get the message at position pos */ QPID_BROKER_EXTERN QueuedMessage find(framing::SequenceNumber pos) const; - const QueuePolicy* getPolicy(); + QPID_BROKER_EXTERN const QueuePolicy* getPolicy(); - void setAlternateExchange(boost::shared_ptr exchange); - boost::shared_ptr getAlternateExchange(); - bool isLocal(boost::intrusive_ptr& msg); + QPID_BROKER_EXTERN void setAlternateExchange(boost::shared_ptr exchange); + QPID_BROKER_EXTERN boost::shared_ptr getAlternateExchange(); + QPID_BROKER_EXTERN bool isLocal(boost::intrusive_ptr& msg); //PersistableQueue support: uint64_t getPersistenceId() const; @@ -361,7 +362,7 @@ class Queue : public boost::enable_shared_from_this, /** return current position sequence number for the next message on the queue. */ QPID_BROKER_EXTERN framing::SequenceNumber getPosition(); - void addObserver(boost::shared_ptr); + QPID_BROKER_EXTERN void addObserver(boost::shared_ptr); QPID_BROKER_EXTERN void insertSequenceNumbers(const std::string& key); /** * Notify queue that recovery has completed. @@ -369,9 +370,9 @@ class Queue : public boost::enable_shared_from_this, void recoveryComplete(ExchangeRegistry& exchanges); // For cluster update - QueueListeners& getListeners(); - Messages& getMessages(); - const Messages& getMessages() const; + QPID_BROKER_EXTERN QueueListeners& getListeners(); + QPID_BROKER_EXTERN Messages& getMessages(); + QPID_BROKER_EXTERN const Messages& getMessages() const; /** * Reserve space in policy for an enqueued message that diff --git a/qpid/cpp/src/qpid/broker/QueueCleaner.h b/qpid/cpp/src/qpid/broker/QueueCleaner.h index 11c2d180ac..577463c49b 100644 --- a/qpid/cpp/src/qpid/broker/QueueCleaner.h +++ b/qpid/cpp/src/qpid/broker/QueueCleaner.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -32,7 +32,7 @@ class QueueRegistry; /** * TimerTask to purge expired messages from queues */ -class QueueCleaner +class QPID_BROKER_CLASS_EXTERN QueueCleaner { public: QPID_BROKER_EXTERN QueueCleaner(QueueRegistry& queues, sys::Timer& timer); diff --git a/qpid/cpp/src/qpid/broker/QueueEvents.h b/qpid/cpp/src/qpid/broker/QueueEvents.h index fcddfe9092..b88d898763 100644 --- a/qpid/cpp/src/qpid/broker/QueueEvents.h +++ b/qpid/cpp/src/qpid/broker/QueueEvents.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -39,7 +39,7 @@ namespace broker { * of this. The notification happens asynchronously, in a separate * thread. */ -class QueueEvents +class QPID_BROKER_CLASS_EXTERN QueueEvents { public: enum EventType {ENQUEUE, DEQUEUE}; @@ -76,7 +76,7 @@ class QueueEvents volatile bool enabled; qpid::sys::Mutex lock;//protect listeners from concurrent access bool sync; - + EventQueue::Batch::const_iterator handle(const EventQueue::Batch& e); }; diff --git a/qpid/cpp/src/qpid/broker/QueueFlowLimit.h b/qpid/cpp/src/qpid/broker/QueueFlowLimit.h index c02e479976..bf528817c2 100644 --- a/qpid/cpp/src/qpid/broker/QueueFlowLimit.h +++ b/qpid/cpp/src/qpid/broker/QueueFlowLimit.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -53,7 +53,8 @@ class Broker; * passing _either_ level may turn flow control ON, but _both_ must be * below level before flow control will be turned OFF. */ - class QueueFlowLimit : public StatefulQueueObserver +// Note must be EXTERN because it is used by tests. + class QPID_BROKER_CLASS_EXTERN QueueFlowLimit : public StatefulQueueObserver { static uint64_t defaultMaxSize; static uint defaultFlowStopRatio; diff --git a/qpid/cpp/src/qpid/broker/QueueListeners.h b/qpid/cpp/src/qpid/broker/QueueListeners.h index 0659499253..604d410f06 100644 --- a/qpid/cpp/src/qpid/broker/QueueListeners.h +++ b/qpid/cpp/src/qpid/broker/QueueListeners.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -22,6 +22,7 @@ * */ #include "qpid/broker/Consumer.h" +#include "qpid/broker/BrokerImportExport.h" #include namespace qpid { @@ -30,14 +31,14 @@ namespace broker { /** * Track and notify components that wish to be notified of messages * that become available on a queue. - * + * * None of the methods defined here are protected by locking. However * the populate method allows a 'snapshot' to be taken of the * listeners to be notified. NotificationSet::notify() may then be * called outside of any lock that protects the QueueListeners * instance from concurrent access. */ -class QueueListeners +class QPID_BROKER_CLASS_EXTERN QueueListeners { public: typedef std::deque Listeners; @@ -61,8 +62,8 @@ class QueueListeners friend class QueueListeners; }; - void addListener(Consumer::shared_ptr); - void removeListener(Consumer::shared_ptr); + void addListener(Consumer::shared_ptr); + void removeListener(Consumer::shared_ptr); void populate(NotificationSet&); void snapshot(ListenerSet&); bool contains(Consumer::shared_ptr c) const; diff --git a/qpid/cpp/src/qpid/broker/QueuePolicy.h b/qpid/cpp/src/qpid/broker/QueuePolicy.h index 3cdd63784d..22b3725d3c 100644 --- a/qpid/cpp/src/qpid/broker/QueuePolicy.h +++ b/qpid/cpp/src/qpid/broker/QueuePolicy.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -33,7 +33,7 @@ namespace qpid { namespace broker { -class QueuePolicy +class QPID_BROKER_CLASS_EXTERN QueuePolicy { static uint64_t defaultMaxSize; @@ -43,11 +43,11 @@ class QueuePolicy uint32_t count; uint64_t size; bool policyExceeded; - + static uint32_t getCapacity(const qpid::framing::FieldTable& settings, const std::string& key, uint32_t defaultValue); protected: - uint64_t getCurrentQueueSize() const { return size; } + uint64_t getCurrentQueueSize() const { return size; } public: typedef std::deque Messages; @@ -57,7 +57,7 @@ class QueuePolicy static QPID_BROKER_EXTERN const std::string REJECT; static QPID_BROKER_EXTERN const std::string FLOW_TO_DISK; static QPID_BROKER_EXTERN const std::string RING; - static QPID_BROKER_EXTERN const std::string RING_STRICT; + static QPID_BROKER_EXTERN const std::string RING_STRICT; virtual ~QueuePolicy() {} QPID_BROKER_EXTERN void tryEnqueue(boost::intrusive_ptr msg); @@ -68,7 +68,7 @@ class QueuePolicy virtual bool isEnqueued(const QueuedMessage&); QPID_BROKER_EXTERN void update(qpid::framing::FieldTable& settings); uint32_t getMaxCount() const { return maxCount; } - uint64_t getMaxSize() const { return maxSize; } + uint64_t getMaxSize() const { return maxSize; } void encode(framing::Buffer& buffer) const; void decode ( framing::Buffer& buffer ); uint32_t encodedSize() const; diff --git a/qpid/cpp/src/qpid/broker/QueueRegistry.h b/qpid/cpp/src/qpid/broker/QueueRegistry.h index 8a32a64f05..d0ca7ba2ab 100644 --- a/qpid/cpp/src/qpid/broker/QueueRegistry.h +++ b/qpid/cpp/src/qpid/broker/QueueRegistry.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -47,7 +47,7 @@ class MessageStore; * are deleted when and only when they are no longer in use. * */ -class QueueRegistry { +class QPID_BROKER_CLASS_EXTERN QueueRegistry { public: QPID_BROKER_EXTERN QueueRegistry(Broker* b = 0); QPID_BROKER_EXTERN ~QueueRegistry(); @@ -61,7 +61,7 @@ class QueueRegistry { QPID_BROKER_EXTERN std::pair, bool> declare( const std::string& name, bool durable = false, - bool autodelete = false, + bool autodelete = false, const OwnershipToken* owner = 0, boost::shared_ptr alternateExchange = boost::shared_ptr(), const qpid::framing::FieldTable& args = framing::FieldTable(), @@ -122,13 +122,13 @@ class QueueRegistry { for (QueueMap::const_iterator i = queues.begin(); i != queues.end(); ++i) f(i->second); } - + /** * Change queue mode when cluster size drops to 1 node, expands again * in practice allows flow queue to disk when last name to be exectuted */ void updateQueueClusterState(bool lastNode); - + private: typedef std::map > QueueMap; QueueMap queues; @@ -144,7 +144,7 @@ private: void destroyLH (const std::string& name); }; - + }} // namespace qpid::broker diff --git a/qpid/cpp/src/qpid/broker/RecoveredDequeue.h b/qpid/cpp/src/qpid/broker/RecoveredDequeue.h index 66e66f1d5f..52e888d1f7 100644 --- a/qpid/cpp/src/qpid/broker/RecoveredDequeue.h +++ b/qpid/cpp/src/qpid/broker/RecoveredDequeue.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -25,6 +25,7 @@ #include "qpid/broker/Message.h" #include "qpid/broker/MessageStore.h" #include "qpid/broker/TxOp.h" +#include "qpid/broker/BrokerImportExport.h" #include @@ -34,7 +35,7 @@ namespace qpid { namespace broker { - class RecoveredDequeue : public TxOp{ + class QPID_BROKER_CLASS_EXTERN RecoveredDequeue : public TxOp{ boost::shared_ptr queue; boost::intrusive_ptr msg; diff --git a/qpid/cpp/src/qpid/broker/RecoveredEnqueue.h b/qpid/cpp/src/qpid/broker/RecoveredEnqueue.h index 5f718001d5..99e777fd49 100644 --- a/qpid/cpp/src/qpid/broker/RecoveredEnqueue.h +++ b/qpid/cpp/src/qpid/broker/RecoveredEnqueue.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -25,6 +25,7 @@ #include "qpid/broker/Message.h" #include "qpid/broker/MessageStore.h" #include "qpid/broker/TxOp.h" +#include "qpid/broker/BrokerImportExport.h" #include @@ -34,7 +35,7 @@ namespace qpid { namespace broker { -class RecoveredEnqueue : public TxOp{ +class QPID_BROKER_CLASS_EXTERN RecoveredEnqueue : public TxOp{ boost::shared_ptr queue; boost::intrusive_ptr msg; @@ -48,7 +49,7 @@ class RecoveredEnqueue : public TxOp{ boost::shared_ptr getQueue() const { return queue; } boost::intrusive_ptr getMessage() const { return msg; } - + }; } } diff --git a/qpid/cpp/src/qpid/broker/RetryList.h b/qpid/cpp/src/qpid/broker/RetryList.h index 242a7d2122..6cf6ee2d66 100644 --- a/qpid/cpp/src/qpid/broker/RetryList.h +++ b/qpid/cpp/src/qpid/broker/RetryList.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -33,10 +33,10 @@ namespace broker { * Simple utility for managing a list of urls to try on reconnecting a * link. Currently only supports TCP urls. */ -class RetryList +class QPID_BROKER_CLASS_EXTERN RetryList { public: - QPID_BROKER_EXTERN RetryList(); + QPID_BROKER_EXTERN RetryList(); QPID_BROKER_EXTERN void reset(const std::vector& urls); QPID_BROKER_EXTERN bool next(Address& address); private: diff --git a/qpid/cpp/src/qpid/broker/SecureConnection.h b/qpid/cpp/src/qpid/broker/SecureConnection.h index 1547faae1e..455b70b576 100644 --- a/qpid/cpp/src/qpid/broker/SecureConnection.h +++ b/qpid/cpp/src/qpid/broker/SecureConnection.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -22,6 +22,7 @@ * */ +#include "qpid/broker/BrokerImportExport.h" #include "qpid/sys/ConnectionCodec.h" #include @@ -38,7 +39,7 @@ namespace broker { * 'secured' e.g. encrypted based on settings negotiatiated at the * time of establishment. */ -class SecureConnection : public qpid::sys::ConnectionCodec +class QPID_BROKER_CLASS_EXTERN SecureConnection : public qpid::sys::ConnectionCodec { public: SecureConnection(); diff --git a/qpid/cpp/src/qpid/broker/SemanticState.h b/qpid/cpp/src/qpid/broker/SemanticState.h index 8c69d6b89b..0c7c8901ff 100644 --- a/qpid/cpp/src/qpid/broker/SemanticState.h +++ b/qpid/cpp/src/qpid/broker/SemanticState.h @@ -22,6 +22,7 @@ * */ +#include "qpid/broker/BrokerImportExport.h" #include "qpid/broker/Consumer.h" #include "qpid/broker/Deliverable.h" #include "qpid/broker/DeliveryAdapter.h" @@ -65,9 +66,9 @@ class SessionContext; * * Message delivery is driven by ConsumerImpl::doOutput(), which is * called when a client's socket is ready to write data. - * + * */ -class SemanticState : private boost::noncopyable { +class QPID_BROKER_CLASS_EXTERN SemanticState : private boost::noncopyable { public: class ConsumerImpl : public Consumer, public sys::OutputTask, public boost::enable_shared_from_this, @@ -99,15 +100,15 @@ class SemanticState : private boost::noncopyable { public: typedef boost::shared_ptr shared_ptr; - ConsumerImpl(SemanticState* parent, + ConsumerImpl(SemanticState* parent, const std::string& name, boost::shared_ptr queue, bool ack, bool acquire, bool exclusive, const std::string& resumeId, uint64_t resumeTtl, const framing::FieldTable& arguments); ~ConsumerImpl(); OwnershipToken* getSession(); - bool deliver(QueuedMessage& msg); - bool filter(boost::intrusive_ptr msg); - bool accept(boost::intrusive_ptr msg); + bool deliver(QueuedMessage& msg); + bool filter(boost::intrusive_ptr msg); + bool accept(boost::intrusive_ptr msg); void disableNotify(); void enableNotify(); @@ -122,7 +123,7 @@ class SemanticState : private boost::noncopyable { void addMessageCredit(uint32_t value); void flush(); void stop(); - void complete(DeliveryRecord&); + void complete(DeliveryRecord&); boost::shared_ptr getQueue() const { return queue; } bool isBlocked() const { return blocked; } bool setBlocked(bool set) { std::swap(set, blocked); return set; } @@ -188,7 +189,7 @@ class SemanticState : private boost::noncopyable { const SessionContext& getSession() const { return session; } ConsumerImpl& find(const std::string& destination); - + /** * Get named queue, never returns 0. * @return: named queue @@ -196,11 +197,11 @@ class SemanticState : private boost::noncopyable { * @exception: ConnectionException if name="" and session has no default. */ boost::shared_ptr getQueue(const std::string& name) const; - + bool exists(const std::string& consumerTag); - void consume(const std::string& destination, - boost::shared_ptr queue, + void consume(const std::string& destination, + boost::shared_ptr queue, bool ackRequired, bool acquire, bool exclusive, const std::string& resumeId=std::string(), uint64_t resumeTtl=0, const framing::FieldTable& = framing::FieldTable()); @@ -223,7 +224,7 @@ class SemanticState : private boost::noncopyable { void suspendDtx(const std::string& xid); void resumeDtx(const std::string& xid); void recover(bool requeue); - void deliver(DeliveryRecord& message, bool sync); + void deliver(DeliveryRecord& message, bool sync); void acquire(DeliveryId first, DeliveryId last, DeliveryIds& acquired); void release(DeliveryId first, DeliveryId last, bool setRedelivered); void reject(DeliveryId first, DeliveryId last); diff --git a/qpid/cpp/src/qpid/broker/SignalHandler.h b/qpid/cpp/src/qpid/broker/SignalHandler.h index 7bfa9ea630..fe068ab989 100644 --- a/qpid/cpp/src/qpid/broker/SignalHandler.h +++ b/qpid/cpp/src/qpid/broker/SignalHandler.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -22,6 +22,8 @@ * */ +#include "qpid/broker/BrokerImportExport.h" + namespace qpid { namespace broker { @@ -30,7 +32,7 @@ class Broker; /** * Handle signals e.g. to shut-down a broker. */ -class SignalHandler +class QPID_BROKER_CLASS_EXTERN SignalHandler { public: /** Set the broker to be shutdown on signals. diff --git a/qpid/cpp/src/qpid/broker/TopicExchange.h b/qpid/cpp/src/qpid/broker/TopicExchange.h index 636918f8a1..96c75de69d 100644 --- a/qpid/cpp/src/qpid/broker/TopicExchange.h +++ b/qpid/cpp/src/qpid/broker/TopicExchange.h @@ -33,7 +33,7 @@ namespace qpid { namespace broker { -class TopicExchange : public virtual Exchange { +class QPID_BROKER_CLASS_EXTERN TopicExchange : public virtual Exchange { struct TokenIterator; class Normalizer; @@ -141,7 +141,7 @@ class TopicExchange : public virtual Exchange { private: qpid::sys::RWlock* cacheLock; std::map* bindingCache; - bool cleared; + bool cleared; public: ClearCache(qpid::sys::RWlock* l, std::map* bc): cacheLock(l), bindingCache(bc),cleared(false) {}; @@ -152,7 +152,7 @@ class TopicExchange : public virtual Exchange { cleared =true; } }; - ~ClearCache(){ + ~ClearCache(){ clearCache(); }; }; diff --git a/qpid/cpp/src/qpid/broker/TxAccept.h b/qpid/cpp/src/qpid/broker/TxAccept.h index 314a150176..b6df936be4 100644 --- a/qpid/cpp/src/qpid/broker/TxAccept.h +++ b/qpid/cpp/src/qpid/broker/TxAccept.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -27,6 +27,7 @@ #include "qpid/framing/SequenceSet.h" #include "qpid/broker/DeliveryRecord.h" #include "qpid/broker/TxOp.h" +#include "qpid/broker/BrokerImportExport.h" namespace qpid { namespace broker { @@ -34,11 +35,11 @@ namespace qpid { * Defines the transactional behaviour for accepts received by * a transactional channel. */ - class TxAccept : public TxOp { + class QPID_BROKER_CLASS_EXTERN TxAccept : public TxOp { struct RangeOp { AckRange range; - + RangeOp(const AckRange& r); void prepare(TransactionContext* ctxt); void commit(); @@ -48,12 +49,12 @@ namespace qpid { { std::vector ranges; DeliveryRecords& unacked; - + RangeOps(DeliveryRecords& u); void operator()(framing::SequenceNumber start, framing::SequenceNumber end); void prepare(TransactionContext* ctxt); - void commit(); + void commit(); }; framing::SequenceSet acked; diff --git a/qpid/cpp/src/qpid/broker/TxBuffer.h b/qpid/cpp/src/qpid/broker/TxBuffer.h index d49c8ba16a..425f6acb9b 100644 --- a/qpid/cpp/src/qpid/broker/TxBuffer.h +++ b/qpid/cpp/src/qpid/broker/TxBuffer.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -34,21 +34,21 @@ * transaction. This work can be committed or rolled back. Committing * is a two-stage process: first all the operations should be * prepared, then if that succeeds they can be committed. - * + * * In the 2pc case, a successful prepare may be followed by either a * commit or a rollback. - * + * * Atomicity of prepare is ensured by using a lower level * transactional facility. This saves explicitly rolling back all the * successfully prepared ops when one of them fails. i.e. we do not * use 2pc internally, we instead ensure that prepare is atomic at a * lower level. This makes individual prepare operations easier to * code. - * + * * Transactions on a messaging broker effect three types of 'action': * (1) updates to persistent storage (2) updates to transient storage * or cached data (3) network writes. - * + * * Of these, (1) should always occur atomically during prepare to * ensure that if the broker crashes while a transaction is being * completed the persistent state (which is all that then remains) is @@ -59,7 +59,7 @@ */ namespace qpid { namespace broker { - class TxBuffer{ + class QPID_BROKER_CLASS_EXTERN TxBuffer { typedef std::vector::iterator op_iterator; std::vector ops; protected: @@ -78,7 +78,7 @@ namespace qpid { * * Once prepared, a transaction can be committed (or in * the 2pc case, rolled back). - * + * * @returns true if all the operations prepared * successfully, false if not. */ @@ -88,7 +88,7 @@ namespace qpid { * Signals that the ops all prepared successfully and can * now commit, i.e. the operation can now be fully carried * out. - * + * * Should only be called after a call to prepare() returns * true. */ @@ -96,7 +96,7 @@ namespace qpid { /** * Signals that all ops can be rolled back. - * + * * Should only be called either after a call to prepare() * returns true (2pc) or instead of a prepare call * ('server-local') diff --git a/qpid/cpp/src/qpid/client/Bounds.h b/qpid/cpp/src/qpid/client/Bounds.h index 838fcb8368..4696222c37 100644 --- a/qpid/cpp/src/qpid/client/Bounds.h +++ b/qpid/cpp/src/qpid/client/Bounds.h @@ -9,9 +9,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -21,11 +21,12 @@ * */ #include "qpid/sys/Waitable.h" +#include "qpid/client/ClientImportExport.h" namespace qpid{ namespace client{ -class Bounds +class QPID_CLIENT_CLASS_EXTERN Bounds { public: Bounds(size_t maxSize); @@ -33,7 +34,7 @@ class Bounds void reduce(size_t); size_t getCurrentSize(); void setException(const sys::ExceptionHolder&); - + private: friend std::ostream& operator<<(std::ostream&, const Bounds&); sys::Waitable lock; diff --git a/qpid/cpp/src/qpid/client/ConnectionImpl.h b/qpid/cpp/src/qpid/client/ConnectionImpl.h index cc81500b18..b7d4d423b2 100644 --- a/qpid/cpp/src/qpid/client/ConnectionImpl.h +++ b/qpid/cpp/src/qpid/client/ConnectionImpl.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -22,6 +22,7 @@ #ifndef _ConnectionImpl_ #define _ConnectionImpl_ +#include "qpid/client/ClientImportExport.h" #include "qpid/client/Bounds.h" #include "qpid/client/ConnectionHandler.h" @@ -44,9 +45,11 @@ class Connector; struct ConnectionSettings; class SessionImpl; -class ConnectionImpl : public Bounds, +// TODO aconway 2011-04-05: exposed for use by cluster::UpdateClient, +// clean up dependencies. +class QPID_CLIENT_CLASS_EXTERN ConnectionImpl : public Bounds, public framing::FrameHandler, - public sys::TimeoutHandler, + public sys::TimeoutHandler, public sys::ShutdownHandler, public boost::enable_shared_from_this { @@ -54,7 +57,7 @@ class ConnectionImpl : public Bounds, static const uint16_t NEXT_CHANNEL; - SessionMap sessions; + SessionMap sessions; ConnectionHandler handler; boost::scoped_ptr connector; framing::ProtocolVersion version; @@ -82,13 +85,13 @@ class ConnectionImpl : public Bounds, static void init(); static boost::shared_ptr create(framing::ProtocolVersion version, const ConnectionSettings& settings); ~ConnectionImpl(); - + void open(); bool isOpen() const; boost::shared_ptr newSession(const std::string& name, uint32_t timeout, uint16_t channel=NEXT_CHANNEL); void addSession(const boost::shared_ptr&, uint16_t channel=NEXT_CHANNEL); - + void close(); void handle(framing::AMQFrame& frame); void erase(uint16_t channel); diff --git a/qpid/cpp/src/qpid/client/Connector.h b/qpid/cpp/src/qpid/client/Connector.h index 586012f9d6..d26937d494 100644 --- a/qpid/cpp/src/qpid/client/Connector.h +++ b/qpid/cpp/src/qpid/client/Connector.h @@ -24,6 +24,7 @@ #include "qpid/framing/OutputHandler.h" #include "qpid/framing/ProtocolVersion.h" +#include "qpid/client/ClientImportExport.h" #include @@ -49,7 +50,7 @@ struct ConnectionSettings; class ConnectionImpl; ///@internal -class Connector : public framing::OutputHandler +class QPID_CLIENT_CLASS_EXTERN Connector : public framing::OutputHandler { public: // Protocol connector factory related stuff (it might be better to separate this code from the TCP Connector in the future) diff --git a/qpid/cpp/src/qpid/client/Demux.h b/qpid/cpp/src/qpid/client/Demux.h index 31dc3f9c06..ec26a76c86 100644 --- a/qpid/cpp/src/qpid/client/Demux.h +++ b/qpid/cpp/src/qpid/client/Demux.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -43,7 +43,7 @@ public: }; ///@internal -class Demux +class QPID_CLIENT_CLASS_EXTERN Demux { public: typedef boost::function Condition; @@ -52,7 +52,7 @@ public: QPID_CLIENT_EXTERN Demux(); QPID_CLIENT_EXTERN ~Demux(); - + QPID_CLIENT_EXTERN void handle(framing::FrameSet::shared_ptr); QPID_CLIENT_EXTERN void close(const sys::ExceptionHolder& ex); QPID_CLIENT_EXTERN void open(); diff --git a/qpid/cpp/src/qpid/client/Dispatcher.h b/qpid/cpp/src/qpid/client/Dispatcher.h index 74fdb90103..65599fd5db 100644 --- a/qpid/cpp/src/qpid/client/Dispatcher.h +++ b/qpid/cpp/src/qpid/client/Dispatcher.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -43,7 +43,7 @@ class SubscriptionImpl; typedef framing::Handler FrameSetHandler; ///@internal -class Dispatcher : public sys::Runnable +class QPID_CLIENT_CLASS_EXTERN Dispatcher : public sys::Runnable { typedef std::map >Listeners; sys::Mutex lock; diff --git a/qpid/cpp/src/qpid/client/SessionImpl.h b/qpid/cpp/src/qpid/client/SessionImpl.h index cd7b2c123d..e366def807 100644 --- a/qpid/cpp/src/qpid/client/SessionImpl.h +++ b/qpid/cpp/src/qpid/client/SessionImpl.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -22,6 +22,7 @@ #ifndef _SessionImpl_ #define _SessionImpl_ +#include "qpid/client/ClientImportExport.h" #include "qpid/client/Demux.h" #include "qpid/client/Execution.h" #include "qpid/client/Results.h" @@ -59,7 +60,9 @@ class ConnectionImpl; class SessionHandler; ///@internal -class SessionImpl : public framing::FrameHandler::InOutHandler, +// TODO aconway 2011-04-05: exposed for use by cluster::UpdateClient, +// clean up dependencies. +class QPID_CLIENT_CLASS_EXTERN SessionImpl : public framing::FrameHandler::InOutHandler, public Execution, private framing::AMQP_ClientOperations::SessionHandler, private framing::AMQP_ClientOperations::ExecutionHandler, @@ -110,18 +113,18 @@ public: void sendFlush(); void setException(const sys::ExceptionHolder&); - + //NOTE: these are called by the network thread when the connection is closed or dies void connectionClosed(uint16_t code, const std::string& text); void connectionBroke(const std::string& text); - /** Set timeout in seconds, returns actual timeout allowed by broker */ + /** Set timeout in seconds, returns actual timeout allowed by broker */ uint32_t setTimeout(uint32_t requestedSeconds); /** Get timeout in seconds. */ uint32_t getTimeout() const; - /** + /** * get the Connection associated with this connection */ boost::shared_ptr getConnection(); @@ -150,7 +153,7 @@ private: void setExceptionLH(const sys::ExceptionHolder&); // LH = lock held when called. void detach(); - + void check() const; void checkOpen() const; void handleClosed(); @@ -170,29 +173,29 @@ private: Future sendCommand(const framing::AMQBody&, const framing::MethodContent* = 0); void sendContent(const framing::MethodContent&); void waitForCompletionImpl(const framing::SequenceNumber& id); - + void sendCompletionImpl(); // Note: Following methods are called by network thread in // response to session controls from the broker - void attach(const std::string& name, bool force); - void attached(const std::string& name); - void detach(const std::string& name); + void attach(const std::string& name, bool force); + void attached(const std::string& name); + void detach(const std::string& name); void detached(const std::string& name, uint8_t detachCode); - void requestTimeout(uint32_t timeout); - void timeout(uint32_t timeout); - void commandPoint(const framing::SequenceNumber& commandId, uint64_t commandOffset); - void expected(const framing::SequenceSet& commands, const framing::Array& fragments); - void confirmed(const framing::SequenceSet& commands, const framing::Array& fragments); - void completed(const framing::SequenceSet& commands, bool timelyReply); - void knownCompleted(const framing::SequenceSet& commands); - void flush(bool expected, bool confirmed, bool completed); + void requestTimeout(uint32_t timeout); + void timeout(uint32_t timeout); + void commandPoint(const framing::SequenceNumber& commandId, uint64_t commandOffset); + void expected(const framing::SequenceSet& commands, const framing::Array& fragments); + void confirmed(const framing::SequenceSet& commands, const framing::Array& fragments); + void completed(const framing::SequenceSet& commands, bool timelyReply); + void knownCompleted(const framing::SequenceSet& commands); + void flush(bool expected, bool confirmed, bool completed); void gap(const framing::SequenceSet& commands); // Note: Following methods are called by network thread in // response to execution commands from the broker - void sync(); - void result(const framing::SequenceNumber& commandId, const std::string& value); + void sync(); + void result(const framing::SequenceNumber& commandId, const std::string& value); void exception(uint16_t errorCode, const framing::SequenceNumber& commandId, uint8_t classCode, @@ -200,7 +203,7 @@ private: uint8_t fieldIndex, const std::string& description, const framing::FieldTable& errorInfo); - + // Note: Following methods are called by network thread in // response to message commands from the broker // EXCEPT Message.Transfer @@ -239,13 +242,13 @@ private: SessionState sessionState; - // Only keep track of message credit + // Only keep track of message credit sys::Semaphore* sendMsgCredit; bool doClearDeliveryPropertiesExchange; bool autoDetach; - + friend class client::SessionHandler; }; diff --git a/qpid/cpp/src/qpid/client/SubscriptionImpl.h b/qpid/cpp/src/qpid/client/SubscriptionImpl.h index da77213423..0583d01cfa 100644 --- a/qpid/cpp/src/qpid/client/SubscriptionImpl.h +++ b/qpid/cpp/src/qpid/client/SubscriptionImpl.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -40,11 +40,11 @@ namespace client { class SubscriptionManager; class SubscriptionManagerImpl; -class SubscriptionImpl : public RefCounted, public MessageListener { +class QPID_CLIENT_CLASS_EXTERN SubscriptionImpl : public RefCounted, public MessageListener { public: QPID_CLIENT_EXTERN SubscriptionImpl(SubscriptionManager, const std::string& queue, const SubscriptionSettings&, const std::string& name, MessageListener* =0); - + /** The name of the subsctription, used as the "destination" for messages from the broker. * Usually the same as the queue name but can be set differently. */ diff --git a/qpid/cpp/src/qpid/cluster/Cpg.cpp b/qpid/cpp/src/qpid/cluster/Cpg.cpp index 0856bcd824..d54d007de9 100644 --- a/qpid/cpp/src/qpid/cluster/Cpg.cpp +++ b/qpid/cpp/src/qpid/cluster/Cpg.cpp @@ -32,7 +32,7 @@ // This is a macro instead of a function because we don't want to // evaluate the MSG argument unless there is an error. #define CPG_CHECK(RESULT, MSG) \ - if ((RESULT) != CPG_OK) throw Exception(errorStr((RESULT), (MSG))) + if ((RESULT) != CPG_OK) throw qpid::Exception(errorStr((RESULT), (MSG))) namespace qpid { namespace cluster { @@ -44,7 +44,7 @@ using namespace std; Cpg* Cpg::cpgFromHandle(cpg_handle_t handle) { void* cpg=0; CPG_CHECK(cpg_context_get(handle, &cpg), "Cannot get CPG instance."); - if (!cpg) throw Exception("Cannot get CPG instance."); + if (!cpg) throw qpid::Exception("Cannot get CPG instance."); return reinterpret_cast(cpg); } @@ -154,7 +154,7 @@ void Cpg::join(const std::string& name) { group = name; callCpg ( cpgJoinOp ); } - + void Cpg::leave() { callCpg ( cpgLeaveOp ); } diff --git a/qpid/cpp/src/qpid/cluster/Cpg.h b/qpid/cpp/src/qpid/cluster/Cpg.h index 6b81c602bd..26de3fece1 100644 --- a/qpid/cpp/src/qpid/cluster/Cpg.h +++ b/qpid/cpp/src/qpid/cluster/Cpg.h @@ -34,7 +34,7 @@ namespace cluster { /** * Lightweight C++ interface to cpg.h operations. - * + * * Manages a single CPG handle, initialized in ctor, finialzed in destructor. * On error all functions throw Cpg::Exception. * @@ -42,10 +42,6 @@ namespace cluster { class Cpg : public sys::IOHandle { public: - struct Exception : public ::qpid::Exception { - Exception(const std::string& msg) : ::qpid::Exception(msg) {} - }; - struct Name : public cpg_name { Name() { length = 0; } Name(const char* s) { copy(s, strlen(s)); } @@ -87,22 +83,22 @@ class Cpg : public sys::IOHandle { *@param handler for CPG events. */ Cpg(Handler&); - + /** Destructor calls shutdown if not already calledx. */ ~Cpg(); /** Disconnect from CPG */ void shutdown(); - + void dispatchOne(); void dispatchAll(); void dispatchBlocking(); - void join(const std::string& group); + void join(const std::string& group); void leave(); /** Multicast to the group. NB: must not be called concurrently. - * + * *@return true if the message was multi-cast, false if * it was not sent due to flow control. */ @@ -113,7 +109,7 @@ class Cpg : public sys::IOHandle { MemberId self() const; int getFd(); - + private: // Maximum number of retries for cog functions that can tell @@ -125,46 +121,46 @@ class Cpg : public sys::IOHandle { // Base class for the Cpg operations that need retry capability. - struct CpgOp { + struct CpgOp { std::string opName; - CpgOp ( std::string opName ) + CpgOp ( std::string opName ) : opName(opName) { } - virtual cpg_error_t op ( cpg_handle_t handle, struct cpg_name * ) = 0; + virtual cpg_error_t op ( cpg_handle_t handle, struct cpg_name * ) = 0; virtual std::string msg(const Name&) = 0; virtual ~CpgOp ( ) { } }; - struct CpgJoinOp : public CpgOp { + struct CpgJoinOp : public CpgOp { CpgJoinOp ( ) : CpgOp ( std::string("cpg_join") ) { } - cpg_error_t op(cpg_handle_t handle, struct cpg_name * group) { - return cpg_join ( handle, group ); + cpg_error_t op(cpg_handle_t handle, struct cpg_name * group) { + return cpg_join ( handle, group ); } std::string msg(const Name& name) { return cantJoinMsg(name); } }; - struct CpgLeaveOp : public CpgOp { + struct CpgLeaveOp : public CpgOp { CpgLeaveOp ( ) : CpgOp ( std::string("cpg_leave") ) { } - cpg_error_t op(cpg_handle_t handle, struct cpg_name * group) { - return cpg_leave ( handle, group ); + cpg_error_t op(cpg_handle_t handle, struct cpg_name * group) { + return cpg_leave ( handle, group ); } std::string msg(const Name& name) { return cantLeaveMsg(name); } }; - struct CpgFinalizeOp : public CpgOp { + struct CpgFinalizeOp : public CpgOp { CpgFinalizeOp ( ) : CpgOp ( std::string("cpg_finalize") ) { } - cpg_error_t op(cpg_handle_t handle, struct cpg_name *) { - return cpg_finalize ( handle ); + cpg_error_t op(cpg_handle_t handle, struct cpg_name *) { + return cpg_finalize ( handle ); } std::string msg(const Name& name) { return cantFinalizeMsg(name); } diff --git a/qpid/cpp/src/qpid/framing/AMQMethodBody.h b/qpid/cpp/src/qpid/framing/AMQMethodBody.h index c634180712..f05ad1192d 100644 --- a/qpid/cpp/src/qpid/framing/AMQMethodBody.h +++ b/qpid/cpp/src/qpid/framing/AMQMethodBody.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -37,18 +37,18 @@ class Buffer; class AMQP_ServerOperations; class MethodBodyConstVisitor; -class AMQMethodBody : public AMQBody { +class QPID_COMMON_CLASS_EXTERN AMQMethodBody : public AMQBody { public: AMQMethodBody() {} QPID_COMMON_EXTERN virtual ~AMQMethodBody(); virtual void accept(MethodBodyConstVisitor&) const = 0; - + virtual MethodId amqpMethodId() const = 0; virtual ClassId amqpClassId() const = 0; virtual bool isContentBearing() const = 0; - virtual bool resultExpected() const = 0; - virtual bool responseExpected() const = 0; + virtual bool resultExpected() const = 0; + virtual bool responseExpected() const = 0; template bool isA() const { return amqpClassId()==T::CLASS_ID && amqpMethodId()==T::METHOD_ID; diff --git a/qpid/cpp/src/qpid/framing/AccumulatedAck.h b/qpid/cpp/src/qpid/framing/AccumulatedAck.h index 8e241b4ba1..fd4c106414 100644 --- a/qpid/cpp/src/qpid/framing/AccumulatedAck.h +++ b/qpid/cpp/src/qpid/framing/AccumulatedAck.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -32,7 +32,7 @@ namespace qpid { namespace framing { - struct Range + struct QPID_COMMON_CLASS_EXTERN Range { SequenceNumber start; SequenceNumber end; @@ -47,7 +47,7 @@ namespace qpid { * Keeps an accumulated record of acknowledged messages (by delivery * tag). */ - class AccumulatedAck { + class QPID_COMMON_CLASS_EXTERN AccumulatedAck { public: /** * Everything up to this value has been acknowledged. diff --git a/qpid/cpp/src/qpid/framing/FrameDecoder.h b/qpid/cpp/src/qpid/framing/FrameDecoder.h index 26bed6c447..a19f8910a3 100644 --- a/qpid/cpp/src/qpid/framing/FrameDecoder.h +++ b/qpid/cpp/src/qpid/framing/FrameDecoder.h @@ -32,15 +32,15 @@ namespace framing { * Decode a frame from buffer. If buffer does not contain a complete * frame, caches the fragment for the next call to decode. */ -class FrameDecoder +class QPID_COMMON_CLASS_EXTERN FrameDecoder { public: QPID_COMMON_EXTERN bool decode(Buffer& buffer); - const AMQFrame& getFrame() const { return frame; } - AMQFrame& getFrame() { return frame; } + QPID_COMMON_EXTERN const AMQFrame& getFrame() const { return frame; } + QPID_COMMON_EXTERN AMQFrame& getFrame() { return frame; } - void setFragment(const char*, size_t); - std::pair getFragment() const; + QPID_COMMON_EXTERN void setFragment(const char*, size_t); + QPID_COMMON_EXTERN std::pair getFragment() const; private: std::vector fragment; diff --git a/qpid/cpp/src/qpid/framing/FrameSet.h b/qpid/cpp/src/qpid/framing/FrameSet.h index cae75e5ec8..8722153c22 100644 --- a/qpid/cpp/src/qpid/framing/FrameSet.h +++ b/qpid/cpp/src/qpid/framing/FrameSet.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -34,7 +34,7 @@ namespace framing { /** * Collects the frames representing a message. */ -class FrameSet +class QPID_COMMON_CLASS_EXTERN FrameSet { typedef InlineVector Frames; const SequenceNumber id; @@ -61,7 +61,7 @@ public: QPID_COMMON_EXTERN AMQMethodBody* getMethod(); QPID_COMMON_EXTERN const AMQHeaderBody* getHeaders() const; QPID_COMMON_EXTERN AMQHeaderBody* getHeaders(); - + template bool isA() const { const AMQMethodBody* method = getMethod(); return method && method->isA(); @@ -70,12 +70,12 @@ public: template const T* as() const { const AMQMethodBody* method = getMethod(); return (method && method->isA()) ? dynamic_cast(method) : 0; - } + } template T* as() { AMQMethodBody* method = getMethod(); return (method && method->isA()) ? dynamic_cast(method) : 0; - } + } template const T* getHeaderProperties() const { const AMQHeaderBody* header = getHeaders(); @@ -84,7 +84,7 @@ public: Frames::const_iterator begin() const { return parts.begin(); } Frames::const_iterator end() const { return parts.end(); } - + const SequenceNumber& getId() const { return id; } template void remove(P predicate) { diff --git a/qpid/cpp/src/qpid/framing/ProtocolInitiation.h b/qpid/cpp/src/qpid/framing/ProtocolInitiation.h index c519bc2442..7c66034d1d 100644 --- a/qpid/cpp/src/qpid/framing/ProtocolInitiation.h +++ b/qpid/cpp/src/qpid/framing/ProtocolInitiation.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -30,18 +30,18 @@ namespace qpid { namespace framing { -class ProtocolInitiation : public AMQDataBlock +class QPID_COMMON_CLASS_EXTERN ProtocolInitiation : public AMQDataBlock { private: ProtocolVersion version; - + public: QPID_COMMON_EXTERN ProtocolInitiation(); QPID_COMMON_EXTERN ProtocolInitiation(uint8_t major, uint8_t minor); QPID_COMMON_EXTERN ProtocolInitiation(ProtocolVersion p); QPID_COMMON_EXTERN virtual ~ProtocolInitiation(); - QPID_COMMON_EXTERN virtual void encode(Buffer& buffer) const; - QPID_COMMON_EXTERN virtual bool decode(Buffer& buffer); + QPID_COMMON_EXTERN virtual void encode(Buffer& buffer) const; + QPID_COMMON_EXTERN virtual bool decode(Buffer& buffer); inline virtual uint32_t encodedSize() const { return 8; } inline uint8_t getMajor() const { return version.getMajor(); } inline uint8_t getMinor() const { return version.getMinor(); } diff --git a/qpid/cpp/src/qpid/framing/Proxy.h b/qpid/cpp/src/qpid/framing/Proxy.h index 0884e9cbd2..029e27382a 100644 --- a/qpid/cpp/src/qpid/framing/Proxy.h +++ b/qpid/cpp/src/qpid/framing/Proxy.h @@ -32,7 +32,7 @@ class AMQBody; /** * Base class for proxies. */ -class Proxy +class QPID_COMMON_CLASS_EXTERN Proxy { public: class ScopedSync diff --git a/qpid/cpp/src/qpid/framing/SendContent.h b/qpid/cpp/src/qpid/framing/SendContent.h index 1c464b9c8b..c21f4dc2fb 100644 --- a/qpid/cpp/src/qpid/framing/SendContent.h +++ b/qpid/cpp/src/qpid/framing/SendContent.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -35,7 +35,7 @@ namespace framing { * necessary. Currently only works on content frames but this could be * changed once we support multi-frame segments in general. */ -class SendContent +class QPID_COMMON_CLASS_EXTERN SendContent { FrameHandler& handler; const uint16_t maxFrameSize; diff --git a/qpid/cpp/src/qpid/framing/SequenceNumberSet.h b/qpid/cpp/src/qpid/framing/SequenceNumberSet.h index c8356c8163..fe4e32c112 100644 --- a/qpid/cpp/src/qpid/framing/SequenceNumberSet.h +++ b/qpid/cpp/src/qpid/framing/SequenceNumberSet.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -32,7 +32,7 @@ namespace qpid { namespace framing { -class SequenceNumberSet : public InlineVector +class QPID_COMMON_CLASS_EXTERN SequenceNumberSet : public InlineVector { typedef InlineVector Base; public: @@ -41,17 +41,17 @@ public: void encode(Buffer& buffer) const; void decode(Buffer& buffer); - uint32_t encodedSize() const; + uint32_t encodedSize() const; QPID_COMMON_EXTERN SequenceNumberSet condense() const; QPID_COMMON_EXTERN void addRange(const SequenceNumber& start, const SequenceNumber& end); template void processRanges(T& t) const { - if (size() % 2) { //must be even number + if (size() % 2) { //must be even number throw InvalidArgumentException("SequenceNumberSet contains odd number of elements"); } - + for (SequenceNumberSet::const_iterator i = begin(); i != end(); i++) { SequenceNumber first = *(i); SequenceNumber last = *(++i); @@ -60,7 +60,7 @@ public: } friend QPID_COMMON_EXTERN std::ostream& operator<<(std::ostream&, const SequenceNumberSet&); -}; +}; }} // namespace qpid::framing diff --git a/qpid/cpp/src/qpid/log/posix/SinkOptions.h b/qpid/cpp/src/qpid/log/posix/SinkOptions.h index d929c29025..52ba1ed13b 100644 --- a/qpid/cpp/src/qpid/log/posix/SinkOptions.h +++ b/qpid/cpp/src/qpid/log/posix/SinkOptions.h @@ -35,7 +35,7 @@ struct SyslogFacility { SyslogFacility(int i=0) : value(i) {} }; -struct SinkOptions : public qpid::log::SinkOptions { +struct QPID_COMMON_CLASS_EXTERN SinkOptions : public qpid::log::SinkOptions { SinkOptions(const std::string& argv0); virtual ~SinkOptions() {} diff --git a/qpid/cpp/src/qpid/management/ManagementAgent.h b/qpid/cpp/src/qpid/management/ManagementAgent.h index fb15dc6ed1..b9c8f7d503 100644 --- a/qpid/cpp/src/qpid/management/ManagementAgent.h +++ b/qpid/cpp/src/qpid/management/ManagementAgent.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -46,7 +46,7 @@ class ConnectionState; } namespace management { -class ManagementAgent +class QPID_BROKER_CLASS_EXTERN ManagementAgent { private: diff --git a/qpid/cpp/src/qpid/messaging/AddressParser.h b/qpid/cpp/src/qpid/messaging/AddressParser.h index 1635331d19..1772c32d49 100644 --- a/qpid/cpp/src/qpid/messaging/AddressParser.h +++ b/qpid/cpp/src/qpid/messaging/AddressParser.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -26,7 +26,7 @@ namespace qpid { namespace messaging { -class AddressParser +class QPID_MESSAGING_CLASS_EXTERN AddressParser { public: AddressParser(const std::string&); diff --git a/qpid/cpp/src/qpid/sys/AsynchIO.h b/qpid/cpp/src/qpid/sys/AsynchIO.h index 50da8fa4fc..fb4979a685 100644 --- a/qpid/cpp/src/qpid/sys/AsynchIO.h +++ b/qpid/cpp/src/qpid/sys/AsynchIO.h @@ -9,9 +9,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -31,7 +31,7 @@ namespace qpid { namespace sys { - + class Socket; class Poller; @@ -39,7 +39,7 @@ class Poller; * Asynchronous acceptor: accepts connections then does a callback with the * accepted fd */ -class AsynchAcceptor { +class QPID_COMMON_CLASS_EXTERN AsynchAcceptor { public: typedef boost::function1 Callback; @@ -52,7 +52,7 @@ public: * Asynchronous connector: starts the process of initiating a connection and * invokes a callback when completed or failed. */ -class AsynchConnector { +class QPID_COMMON_CLASS_EXTERN AsynchConnector { public: typedef boost::function1 ConnectedCallback; typedef boost::function3 FailedCallback; @@ -80,14 +80,14 @@ struct AsynchIOBufferBase { const int32_t byteCount; int32_t dataStart; int32_t dataCount; - + AsynchIOBufferBase(char* const b, const int32_t s) : bytes(b), byteCount(s), dataStart(0), dataCount(0) {} - + virtual ~AsynchIOBufferBase() {} @@ -100,11 +100,11 @@ struct AsynchIOBufferBase { }; /* - * Asychronous reader/writer: + * Asychronous reader/writer: * Reader accepts buffers to read into; reads into the provided buffers * and then does a callback with the buffer and amount read. Optionally it * can callback when there is something to read but no buffer to read it into. - * + * * Writer accepts a buffer and queues it for writing; can also be given * a callback for when writing is "idle" (ie fd is writable, but nothing * to write). diff --git a/qpid/cpp/src/qpid/sys/AsynchIOHandler.h b/qpid/cpp/src/qpid/sys/AsynchIOHandler.h index b9867606c4..48d0989309 100644 --- a/qpid/cpp/src/qpid/sys/AsynchIOHandler.h +++ b/qpid/cpp/src/qpid/sys/AsynchIOHandler.h @@ -39,7 +39,7 @@ class AsynchIO; struct AsynchIOBufferBase; class Socket; -class AsynchIOHandler : public OutputControl { +class QPID_COMMON_CLASS_EXTERN AsynchIOHandler : public OutputControl { std::string identifier; AsynchIO* aio; ConnectionCodec::Factory* factory; diff --git a/qpid/cpp/src/qpid/sys/ClusterSafe.h b/qpid/cpp/src/qpid/sys/ClusterSafe.h index 27e4eb46a5..e4c07f516b 100644 --- a/qpid/cpp/src/qpid/sys/ClusterSafe.h +++ b/qpid/cpp/src/qpid/sys/ClusterSafe.h @@ -56,10 +56,10 @@ QPID_COMMON_EXTERN bool isClusterSafe(); * Mark a scope as cluster safe. Sets isClusterSafe in constructor and resets * to previous value in destructor. */ -class ClusterSafeScope { +class QPID_COMMON_CLASS_EXTERN ClusterSafeScope { public: - ClusterSafeScope(); - ~ClusterSafeScope(); + QPID_COMMON_EXTERN ClusterSafeScope(); + QPID_COMMON_EXTERN ~ClusterSafeScope(); private: bool save; }; @@ -68,7 +68,7 @@ class ClusterSafeScope { * Mark a scope as cluster unsafe. Clears isClusterSafe in constructor and resets * to previous value in destructor. */ -class ClusterUnsafeScope { +class QPID_COMMON_CLASS_EXTERN ClusterUnsafeScope { public: QPID_COMMON_EXTERN ClusterUnsafeScope(); QPID_COMMON_EXTERN ~ClusterUnsafeScope(); @@ -80,7 +80,7 @@ class ClusterUnsafeScope { * Enable cluster-safe assertions. By default they are no-ops. * Called by cluster code. */ -void enableClusterSafe(); +QPID_COMMON_EXTERN void enableClusterSafe(); }} // namespace qpid::sys diff --git a/qpid/cpp/src/qpid/sys/DispatchHandle.h b/qpid/cpp/src/qpid/sys/DispatchHandle.h index 115a3c44f7..d5ec24a0dc 100644 --- a/qpid/cpp/src/qpid/sys/DispatchHandle.h +++ b/qpid/cpp/src/qpid/sys/DispatchHandle.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -36,11 +36,11 @@ class DispatchHandleRef; /** * In order to have your own handle (file descriptor on Unix) watched by the poller * you need to: - * + * * - Subclass IOHandle, in the constructor supply an appropriate * IOHandlerPrivate object for the platform. * - * - Construct a DispatchHandle passing it your IOHandle and + * - Construct a DispatchHandle passing it your IOHandle and * callback functions for read, write and disconnect events. * * - Ensure the DispatchHandle is not deleted until the poller is no longer using it. @@ -50,7 +50,7 @@ class DispatchHandleRef; * stops watching that handle. Your callback can call rewatch() or related functions * to re-enable polling. */ -class DispatchHandle : public PollerHandle { +class QPID_COMMON_CLASS_EXTERN DispatchHandle : public PollerHandle { friend class DispatchHandleRef; public: typedef boost::function1 Callback; @@ -77,7 +77,7 @@ public: * Provide a handle to poll and a set of callbacks. Note * callbacks can be 0, meaning you are not interested in that * event. - * + * *@param h: the handle to watch. The IOHandle encapsulates a * platfrom-specific handle to an IO object (e.g. a file descriptor * on Unix.) @@ -110,7 +110,7 @@ public: /** Stop watching permanently. Disassociates from the poller. */ QPID_COMMON_EXTERN void stopWatch(); - + /** Interrupt watching this handle and make a serialised callback that respects the * same exclusivity guarantees as the other callbacks */ diff --git a/qpid/cpp/src/qpid/sys/Dispatcher.h b/qpid/cpp/src/qpid/sys/Dispatcher.h index e8213d0579..15a8c37094 100644 --- a/qpid/cpp/src/qpid/sys/Dispatcher.h +++ b/qpid/cpp/src/qpid/sys/Dispatcher.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -29,13 +29,13 @@ namespace qpid { namespace sys { -class Dispatcher : public Runnable { +class QPID_COMMON_CLASS_EXTERN Dispatcher : public Runnable { const Poller::shared_ptr poller; public: QPID_COMMON_EXTERN Dispatcher(Poller::shared_ptr poller); QPID_COMMON_EXTERN ~Dispatcher(); - + QPID_COMMON_EXTERN void run(); }; diff --git a/qpid/cpp/src/qpid/sys/LockFile.h b/qpid/cpp/src/qpid/sys/LockFile.h index 14a76cbf3e..da830bdbc9 100644 --- a/qpid/cpp/src/qpid/sys/LockFile.h +++ b/qpid/cpp/src/qpid/sys/LockFile.h @@ -41,7 +41,7 @@ class LockFilePrivate; * doesn't, the old owner has probably died without cleaning up the lock * file. */ -class LockFile : private boost::noncopyable +class QPID_COMMON_CLASS_EXTERN LockFile : private boost::noncopyable { std::string path; bool created; @@ -55,10 +55,8 @@ public: QPID_COMMON_EXTERN LockFile(const std::string& path_, bool create); QPID_COMMON_EXTERN ~LockFile(); }; - + }} /* namespace qpid::sys */ #endif /*!_sys_LockFile_h*/ - - diff --git a/qpid/cpp/src/qpid/sys/PipeHandle.h b/qpid/cpp/src/qpid/sys/PipeHandle.h index 8aac76996b..83a71af6f7 100755 --- a/qpid/cpp/src/qpid/sys/PipeHandle.h +++ b/qpid/cpp/src/qpid/sys/PipeHandle.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at -* +* * http://www.apache.org/licenses/LICENSE-2.0 -* +* * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -26,17 +26,17 @@ #include "qpid/CommonImportExport.h" #include -// This class is a portability wrapper around pipe fds. -// It currently exists primarily and solely for the purpose of -// integration with single-threaded components that require QMF +// This class is a portability wrapper around pipe fds. +// It currently exists primarily and solely for the purpose of +// integration with single-threaded components that require QMF // integration through a signalling fd. namespace qpid { namespace sys { - class PipeHandle { + class QPID_COMMON_CLASS_EXTERN PipeHandle { private: - int writeFd; + int writeFd; int readFd; public: QPID_COMMON_EXTERN PipeHandle(bool nonBlocking=true); diff --git a/qpid/cpp/src/qpid/sys/PollableCondition.h b/qpid/cpp/src/qpid/sys/PollableCondition.h index 2eb6f2d947..3ba69b9da4 100644 --- a/qpid/cpp/src/qpid/sys/PollableCondition.h +++ b/qpid/cpp/src/qpid/sys/PollableCondition.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -33,7 +33,7 @@ namespace sys { class PollableConditionPrivate; -class PollableCondition { +class QPID_COMMON_CLASS_EXTERN PollableCondition { public: typedef boost::function1 Callback; diff --git a/qpid/cpp/src/qpid/sys/Poller.h b/qpid/cpp/src/qpid/sys/Poller.h index 01ee139ee6..3fa101b410 100644 --- a/qpid/cpp/src/qpid/sys/Poller.h +++ b/qpid/cpp/src/qpid/sys/Poller.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -44,7 +44,7 @@ namespace sys { */ class PollerHandle; class PollerPrivate; -class Poller : public Runnable { +class QPID_COMMON_CLASS_EXTERN Poller : public Runnable { PollerPrivate* const impl; public: @@ -71,20 +71,20 @@ public: struct Event { PollerHandle* handle; EventType type; - + Event(PollerHandle* handle0, EventType type0) : handle(handle0), type(type0) { } - + void process(); }; - + QPID_COMMON_EXTERN Poller(); QPID_COMMON_EXTERN ~Poller(); /** Note: this function is async-signal safe */ QPID_COMMON_EXTERN void shutdown(); - + // Interrupt waiting for a specific poller handle // returns true if we could interrupt the handle // - in this case on return the handle is no longer being monitored, @@ -94,9 +94,9 @@ public: // - This can either be because it has just received an event which has been // reported and has not been reenabled since. // - Because it was removed from the monitoring set - // - Or because it is already being interrupted + // - Or because it is already being interrupted QPID_COMMON_EXTERN bool interrupt(PollerHandle& handle); - + // Poller run loop QPID_COMMON_EXTERN void run(); @@ -114,7 +114,7 @@ public: */ class IOHandle; class PollerHandlePrivate; -class PollerHandle { +class QPID_COMMON_CLASS_EXTERN PollerHandle { friend class Poller; friend class PollerPrivate; friend struct Poller::Event; diff --git a/qpid/cpp/src/qpid/sys/Shlib.h b/qpid/cpp/src/qpid/sys/Shlib.h index 7f66cfec14..11690121a8 100644 --- a/qpid/cpp/src/qpid/sys/Shlib.h +++ b/qpid/cpp/src/qpid/sys/Shlib.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -22,7 +22,7 @@ * */ -#include "qpid/CommonImportExport.h" +#include "qpid/CommonImportExport.h" #include #include @@ -32,7 +32,7 @@ namespace sys { /** Encapsulates a shared library handle. *@see AutoShlib */ -class Shlib { +class QPID_COMMON_CLASS_EXTERN Shlib { public: /** Load a shared library */ Shlib(const char* libname) { load(libname); } @@ -55,14 +55,14 @@ class Shlib { return reinterpret_cast(reinterpret_cast( this->getSymbol(symbol))); } - + private: void* handle; QPID_COMMON_EXTERN void load(const char* libname); }; /** A shared library handle that unloads the shlib in it's dtor */ -class AutoShlib : public Shlib { +class QPID_COMMON_CLASS_EXTERN AutoShlib : public Shlib { public: /** Load shared library */ AutoShlib(const std::string& libname) : Shlib(libname) {} @@ -70,7 +70,7 @@ class AutoShlib : public Shlib { QPID_COMMON_EXTERN ~AutoShlib() throw(); }; - + }} // namespace qpid::sys #endif /*!QPID_SYS_SHLIB_H*/ diff --git a/qpid/cpp/src/qpid/sys/SocketAddress.h b/qpid/cpp/src/qpid/sys/SocketAddress.h index 27b9642f2c..1f66443d9c 100644 --- a/qpid/cpp/src/qpid/sys/SocketAddress.h +++ b/qpid/cpp/src/qpid/sys/SocketAddress.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -32,7 +32,7 @@ namespace qpid { namespace sys { class SocketAddress { - friend const ::addrinfo& getAddrInfo(const SocketAddress&); + QPID_COMMON_EXTERN friend const ::addrinfo& getAddrInfo(const SocketAddress&); public: /** Create a SocketAddress from hostname and port*/ @@ -41,7 +41,7 @@ public: QPID_COMMON_EXTERN SocketAddress& operator=(const SocketAddress&); QPID_COMMON_EXTERN ~SocketAddress(); - std::string asString() const; + QPID_COMMON_EXTERN std::string asString() const; private: std::string host; diff --git a/qpid/cpp/src/qpid/sys/Timer.h b/qpid/cpp/src/qpid/sys/Timer.h index 98ba39ce38..6ffd87173a 100644 --- a/qpid/cpp/src/qpid/sys/Timer.h +++ b/qpid/cpp/src/qpid/sys/Timer.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -38,7 +38,7 @@ namespace sys { class Timer; -class TimerTask : public RefCounted { +class QPID_COMMON_CLASS_EXTERN TimerTask : public RefCounted { friend class Timer; friend bool operator<(const boost::intrusive_ptr&, const boost::intrusive_ptr&); @@ -73,7 +73,7 @@ class TimerTask : public RefCounted { bool operator<(const boost::intrusive_ptr& a, const boost::intrusive_ptr& b); -class Timer : private Runnable { +class QPID_COMMON_CLASS_EXTERN Timer : private Runnable { qpid::sys::Monitor monitor; std::priority_queue > tasks; qpid::sys::Thread runner; diff --git a/qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.h b/qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.h index 1645cf1a58..d0b5a9c1e9 100644 --- a/qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.h +++ b/qpid/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -22,6 +22,7 @@ * */ +#include "qpid/CommonImportExport.h" #include "qpid/sys/IntegerTypes.h" #include "qpid/sys/SecurityLayer.h" #include @@ -34,7 +35,7 @@ namespace cyrus { /** * Implementation of SASL security layer using cyrus-sasl library */ -class CyrusSecurityLayer : public qpid::sys::SecurityLayer +class QPID_COMMON_CLASS_EXTERN CyrusSecurityLayer : public qpid::sys::SecurityLayer { public: CyrusSecurityLayer(sasl_conn_t*, uint16_t maxFrameSize); diff --git a/qpid/cpp/src/qpid/sys/posix/Fork.h b/qpid/cpp/src/qpid/sys/posix/Fork.h index 698c61ed30..4f055da67d 100644 --- a/qpid/cpp/src/qpid/sys/posix/Fork.h +++ b/qpid/cpp/src/qpid/sys/posix/Fork.h @@ -21,6 +21,7 @@ #include #include +#include "qpid/CommonImportExport.h" namespace qpid { namespace sys { @@ -28,7 +29,7 @@ namespace sys { /** * Fork the process. Call parent() in parent and child() in child. */ -class Fork { +class QPID_COMMON_CLASS_EXTERN Fork { public: Fork(); virtual ~Fork(); diff --git a/qpid/cpp/src/qpid/sys/posix/PidFile.h b/qpid/cpp/src/qpid/sys/posix/PidFile.h index fb19d407f4..2c625a3679 100644 --- a/qpid/cpp/src/qpid/sys/posix/PidFile.h +++ b/qpid/cpp/src/qpid/sys/posix/PidFile.h @@ -31,7 +31,7 @@ namespace qpid { namespace sys { -class PidFile : public LockFile +class QPID_COMMON_CLASS_EXTERN PidFile : public LockFile { public: QPID_COMMON_EXTERN PidFile(const std::string& path_, bool create); @@ -56,7 +56,7 @@ public: */ QPID_COMMON_EXTERN void writePid(void); }; - + }} /* namespace qpid::sys */ #endif /*!_sys_PidFile_h*/ diff --git a/qpid/cpp/src/qpid/sys/posix/Shlib.cpp b/qpid/cpp/src/qpid/sys/posix/Shlib.cpp index 3fb685d5b8..58a2572fb3 100644 --- a/qpid/cpp/src/qpid/sys/posix/Shlib.cpp +++ b/qpid/cpp/src/qpid/sys/posix/Shlib.cpp @@ -29,7 +29,7 @@ namespace sys { void Shlib::load(const char* name) { ::dlerror(); - handle = ::dlopen(name, RTLD_NOW); + handle = ::dlopen(name, RTLD_NOW | RTLD_GLOBAL); const char* error = ::dlerror(); if (error) { throw Exception(QPID_MSG(error << ": " << name)); diff --git a/qpid/cpp/src/qpid/sys/rdma/ImportExport.h b/qpid/cpp/src/qpid/sys/rdma/ImportExport.h new file mode 100644 index 0000000000..8d11993403 --- /dev/null +++ b/qpid/cpp/src/qpid/sys/rdma/ImportExport.h @@ -0,0 +1,35 @@ +#ifndef RDMAWRAP_IMPORTEXPORT_H +#define RDMAWRAP_IMPORTEXPORT_H + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "qpid/ImportExport.h" + +#if defined (rdmawrap_EXPORTS) +# define RDMAWRAP_EXTERN QPID_EXPORT +# define RDMAWRAP_CLASS_EXTERN QPID_CLASS_EXPORT +# define RDMAWRAP_INLINE_EXTERN QPID_INLINE_EXPORT +#else +# define RDMAWRAP_EXTERN QPID_IMPORT +# define RDMAWRAP_CLASS_EXTERN QPID_CLASS_IMPORT +# define RDMAWRAP_INLINE_EXTERN QPID_INLINE_IMPORT +#endif + +#endif /*!RDMAWRAP_IMPORTEXPORT_H*/ diff --git a/qpid/cpp/src/qpid/sys/rdma/RdmaIO.h b/qpid/cpp/src/qpid/sys/rdma/RdmaIO.h index ec9caaf08d..a6df566a73 100644 --- a/qpid/cpp/src/qpid/sys/rdma/RdmaIO.h +++ b/qpid/cpp/src/qpid/sys/rdma/RdmaIO.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -21,6 +21,7 @@ #ifndef Rdma_Acceptor_h #define Rdma_Acceptor_h +#include "ImportExport.h" #include "qpid/sys/rdma/rdma_wrap.h" #include "qpid/sys/AtomicValue.h" @@ -37,7 +38,8 @@ namespace Rdma { class Connection; - class AsynchIO +// FIXME aconway 2011-03-22: class vs. member declarations. + class RDMAWRAP_CLASS_EXTERN AsynchIO { typedef boost::function1 ErrorCallback; typedef boost::function2 ReadCallback; @@ -111,7 +113,7 @@ namespace Rdma { void doWriteCallback(); void checkDrained(); void doStoppedCallback(); - + void queueBuffer(Buffer* buff, int credit); Buffer* extractBuffer(const QueuePairEvent& e); }; @@ -143,7 +145,7 @@ namespace Rdma { // These are the parameters necessary to start the conversation // * Each peer HAS to allocate buffers of the size of the maximum receive from its peer - // * Each peer HAS to know the initial "credit" it has for transmitting to its peer + // * Each peer HAS to know the initial "credit" it has for transmitting to its peer struct ConnectionParams { uint32_t maxRecvBufferSize; uint16_t initialXmitCredit; @@ -168,9 +170,9 @@ namespace Rdma { typedef boost::function2 ErrorCallback; typedef boost::function1 DisconnectedCallback; - class ConnectionManager { + class RDMAWRAP_CLASS_EXTERN ConnectionManager { typedef boost::function1 NotifyCallback; - + enum State {IDLE, STOPPED}; qpid::sys::AtomicValue state; Connection::intrusive_ptr ci; @@ -203,7 +205,7 @@ namespace Rdma { typedef boost::function2 ConnectionRequestCallback; typedef boost::function1 EstablishedCallback; - class Listener : public ConnectionManager + class RDMAWRAP_CLASS_EXTERN Listener : public ConnectionManager { ConnectionParams checkConnectionParams; ConnectionRequestCallback connectionRequestCallback; @@ -226,7 +228,7 @@ namespace Rdma { typedef boost::function2 RejectedCallback; typedef boost::function2 ConnectedCallback; - class Connector : public ConnectionManager + class RDMAWRAP_CLASS_EXTERN Connector : public ConnectionManager { ConnectionParams connectionParams; RejectedCallback rejectedCallback; diff --git a/qpid/cpp/src/qpid/sys/rdma/rdma_wrap.h b/qpid/cpp/src/qpid/sys/rdma/rdma_wrap.h index 8e3429027b..7b66773ee8 100644 --- a/qpid/cpp/src/qpid/sys/rdma/rdma_wrap.h +++ b/qpid/cpp/src/qpid/sys/rdma/rdma_wrap.h @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -23,6 +23,7 @@ #include +#include "ImportExport.h" #include "qpid/RefCounted.h" #include "qpid/sys/IOHandle.h" #include "qpid/sys/Mutex.h" @@ -90,7 +91,7 @@ namespace Rdma { RECV }; - class QueuePairEvent { + class RDMAWRAP_CLASS_EXTERN QueuePairEvent { boost::shared_ptr< ::ibv_cq > cq; ::ibv_wc wc; QueueDirection dir; @@ -116,7 +117,7 @@ namespace Rdma { // Wrapper for a queue pair - this has the functionality for // putting buffers on the receive queue and for sending buffers // to the other end of the connection. - class QueuePair : public qpid::sys::IOHandle, public qpid::RefCounted { + class RDMAWRAP_CLASS_EXTERN QueuePair : public qpid::sys::IOHandle, public qpid::RefCounted { friend class Connection; boost::shared_ptr< ::ibv_pd > pd; @@ -168,7 +169,7 @@ namespace Rdma { void notifySend(); }; - class ConnectionEvent { + class RDMAWRAP_CLASS_EXTERN ConnectionEvent { friend class Connection; // The order of the members is important as we have to acknowledge @@ -195,7 +196,7 @@ namespace Rdma { // registered buffers can't be shared between different connections // (this can only happen between connections on the same controller in any case, // so needs careful management if used) - class Connection : public qpid::sys::IOHandle, public qpid::RefCounted { + class RDMAWRAP_CLASS_EXTERN Connection : public qpid::sys::IOHandle, public qpid::RefCounted { boost::shared_ptr< ::rdma_event_channel > channel; boost::shared_ptr< ::rdma_cm_id > id; QueuePair::intrusive_ptr qp; diff --git a/qpid/cpp/src/qpid/sys/ssl/SslCommonImportExport.h b/qpid/cpp/src/qpid/sys/ssl/SslCommonImportExport.h new file mode 100644 index 0000000000..4fbf1afeb6 --- /dev/null +++ b/qpid/cpp/src/qpid/sys/ssl/SslCommonImportExport.h @@ -0,0 +1,35 @@ +#ifndef QPID_SSL_COMMON_IMPORT_EXPORT_H +#define QPID_SSL_COMMON_IMPORT_EXPORT_H + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "qpid/ImportExport.h" + +#if defined(SSL_COMMON_EXPORT) || defined (qpidssl_common_EXPORTS) +# define QPID_SSL_COMMON_EXTERN QPID_EXPORT +# define QPID_SSL_COMMON_CLASS_EXTERN QPID_CLASS_EXPORT +# define QPID_SSL_COMMON_INLINE_EXTERN QPID_INLINE_EXPORT +#else +# define QPID_SSL_COMMON_EXTERN QPID_IMPORT +# define QPID_SSL_COMMON_CLASS_EXTERN QPID_CLASS_IMPORT +# define QPID_SSL_COMMON_INLINE_EXTERN QPID_INLINE_IMPORT +#endif + +#endif diff --git a/qpid/cpp/src/qpid/sys/ssl/SslIo.h b/qpid/cpp/src/qpid/sys/ssl/SslIo.h index 53ac69d8d6..ecb031a5cf 100644 --- a/qpid/cpp/src/qpid/sys/ssl/SslIo.h +++ b/qpid/cpp/src/qpid/sys/ssl/SslIo.h @@ -9,9 +9,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -23,6 +23,7 @@ #include "qpid/sys/DispatchHandle.h" #include "qpid/sys/SecuritySettings.h" +#include "qpid/sys/ssl/SslCommonImportExport.h" #include #include @@ -30,7 +31,7 @@ namespace qpid { namespace sys { namespace ssl { - + class SslSocket; /* @@ -87,31 +88,31 @@ struct SslIOBufferBase { const int32_t byteCount; int32_t dataStart; int32_t dataCount; - + SslIOBufferBase(char* const b, const int32_t s) : bytes(b), byteCount(s), dataStart(0), dataCount(0) {} - + virtual ~SslIOBufferBase() {} }; /* - * Asychronous reader/writer: + * Asychronous reader/writer: * Reader accepts buffers to read into; reads into the provided buffers * and then does a callback with the buffer and amount read. Optionally it can callback * when there is something to read but no buffer to read it into. - * + * * Writer accepts a buffer and queues it for writing; can also be given * a callback for when writing is "idle" (ie fd is writable, but nothing to write) - * + * * The class is implemented in terms of DispatchHandle to allow it to be deleted by deleting * the contained DispatchHandle */ -class SslIO : private qpid::sys::DispatchHandle { +class QPID_SSL_COMMON_CLASS_EXTERN SslIO : private qpid::sys::DispatchHandle { public: typedef SslIOBufferBase BufferBase; diff --git a/qpid/cpp/src/ssl.mk b/qpid/cpp/src/ssl.mk index 4dba9bb61c..126fcef03b 100644 --- a/qpid/cpp/src/ssl.mk +++ b/qpid/cpp/src/ssl.mk @@ -56,7 +56,10 @@ sslconnector_la_LIBADD = \ libqpidclient.la \ libsslcommon.la -sslconnector_la_CXXFLAGS = $(AM_CXXFLAGS) -DQPIDC_CONF_FILE=\"$(confdir)/qpidc.conf\" $(SSL_CFLAGS) +sslconnector_la_CXXFLAGS = \ + $(AM_CXXFLAGS) \ + -DQPIDC_CONF_FILE=\"$(confdir)/qpidc.conf\" \ + $(SSL_CFLAGS) -Dqpidsslcommon_EXPORTS sslconnector_la_LDFLAGS = $(PLUGINLDFLAGS) diff --git a/qpid/cpp/src/tests/unit_test.cpp b/qpid/cpp/src/tests/unit_test.cpp index 00c61242e4..2911ef6811 100644 --- a/qpid/cpp/src/tests/unit_test.cpp +++ b/qpid/cpp/src/tests/unit_test.cpp @@ -19,5 +19,10 @@ // Defines test_main function to link with actual unit test code. #define BOOST_AUTO_TEST_MAIN // Boost 1.33 #define BOOST_TEST_MAIN + +// FIXME aconway 2011-04-05: work around link problem, need portable solution. +#pragma GCC visibility push(default) + #include "unit_test.h" +#pragma GCC visibility pop -- cgit v1.2.1