summaryrefslogtreecommitdiff
path: root/cpp/include/qpid/messaging
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2011-05-17 21:02:34 +0000
committerTed Ross <tross@apache.org>2011-05-17 21:02:34 +0000
commit3f1fab7253a480c12c2ad10e6183e0a5f58d3530 (patch)
tree6938e1818081456b594e66e9672ee87ef8a47ddc /cpp/include/qpid/messaging
parente62058eb26d4458d2041eb83579c74a44421b236 (diff)
downloadqpid-python-3f1fab7253a480c12c2ad10e6183e0a5f58d3530.tar.gz
QPID-3186 - Import Export generalization to support a larger set of compilers and run time environments
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1104559 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/include/qpid/messaging')
-rw-r--r--cpp/include/qpid/messaging/Address.h2
-rw-r--r--cpp/include/qpid/messaging/Connection.h2
-rw-r--r--cpp/include/qpid/messaging/Duration.h6
-rw-r--r--cpp/include/qpid/messaging/FailoverUpdates.h2
-rw-r--r--cpp/include/qpid/messaging/Handle.h10
-rw-r--r--cpp/include/qpid/messaging/ImportExport.h14
-rw-r--r--cpp/include/qpid/messaging/Message.h22
-rw-r--r--cpp/include/qpid/messaging/Receiver.h2
-rw-r--r--cpp/include/qpid/messaging/Sender.h2
-rw-r--r--cpp/include/qpid/messaging/Session.h2
-rw-r--r--cpp/include/qpid/messaging/exceptions.h42
11 files changed, 54 insertions, 52 deletions
diff --git a/cpp/include/qpid/messaging/Address.h b/cpp/include/qpid/messaging/Address.h
index bebbfc72f6..63dce0c49d 100644
--- a/cpp/include/qpid/messaging/Address.h
+++ b/cpp/include/qpid/messaging/Address.h
@@ -119,7 +119,7 @@ class AddressImpl;
*
* An address has value semantics.
*/
-class Address
+class QPID_MESSAGING_CLASS_EXTERN Address
{
public:
QPID_MESSAGING_EXTERN Address();
diff --git a/cpp/include/qpid/messaging/Connection.h b/cpp/include/qpid/messaging/Connection.h
index 1ad7a7242f..e938f23189 100644
--- a/cpp/include/qpid/messaging/Connection.h
+++ b/cpp/include/qpid/messaging/Connection.h
@@ -42,7 +42,7 @@ class Session;
* A connection represents a network connection to a remote endpoint.
*/
-class Connection : public qpid::messaging::Handle<ConnectionImpl>
+class QPID_MESSAGING_CLASS_EXTERN Connection : public qpid::messaging::Handle<ConnectionImpl>
{
public:
QPID_MESSAGING_EXTERN Connection(ConnectionImpl* impl);
diff --git a/cpp/include/qpid/messaging/Duration.h b/cpp/include/qpid/messaging/Duration.h
index 1406e354c6..6b8f05c7c6 100644
--- a/cpp/include/qpid/messaging/Duration.h
+++ b/cpp/include/qpid/messaging/Duration.h
@@ -32,7 +32,7 @@ namespace messaging {
/** \ingroup messaging
* A duration is a time in milliseconds.
*/
-class Duration
+class QPID_MESSAGING_CLASS_EXTERN Duration
{
public:
QPID_MESSAGING_EXTERN explicit Duration(uint64_t milliseconds);
@@ -46,9 +46,9 @@ class Duration
};
QPID_MESSAGING_EXTERN Duration operator*(const Duration& duration,
- uint64_t multiplier);
+ uint64_t multiplier);
QPID_MESSAGING_EXTERN Duration operator*(uint64_t multiplier,
- const Duration& duration);
+ const Duration& duration);
QPID_MESSAGING_EXTERN bool operator==(const Duration& a, const Duration& b);
QPID_MESSAGING_EXTERN bool operator!=(const Duration& a, const Duration& b);
diff --git a/cpp/include/qpid/messaging/FailoverUpdates.h b/cpp/include/qpid/messaging/FailoverUpdates.h
index 14a1a31b63..6d7314620a 100644
--- a/cpp/include/qpid/messaging/FailoverUpdates.h
+++ b/cpp/include/qpid/messaging/FailoverUpdates.h
@@ -32,7 +32,7 @@ struct FailoverUpdatesImpl;
* A utility to listen for updates on cluster membership and update
* the list of known urls for a connection accordingly.
*/
-class FailoverUpdates
+class QPID_MESSAGING_CLASS_EXTERN FailoverUpdates
{
public:
QPID_MESSAGING_EXTERN FailoverUpdates(Connection& connection);
diff --git a/cpp/include/qpid/messaging/Handle.h b/cpp/include/qpid/messaging/Handle.h
index 1e634ef888..97a8f00b54 100644
--- a/cpp/include/qpid/messaging/Handle.h
+++ b/cpp/include/qpid/messaging/Handle.h
@@ -40,22 +40,22 @@ template <class T> class Handle {
public:
/**@return true if handle is valid, i.e. not null. */
- QPID_MESSAGING_EXTERN bool isValid() const { return impl; }
+ QPID_MESSAGING_INLINE_EXTERN bool isValid() const { return impl; }
/**@return true if handle is null. It is an error to call any function on a null handle. */
- QPID_MESSAGING_EXTERN bool isNull() const { return !impl; }
+ QPID_MESSAGING_INLINE_EXTERN bool isNull() const { return !impl; }
/** Conversion to bool supports idiom if (handle) { handle->... } */
- QPID_MESSAGING_EXTERN operator bool() const { return impl; }
+ QPID_MESSAGING_INLINE_EXTERN operator bool() const { return impl; }
/** Operator ! supports idiom if (!handle) { do_if_handle_is_null(); } */
- QPID_MESSAGING_EXTERN bool operator !() const { return !impl; }
+ QPID_MESSAGING_INLINE_EXTERN bool operator !() const { return !impl; }
void swap(Handle<T>& h) { T* t = h.impl; h.impl = impl; impl = t; }
protected:
typedef T Impl;
- QPID_MESSAGING_EXTERN Handle() :impl() {}
+ QPID_MESSAGING_INLINE_EXTERN Handle() :impl() {}
// Not implemented,subclasses must implement.
QPID_MESSAGING_EXTERN Handle(const Handle&);
diff --git a/cpp/include/qpid/messaging/ImportExport.h b/cpp/include/qpid/messaging/ImportExport.h
index 52f3eb8568..ab5f21f618 100644
--- a/cpp/include/qpid/messaging/ImportExport.h
+++ b/cpp/include/qpid/messaging/ImportExport.h
@@ -20,14 +20,16 @@
* under the License.
*/
-#if defined(WIN32) && !defined(QPID_DECLARE_STATIC)
+#include "qpid/ImportExport.h"
+
#if defined(CLIENT_EXPORT) || defined (qpidmessaging_EXPORTS)
-#define QPID_MESSAGING_EXTERN __declspec(dllexport)
-#else
-#define QPID_MESSAGING_EXTERN __declspec(dllimport)
-#endif
+# define QPID_MESSAGING_EXTERN QPID_EXPORT
+# define QPID_MESSAGING_CLASS_EXTERN QPID_CLASS_EXPORT
+# define QPID_MESSAGING_INLINE_EXTERN QPID_INLINE_EXPORT
#else
-#define QPID_MESSAGING_EXTERN
+# define QPID_MESSAGING_EXTERN QPID_IMPORT
+# define QPID_MESSAGING_CLASS_EXTERN QPID_CLASS_IMPORT
+# define QPID_MESSAGING_INLINE_EXTERN QPID_INLINE_IMPORT
#endif
#endif /*!QPID_MESSAGING_IMPORTEXPORT_H*/
diff --git a/cpp/include/qpid/messaging/Message.h b/cpp/include/qpid/messaging/Message.h
index d48af35cc0..5cd978f2a2 100644
--- a/cpp/include/qpid/messaging/Message.h
+++ b/cpp/include/qpid/messaging/Message.h
@@ -39,7 +39,7 @@ struct MessageImpl;
/** \ingroup messaging
* Representation of a message.
*/
-class Message
+class QPID_MESSAGING_CLASS_EXTERN Message
{
public:
QPID_MESSAGING_EXTERN Message(const std::string& bytes = std::string());
@@ -107,9 +107,9 @@ class Message
friend struct MessageImplAccess;
};
-struct EncodingException : qpid::types::Exception
+struct QPID_MESSAGING_CLASS_EXTERN EncodingException : qpid::types::Exception
{
- EncodingException(const std::string& msg);
+ QPID_MESSAGING_EXTERN EncodingException(const std::string& msg);
};
/**
@@ -122,8 +122,8 @@ struct EncodingException : qpid::types::Exception
* @exception EncodingException
*/
QPID_MESSAGING_EXTERN void decode(const Message& message,
- qpid::types::Variant::Map& map,
- const std::string& encoding = std::string());
+ qpid::types::Variant::Map& map,
+ const std::string& encoding = std::string());
/**
* Decodes message content into a Variant::List.
*
@@ -134,8 +134,8 @@ QPID_MESSAGING_EXTERN void decode(const Message& message,
* @exception EncodingException
*/
QPID_MESSAGING_EXTERN void decode(const Message& message,
- qpid::types::Variant::List& list,
- const std::string& encoding = std::string());
+ qpid::types::Variant::List& list,
+ const std::string& encoding = std::string());
/**
* Encodes a Variant::Map into a message.
*
@@ -146,8 +146,8 @@ QPID_MESSAGING_EXTERN void decode(const Message& message,
* @exception EncodingException
*/
QPID_MESSAGING_EXTERN void encode(const qpid::types::Variant::Map& map,
- Message& message,
- const std::string& encoding = std::string());
+ Message& message,
+ const std::string& encoding = std::string());
/**
* Encodes a Variant::List into a message.
*
@@ -158,8 +158,8 @@ QPID_MESSAGING_EXTERN void encode(const qpid::types::Variant::Map& map,
* @exception EncodingException
*/
QPID_MESSAGING_EXTERN void encode(const qpid::types::Variant::List& list,
- Message& message,
- const std::string& encoding = std::string());
+ Message& message,
+ const std::string& encoding = std::string());
}} // namespace qpid::messaging
diff --git a/cpp/include/qpid/messaging/Receiver.h b/cpp/include/qpid/messaging/Receiver.h
index 6f3ae961db..13317dfcbd 100644
--- a/cpp/include/qpid/messaging/Receiver.h
+++ b/cpp/include/qpid/messaging/Receiver.h
@@ -41,7 +41,7 @@ class Session;
/** \ingroup messaging
* Interface through which messages are received.
*/
-class Receiver : public qpid::messaging::Handle<ReceiverImpl>
+class QPID_MESSAGING_CLASS_EXTERN Receiver : public qpid::messaging::Handle<ReceiverImpl>
{
public:
QPID_MESSAGING_EXTERN Receiver(ReceiverImpl* impl = 0);
diff --git a/cpp/include/qpid/messaging/Sender.h b/cpp/include/qpid/messaging/Sender.h
index 85658f37cc..8e1c5846e9 100644
--- a/cpp/include/qpid/messaging/Sender.h
+++ b/cpp/include/qpid/messaging/Sender.h
@@ -40,7 +40,7 @@ class Session;
/** \ingroup messaging
* Interface through which messages are sent.
*/
-class Sender : public qpid::messaging::Handle<SenderImpl>
+class QPID_MESSAGING_CLASS_EXTERN Sender : public qpid::messaging::Handle<SenderImpl>
{
public:
QPID_MESSAGING_EXTERN Sender(SenderImpl* impl = 0);
diff --git a/cpp/include/qpid/messaging/Session.h b/cpp/include/qpid/messaging/Session.h
index 6c023629e0..52786eb5f4 100644
--- a/cpp/include/qpid/messaging/Session.h
+++ b/cpp/include/qpid/messaging/Session.h
@@ -46,7 +46,7 @@ class SessionImpl;
* A session represents a distinct 'conversation' which can involve
* sending and receiving messages to and from different addresses.
*/
-class Session : public qpid::messaging::Handle<SessionImpl>
+class QPID_MESSAGING_CLASS_EXTERN Session : public qpid::messaging::Handle<SessionImpl>
{
public:
QPID_MESSAGING_EXTERN Session(SessionImpl* impl = 0);
diff --git a/cpp/include/qpid/messaging/exceptions.h b/cpp/include/qpid/messaging/exceptions.h
index 0ff608b343..07d1dc414b 100644
--- a/cpp/include/qpid/messaging/exceptions.h
+++ b/cpp/include/qpid/messaging/exceptions.h
@@ -32,7 +32,7 @@ namespace messaging {
/** \ingroup messaging
*/
-struct MessagingException : public qpid::types::Exception
+struct QPID_MESSAGING_CLASS_EXTERN MessagingException : public qpid::types::Exception
{
QPID_MESSAGING_EXTERN MessagingException(const std::string& msg);
QPID_MESSAGING_EXTERN virtual ~MessagingException() throw();
@@ -41,22 +41,22 @@ struct MessagingException : public qpid::types::Exception
//TODO: override what() to include detail if present
};
-struct InvalidOptionString : public MessagingException
+struct QPID_MESSAGING_CLASS_EXTERN InvalidOptionString : public MessagingException
{
QPID_MESSAGING_EXTERN InvalidOptionString(const std::string& msg);
};
-struct KeyError : public MessagingException
+struct QPID_MESSAGING_CLASS_EXTERN KeyError : public MessagingException
{
QPID_MESSAGING_EXTERN KeyError(const std::string&);
};
-struct LinkError : public MessagingException
+struct QPID_MESSAGING_CLASS_EXTERN LinkError : public MessagingException
{
QPID_MESSAGING_EXTERN LinkError(const std::string&);
};
-struct AddressError : public LinkError
+struct QPID_MESSAGING_CLASS_EXTERN AddressError : public LinkError
{
QPID_MESSAGING_EXTERN AddressError(const std::string&);
};
@@ -65,17 +65,17 @@ struct AddressError : public LinkError
* Thrown when a syntactically correct address cannot be resolved or
* used.
*/
-struct ResolutionError : public AddressError
+struct QPID_MESSAGING_CLASS_EXTERN ResolutionError : public AddressError
{
QPID_MESSAGING_EXTERN ResolutionError(const std::string& msg);
};
-struct AssertionFailed : public ResolutionError
+struct QPID_MESSAGING_CLASS_EXTERN AssertionFailed : public ResolutionError
{
QPID_MESSAGING_EXTERN AssertionFailed(const std::string& msg);
};
-struct NotFound : public ResolutionError
+struct QPID_MESSAGING_CLASS_EXTERN NotFound : public ResolutionError
{
QPID_MESSAGING_EXTERN NotFound(const std::string& msg);
};
@@ -83,67 +83,67 @@ struct NotFound : public ResolutionError
/**
* Thrown when an address string with inalid sytanx is used.
*/
-struct MalformedAddress : public AddressError
+struct QPID_MESSAGING_CLASS_EXTERN MalformedAddress : public AddressError
{
QPID_MESSAGING_EXTERN MalformedAddress(const std::string& msg);
};
-struct ReceiverError : public LinkError
+struct QPID_MESSAGING_CLASS_EXTERN ReceiverError : public LinkError
{
QPID_MESSAGING_EXTERN ReceiverError(const std::string&);
};
-struct FetchError : public ReceiverError
+struct QPID_MESSAGING_CLASS_EXTERN FetchError : public ReceiverError
{
QPID_MESSAGING_EXTERN FetchError(const std::string&);
};
-struct NoMessageAvailable : public FetchError
+struct QPID_MESSAGING_CLASS_EXTERN NoMessageAvailable : public FetchError
{
QPID_MESSAGING_EXTERN NoMessageAvailable();
};
-struct SenderError : public LinkError
+struct QPID_MESSAGING_CLASS_EXTERN SenderError : public LinkError
{
QPID_MESSAGING_EXTERN SenderError(const std::string&);
};
-struct SendError : public SenderError
+struct QPID_MESSAGING_CLASS_EXTERN SendError : public SenderError
{
QPID_MESSAGING_EXTERN SendError(const std::string&);
};
-struct TargetCapacityExceeded : public SendError
+struct QPID_MESSAGING_CLASS_EXTERN TargetCapacityExceeded : public SendError
{
QPID_MESSAGING_EXTERN TargetCapacityExceeded(const std::string&);
};
-struct SessionError : public MessagingException
+struct QPID_MESSAGING_CLASS_EXTERN SessionError : public MessagingException
{
QPID_MESSAGING_EXTERN SessionError(const std::string&);
};
-struct TransactionError : public SessionError
+struct QPID_MESSAGING_CLASS_EXTERN TransactionError : public SessionError
{
QPID_MESSAGING_EXTERN TransactionError(const std::string&);
};
-struct TransactionAborted : public TransactionError
+struct QPID_MESSAGING_CLASS_EXTERN TransactionAborted : public TransactionError
{
QPID_MESSAGING_EXTERN TransactionAborted(const std::string&);
};
-struct UnauthorizedAccess : public SessionError
+struct QPID_MESSAGING_CLASS_EXTERN UnauthorizedAccess : public SessionError
{
QPID_MESSAGING_EXTERN UnauthorizedAccess(const std::string&);
};
-struct ConnectionError : public MessagingException
+struct QPID_MESSAGING_CLASS_EXTERN ConnectionError : public MessagingException
{
QPID_MESSAGING_EXTERN ConnectionError(const std::string&);
};
-struct TransportFailure : public MessagingException
+struct QPID_MESSAGING_CLASS_EXTERN TransportFailure : public MessagingException
{
QPID_MESSAGING_EXTERN TransportFailure(const std::string&);
};