You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2009/08/25 19:57:37 UTC

svn commit: r807731 [1/3] - in /qpid/trunk/qpid/cpp: ./ examples/ examples/messaging/ include/qpid/client/amqp0_10/ include/qpid/messaging/ src/ src/qpid/client/ src/qpid/client/amqp0_10/ src/qpid/messaging/ src/tests/

Author: gsim
Date: Tue Aug 25 17:57:34 2009
New Revision: 807731

URL: http://svn.apache.org/viewvc?rev=807731&view=rev
Log:
QPID-664: Initial checkin of high level messaging api for c++


Added:
    qpid/trunk/qpid/cpp/examples/messaging/
    qpid/trunk/qpid/cpp/examples/messaging/CMakeLists.txt
    qpid/trunk/qpid/cpp/examples/messaging/Makefile.am
    qpid/trunk/qpid/cpp/examples/messaging/Makefile.in
    qpid/trunk/qpid/cpp/examples/messaging/client.cpp
    qpid/trunk/qpid/cpp/examples/messaging/map_receiver.cpp
    qpid/trunk/qpid/cpp/examples/messaging/map_sender.cpp
    qpid/trunk/qpid/cpp/examples/messaging/queue_listener.cpp
    qpid/trunk/qpid/cpp/examples/messaging/queue_receiver.cpp
    qpid/trunk/qpid/cpp/examples/messaging/queue_sender.cpp
    qpid/trunk/qpid/cpp/examples/messaging/server.cpp
    qpid/trunk/qpid/cpp/examples/messaging/topic_listener.cpp
    qpid/trunk/qpid/cpp/examples/messaging/topic_receiver.cpp
    qpid/trunk/qpid/cpp/examples/messaging/topic_sender.cpp
    qpid/trunk/qpid/cpp/include/qpid/client/amqp0_10/
    qpid/trunk/qpid/cpp/include/qpid/client/amqp0_10/Codecs.h
    qpid/trunk/qpid/cpp/include/qpid/messaging/
    qpid/trunk/qpid/cpp/include/qpid/messaging/Address.h
    qpid/trunk/qpid/cpp/include/qpid/messaging/Codec.h
    qpid/trunk/qpid/cpp/include/qpid/messaging/Connection.h
    qpid/trunk/qpid/cpp/include/qpid/messaging/Filter.h
    qpid/trunk/qpid/cpp/include/qpid/messaging/Message.h
    qpid/trunk/qpid/cpp/include/qpid/messaging/MessageContent.h
    qpid/trunk/qpid/cpp/include/qpid/messaging/MessageListener.h
    qpid/trunk/qpid/cpp/include/qpid/messaging/Receiver.h
    qpid/trunk/qpid/cpp/include/qpid/messaging/Sender.h
    qpid/trunk/qpid/cpp/include/qpid/messaging/Session.h
    qpid/trunk/qpid/cpp/include/qpid/messaging/Variant.h
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.h
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/Codecs.cpp
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/CompletionTracker.cpp
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/CompletionTracker.h
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.h
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/IncomingMessages.cpp
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/IncomingMessages.h
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/MessageSink.h
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/MessageSource.h
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ReceiverImpl.h
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/SenderImpl.cpp
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/SenderImpl.h
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/SessionImpl.h
    qpid/trunk/qpid/cpp/src/qpid/messaging/
    qpid/trunk/qpid/cpp/src/qpid/messaging/Address.cpp
    qpid/trunk/qpid/cpp/src/qpid/messaging/Connection.cpp
    qpid/trunk/qpid/cpp/src/qpid/messaging/ConnectionImpl.h
    qpid/trunk/qpid/cpp/src/qpid/messaging/Filter.cpp
    qpid/trunk/qpid/cpp/src/qpid/messaging/Message.cpp
    qpid/trunk/qpid/cpp/src/qpid/messaging/Receiver.cpp
    qpid/trunk/qpid/cpp/src/qpid/messaging/ReceiverImpl.h
    qpid/trunk/qpid/cpp/src/qpid/messaging/Sender.cpp
    qpid/trunk/qpid/cpp/src/qpid/messaging/SenderImpl.h
    qpid/trunk/qpid/cpp/src/qpid/messaging/Session.cpp
    qpid/trunk/qpid/cpp/src/qpid/messaging/SessionImpl.h
    qpid/trunk/qpid/cpp/src/qpid/messaging/Variant.cpp
    qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp
    qpid/trunk/qpid/cpp/src/tests/Variant.cpp
Modified:
    qpid/trunk/qpid/cpp/configure.ac
    qpid/trunk/qpid/cpp/examples/CMakeLists.txt
    qpid/trunk/qpid/cpp/examples/Makefile.am
    qpid/trunk/qpid/cpp/src/CMakeLists.txt
    qpid/trunk/qpid/cpp/src/Makefile.am
    qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.cpp
    qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.h
    qpid/trunk/qpid/cpp/src/tests/CMakeLists.txt
    qpid/trunk/qpid/cpp/src/tests/Makefile.am

Modified: qpid/trunk/qpid/cpp/configure.ac
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/configure.ac?rev=807731&r1=807730&r2=807731&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/configure.ac (original)
+++ qpid/trunk/qpid/cpp/configure.ac Tue Aug 25 17:57:34 2009
@@ -512,6 +512,7 @@
   examples/xml-exchange/Makefile
   examples/qmf-console/Makefile
   examples/tradedemo/Makefile
+  examples/messaging/Makefile
   bindings/qmf/Makefile
   bindings/qmf/ruby/Makefile
   bindings/qmf/tests/Makefile

Modified: qpid/trunk/qpid/cpp/examples/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/CMakeLists.txt?rev=807731&r1=807730&r2=807731&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/examples/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/examples/CMakeLists.txt Tue Aug 25 17:57:34 2009
@@ -62,3 +62,4 @@
 add_subdirectory(request-response)
 add_subdirectory(tradedemo)
 add_subdirectory(xml-exchange)
+add_subdirectory(messaging)

Modified: qpid/trunk/qpid/cpp/examples/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/Makefile.am?rev=807731&r1=807730&r2=807731&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/examples/Makefile.am (original)
+++ qpid/trunk/qpid/cpp/examples/Makefile.am Tue Aug 25 17:57:34 2009
@@ -16,7 +16,7 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-SUBDIRS = direct fanout pub-sub request-response failover qmf-console tradedemo 
+SUBDIRS = direct fanout pub-sub request-response failover qmf-console tradedemo messaging
 if HAVE_XML
   SUBDIRS += xml-exchange
   broker_args = "--no-module-dir --data-dir \"\" --auth no --load-module $(top_builddir)/src/.libs/xml.so"	

Added: qpid/trunk/qpid/cpp/examples/messaging/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/messaging/CMakeLists.txt?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/examples/messaging/CMakeLists.txt (added)
+++ qpid/trunk/qpid/cpp/examples/messaging/CMakeLists.txt Tue Aug 25 17:57:34 2009
@@ -0,0 +1,32 @@
+#
+# 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.
+#
+
+add_example(messaging queue_listener)
+add_example(messaging queue_receiver)
+add_example(messaging queue_sender)
+
+add_example(messaging topic_listener)
+add_example(messaging topic_receiver)
+add_example(messaging topic_sender)
+
+add_example(messaging map_receiver)
+add_example(messaging map_sender)
+
+add_example(messaging client)
+add_example(messaging server)

Added: qpid/trunk/qpid/cpp/examples/messaging/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/messaging/Makefile.am?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/examples/messaging/Makefile.am (added)
+++ qpid/trunk/qpid/cpp/examples/messaging/Makefile.am Tue Aug 25 17:57:34 2009
@@ -0,0 +1,54 @@
+#
+# 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.
+#
+examplesdir=$(pkgdatadir)/examples/messaging
+
+MAKELDFLAGS=$(CLIENTFLAGS)
+include $(top_srcdir)/examples/makedist.mk
+
+noinst_PROGRAMS=queue_sender queue_listener queue_receiver topic_sender topic_listener topic_receiver client server map_sender map_receiver
+
+queue_sender_SOURCES=queue_sender.cpp
+queue_sender_LDADD=$(CLIENT_LIB)
+
+queue_listener_SOURCES=queue_listener.cpp
+queue_listener_LDADD=$(CLIENT_LIB)
+
+queue_receiver_SOURCES=queue_receiver.cpp
+queue_receiver_LDADD=$(CLIENT_LIB)
+
+topic_sender_SOURCES=topic_sender.cpp
+topic_sender_LDADD=$(CLIENT_LIB)
+
+topic_listener_SOURCES=topic_listener.cpp
+topic_listener_LDADD=$(CLIENT_LIB)
+
+topic_receiver_SOURCES=topic_receiver.cpp
+topic_receiver_LDADD=$(CLIENT_LIB)
+
+client_SOURCES=client.cpp
+client_LDADD=$(CLIENT_LIB)
+
+server_SOURCES=server.cpp
+server_LDADD=$(CLIENT_LIB)
+
+map_sender_SOURCES=map_sender.cpp
+map_sender_LDADD=$(CLIENT_LIB)
+
+map_receiver_SOURCES=map_receiver.cpp
+map_receiver_LDADD=$(CLIENT_LIB)

Added: qpid/trunk/qpid/cpp/examples/messaging/Makefile.in
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/messaging/Makefile.in?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/examples/messaging/Makefile.in (added)
+++ qpid/trunk/qpid/cpp/examples/messaging/Makefile.in Tue Aug 25 17:57:34 2009
@@ -0,0 +1,657 @@
+# Makefile.in generated by automake 1.11 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/examples/makedist.mk
+noinst_PROGRAMS = queue_sender$(EXEEXT) queue_listener$(EXEEXT) \
+	queue_receiver$(EXEEXT) topic_sender$(EXEEXT) \
+	topic_listener$(EXEEXT) topic_receiver$(EXEEXT) \
+	client$(EXEEXT) server$(EXEEXT) map_sender$(EXEEXT) \
+	map_receiver$(EXEEXT)
+subdir = examples/messaging
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_pkg_swig.m4 \
+	$(top_srcdir)/m4/clock_time.m4 \
+	$(top_srcdir)/m4/compiler-flags.m4 \
+	$(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/python.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_client_OBJECTS = client.$(OBJEXT)
+client_OBJECTS = $(am_client_OBJECTS)
+client_DEPENDENCIES = $(CLIENT_LIB)
+am_map_receiver_OBJECTS = map_receiver.$(OBJEXT)
+map_receiver_OBJECTS = $(am_map_receiver_OBJECTS)
+map_receiver_DEPENDENCIES = $(CLIENT_LIB)
+am_map_sender_OBJECTS = map_sender.$(OBJEXT)
+map_sender_OBJECTS = $(am_map_sender_OBJECTS)
+map_sender_DEPENDENCIES = $(CLIENT_LIB)
+am_queue_listener_OBJECTS = queue_listener.$(OBJEXT)
+queue_listener_OBJECTS = $(am_queue_listener_OBJECTS)
+queue_listener_DEPENDENCIES = $(CLIENT_LIB)
+am_queue_receiver_OBJECTS = queue_receiver.$(OBJEXT)
+queue_receiver_OBJECTS = $(am_queue_receiver_OBJECTS)
+queue_receiver_DEPENDENCIES = $(CLIENT_LIB)
+am_queue_sender_OBJECTS = queue_sender.$(OBJEXT)
+queue_sender_OBJECTS = $(am_queue_sender_OBJECTS)
+queue_sender_DEPENDENCIES = $(CLIENT_LIB)
+am_server_OBJECTS = server.$(OBJEXT)
+server_OBJECTS = $(am_server_OBJECTS)
+server_DEPENDENCIES = $(CLIENT_LIB)
+am_topic_listener_OBJECTS = topic_listener.$(OBJEXT)
+topic_listener_OBJECTS = $(am_topic_listener_OBJECTS)
+topic_listener_DEPENDENCIES = $(CLIENT_LIB)
+am_topic_receiver_OBJECTS = topic_receiver.$(OBJEXT)
+topic_receiver_OBJECTS = $(am_topic_receiver_OBJECTS)
+topic_receiver_DEPENDENCIES = $(CLIENT_LIB)
+am_topic_sender_OBJECTS = topic_sender.$(OBJEXT)
+topic_sender_OBJECTS = $(am_topic_sender_OBJECTS)
+topic_sender_DEPENDENCIES = $(CLIENT_LIB)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(client_SOURCES) $(map_receiver_SOURCES) \
+	$(map_sender_SOURCES) $(queue_listener_SOURCES) \
+	$(queue_receiver_SOURCES) $(queue_sender_SOURCES) \
+	$(server_SOURCES) $(topic_listener_SOURCES) \
+	$(topic_receiver_SOURCES) $(topic_sender_SOURCES)
+DIST_SOURCES = $(client_SOURCES) $(map_receiver_SOURCES) \
+	$(map_sender_SOURCES) $(queue_listener_SOURCES) \
+	$(queue_receiver_SOURCES) $(queue_sender_SOURCES) \
+	$(server_SOURCES) $(topic_listener_SOURCES) \
+	$(topic_receiver_SOURCES) $(topic_sender_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMQP_FINAL_XML = @AMQP_FINAL_XML@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+COMPILER_FLAGS = @COMPILER_FLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOWNLOAD_URL = @DOWNLOAD_URL@
+DOXYGEN = @DOXYGEN@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HELP2MAN = @HELP2MAN@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIBTOOL_VERSION_INFO_ARG = @LIBTOOL_VERSION_INFO_ARG@
+LIB_ACL = @LIB_ACL@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_DLOPEN = @LIB_DLOPEN@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NSPR_CONFIG = @NSPR_CONFIG@
+NSS_CONFIG = @NSS_CONFIG@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_INC = @PYTHON_INC@
+PYTHON_LIB = @PYTHON_LIB@
+PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+RPMLINT = @RPMLINT@
+RUBY = @RUBY@
+RUBY_DLEXT = @RUBY_DLEXT@
+RUBY_INC = @RUBY_INC@
+RUBY_INC_ARCH = @RUBY_INC_ARCH@
+RUBY_LIB = @RUBY_LIB@
+RUBY_LIBS = @RUBY_LIBS@
+RUBY_LIB_ARCH = @RUBY_LIB_ARCH@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOCKLIBS = @SOCKLIBS@
+SSL_CFLAGS = @SSL_CFLAGS@
+SSL_LDFLAGS = @SSL_LDFLAGS@
+STRIP = @STRIP@
+SUNCC_RUNTIME_LIBS = @SUNCC_RUNTIME_LIBS@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+URL = @URL@
+VALGRIND = @VALGRIND@
+VERSION = @VERSION@
+WARNING_CFLAGS = @WARNING_CFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+# 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.
+#
+examplesdir = $(pkgdatadir)/examples/messaging
+MAKELDFLAGS = $(CLIENTFLAGS)
+
+# Settings to build the examples in automake
+AM_CXXFLAGS = $(WARNING_CFLAGS)
+INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include
+CLIENT_LIB = $(top_builddir)/src/libqpidclient.la
+CONSOLE_LIB = $(top_builddir)/src/libqmfconsole.la
+CLIENTFLAGS = -lqpidclient
+CONSOLEFLAGS = -lqmfconsole
+
+# Generate a simple non-automake Makefile for distribution.
+MAKEDIST = .libs/Makefile
+queue_sender_SOURCES = queue_sender.cpp
+queue_sender_LDADD = $(CLIENT_LIB)
+queue_listener_SOURCES = queue_listener.cpp
+queue_listener_LDADD = $(CLIENT_LIB)
+queue_receiver_SOURCES = queue_receiver.cpp
+queue_receiver_LDADD = $(CLIENT_LIB)
+topic_sender_SOURCES = topic_sender.cpp
+topic_sender_LDADD = $(CLIENT_LIB)
+topic_listener_SOURCES = topic_listener.cpp
+topic_listener_LDADD = $(CLIENT_LIB)
+topic_receiver_SOURCES = topic_receiver.cpp
+topic_receiver_LDADD = $(CLIENT_LIB)
+client_SOURCES = client.cpp
+client_LDADD = $(CLIENT_LIB)
+server_SOURCES = server.cpp
+server_LDADD = $(CLIENT_LIB)
+map_sender_SOURCES = map_sender.cpp
+map_sender_LDADD = $(CLIENT_LIB)
+map_receiver_SOURCES = map_receiver.cpp
+map_receiver_LDADD = $(CLIENT_LIB)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/examples/makedist.mk $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/messaging/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu examples/messaging/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+client$(EXEEXT): $(client_OBJECTS) $(client_DEPENDENCIES) 
+	@rm -f client$(EXEEXT)
+	$(CXXLINK) $(client_OBJECTS) $(client_LDADD) $(LIBS)
+map_receiver$(EXEEXT): $(map_receiver_OBJECTS) $(map_receiver_DEPENDENCIES) 
+	@rm -f map_receiver$(EXEEXT)
+	$(CXXLINK) $(map_receiver_OBJECTS) $(map_receiver_LDADD) $(LIBS)
+map_sender$(EXEEXT): $(map_sender_OBJECTS) $(map_sender_DEPENDENCIES) 
+	@rm -f map_sender$(EXEEXT)
+	$(CXXLINK) $(map_sender_OBJECTS) $(map_sender_LDADD) $(LIBS)
+queue_listener$(EXEEXT): $(queue_listener_OBJECTS) $(queue_listener_DEPENDENCIES) 
+	@rm -f queue_listener$(EXEEXT)
+	$(CXXLINK) $(queue_listener_OBJECTS) $(queue_listener_LDADD) $(LIBS)
+queue_receiver$(EXEEXT): $(queue_receiver_OBJECTS) $(queue_receiver_DEPENDENCIES) 
+	@rm -f queue_receiver$(EXEEXT)
+	$(CXXLINK) $(queue_receiver_OBJECTS) $(queue_receiver_LDADD) $(LIBS)
+queue_sender$(EXEEXT): $(queue_sender_OBJECTS) $(queue_sender_DEPENDENCIES) 
+	@rm -f queue_sender$(EXEEXT)
+	$(CXXLINK) $(queue_sender_OBJECTS) $(queue_sender_LDADD) $(LIBS)
+server$(EXEEXT): $(server_OBJECTS) $(server_DEPENDENCIES) 
+	@rm -f server$(EXEEXT)
+	$(CXXLINK) $(server_OBJECTS) $(server_LDADD) $(LIBS)
+topic_listener$(EXEEXT): $(topic_listener_OBJECTS) $(topic_listener_DEPENDENCIES) 
+	@rm -f topic_listener$(EXEEXT)
+	$(CXXLINK) $(topic_listener_OBJECTS) $(topic_listener_LDADD) $(LIBS)
+topic_receiver$(EXEEXT): $(topic_receiver_OBJECTS) $(topic_receiver_DEPENDENCIES) 
+	@rm -f topic_receiver$(EXEEXT)
+	$(CXXLINK) $(topic_receiver_OBJECTS) $(topic_receiver_LDADD) $(LIBS)
+topic_sender$(EXEEXT): $(topic_sender_OBJECTS) $(topic_sender_DEPENDENCIES) 
+	@rm -f topic_sender$(EXEEXT)
+	$(CXXLINK) $(topic_sender_OBJECTS) $(topic_sender_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/map_receiver.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/map_sender.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queue_listener.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queue_receiver.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queue_sender.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/server.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/topic_listener.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/topic_receiver.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/topic_sender.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@	depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCXX_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@	depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCXX_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@	depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCXX_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am
+
+
+$(MAKEDIST): Makefile
+	mkdir -p .libs
+	@(echo CXX=$(CXX)                   ; \
+	echo CXXFLAGS=$(CXXFLAGS)           ; \
+	echo LDFLAGS=$(MAKELDFLAGS)         ; \
+	echo                                ; \
+	echo all: $(noinst_PROGRAMS)        ; \
+	echo                                ; \
+	echo clean:                         ; \
+	echo "	rm -f $(noinst_PROGRAMS)"   ; \
+	) > $(MAKEDIST)
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

Added: qpid/trunk/qpid/cpp/examples/messaging/client.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/messaging/client.cpp?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/examples/messaging/client.cpp (added)
+++ qpid/trunk/qpid/cpp/examples/messaging/client.cpp Tue Aug 25 17:57:34 2009
@@ -0,0 +1,76 @@
+/*
+ *
+ * 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/messaging/Address.h>
+#include <qpid/messaging/Connection.h>
+#include <qpid/messaging/Message.h>
+#include <qpid/messaging/Receiver.h>
+#include <qpid/messaging/Sender.h>
+#include <qpid/messaging/Session.h>
+
+#include <cstdlib>
+#include <iostream>
+
+#include <sstream>
+
+using namespace qpid::messaging;
+
+using std::stringstream;
+using std::string;
+
+int main(int argc, char** argv) {
+    const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
+
+    try {
+        Connection connection = Connection::open(url);
+        Session session = connection.newSession();
+
+        Sender sender = session.createSender("service_queue");
+
+        //create temp queue & receiver...
+        Address responseQueue = session.createTempQueue();
+        Receiver receiver = session.createReceiver(responseQueue);
+
+	// Now send some messages ...
+	string s[] = {
+            "Twas brillig, and the slithy toves",
+            "Did gire and gymble in the wabe.",
+            "All mimsy were the borogroves,",
+            "And the mome raths outgrabe."
+        };
+
+    	Message request;
+        request.setReplyTo(responseQueue);
+	for (int i=0; i<4; i++) {
+            request.setContent(s[i]);
+            sender.send(request);
+            Message response = receiver.fetch();
+            std::cout << request.getContent().asString() << " -> " << response.getContent().asString() << std::endl;
+	}
+        connection.close();
+        return 0;
+    } catch(const std::exception& error) {
+        std::cout << error.what() << std::endl;
+    }
+    return 1;
+}
+
+

Added: qpid/trunk/qpid/cpp/examples/messaging/map_receiver.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/messaging/map_receiver.cpp?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/examples/messaging/map_receiver.cpp (added)
+++ qpid/trunk/qpid/cpp/examples/messaging/map_receiver.cpp Tue Aug 25 17:57:34 2009
@@ -0,0 +1,54 @@
+/*
+ *
+ * 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/messaging/Connection.h>
+#include <qpid/messaging/Message.h>
+#include <qpid/messaging/Receiver.h>
+#include <qpid/messaging/Session.h>
+
+#include <cstdlib>
+#include <iostream>
+
+#include <sstream>
+
+using namespace qpid::messaging;
+
+using std::stringstream;
+using std::string;
+
+int main(int argc, char** argv) {
+    const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
+
+    try {
+        Connection connection = Connection::open(url);
+        Session session = connection.newSession();
+        Receiver receiver = session.createReceiver("message_queue");
+        Message message = receiver.fetch();
+        std::cout << message.getContent().asMap() << std::endl;
+        session.acknowledge();
+        receiver.cancel();
+        connection.close();
+        return 0;
+    } catch(const std::exception& error) {
+        std::cout << error.what() << std::endl;
+    }
+    return 1;   
+}

Added: qpid/trunk/qpid/cpp/examples/messaging/map_sender.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/messaging/map_sender.cpp?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/examples/messaging/map_sender.cpp (added)
+++ qpid/trunk/qpid/cpp/examples/messaging/map_sender.cpp Tue Aug 25 17:57:34 2009
@@ -0,0 +1,66 @@
+/*
+ *
+ * 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/messaging/Connection.h>
+#include <qpid/messaging/Message.h>
+#include <qpid/messaging/Sender.h>
+#include <qpid/messaging/Session.h>
+
+#include <cstdlib>
+#include <iostream>
+
+#include <sstream>
+
+using namespace qpid::messaging;
+
+using std::stringstream;
+using std::string;
+
+int main(int argc, char** argv) {
+    const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
+
+    try {
+        Connection connection = Connection::open(url);
+        Session session = connection.newSession();
+        Sender sender = session.createSender("message_queue");
+
+        Message message;
+        message.getContent()["id"] = 987654321;
+        message.getContent()["name"] = "Widget";
+        message.getContent()["price"] = 0.99;//bad use of floating point number, just an example!
+        Variant::List colours;
+        colours.push_back(Variant("red"));
+        colours.push_back(Variant("green"));
+        colours.push_back(Variant("white"));
+        message.getContent()["colours"] = colours;
+	
+        sender.send(message);
+        session.sync();
+
+        connection.close();
+        return 0;
+    } catch(const std::exception& error) {
+        std::cout << error.what() << std::endl;
+    }
+    return 1;
+}
+
+

Added: qpid/trunk/qpid/cpp/examples/messaging/queue_listener.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/messaging/queue_listener.cpp?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/examples/messaging/queue_listener.cpp (added)
+++ qpid/trunk/qpid/cpp/examples/messaging/queue_listener.cpp Tue Aug 25 17:57:34 2009
@@ -0,0 +1,82 @@
+/*
+ *
+ * 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/messaging/Connection.h>
+#include <qpid/messaging/Session.h>
+#include <qpid/messaging/Message.h>
+#include <qpid/messaging/MessageListener.h>
+#include <qpid/messaging/Receiver.h>
+
+#include <cstdlib>
+#include <iostream>
+
+using namespace qpid::messaging;
+      
+class Listener : public MessageListener
+{
+  public:
+    Listener(const Receiver& receiver);
+    void received(Message& message);
+    bool isFinished();
+  private:
+    Receiver receiver;
+    bool finished;
+};
+
+Listener::Listener(const Receiver& r) : receiver(r), finished(false) {}
+
+bool Listener::isFinished() { return finished; }
+
+void Listener::received(Message& message) 
+{
+    std::cout << "Message: " << message.getContent().asString() << std::endl;
+    if (message.getContent().asString() == "That's all, folks!") {
+        std::cout << "Shutting down listener" << std::endl;
+        receiver.cancel();
+        finished = true;
+    }
+}
+
+int main(int argc, char** argv) {
+    const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
+
+    try {
+        Connection connection = Connection::open(url);
+        Session session = connection.newSession();
+
+        Receiver receiver = session.createReceiver("message_queue");
+        Listener listener(receiver);
+        receiver.setListener(&listener);
+        receiver.setCapacity(1);
+        receiver.start();
+        while (session.dispatch()) {
+            session.acknowledge();
+            if (listener.isFinished()) break;
+        }
+        connection.close();
+        return 0;
+    } catch(const std::exception& error) {
+        std::cout << error.what() << std::endl;
+    }
+    return 1;   
+}
+
+

Added: qpid/trunk/qpid/cpp/examples/messaging/queue_receiver.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/messaging/queue_receiver.cpp?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/examples/messaging/queue_receiver.cpp (added)
+++ qpid/trunk/qpid/cpp/examples/messaging/queue_receiver.cpp Tue Aug 25 17:57:34 2009
@@ -0,0 +1,65 @@
+/*
+ *
+ * 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/messaging/Connection.h>
+#include <qpid/messaging/Message.h>
+#include <qpid/messaging/Receiver.h>
+#include <qpid/messaging/Session.h>
+
+#include <cstdlib>
+#include <iostream>
+
+#include <sstream>
+
+using namespace qpid::messaging;
+
+using std::stringstream;
+using std::string;
+
+int main(int argc, char** argv) {
+    const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
+
+    try {
+        Variant::Map options;
+        if (argc>2) parseOptionString(argv[2], options);
+        Connection connection = Connection::open(url, options);
+        Session session = connection.newSession();
+        Receiver receiver = session.createReceiver("message_queue");
+        while (true) {
+            Message message = receiver.fetch();
+            std::cout << "Message: " << message.getContent() << std::endl;
+            session.acknowledge();
+            if (message.getContent().asString() == "That's all, folks!") {
+                std::cout << "Cancelling receiver" << std::endl;
+                receiver.cancel();
+                break;
+            }
+        }
+
+        connection.close();
+        return 0;
+    } catch(const std::exception& error) {
+        std::cout << error.what() << std::endl;
+    }
+    return 1;   
+}
+
+

Added: qpid/trunk/qpid/cpp/examples/messaging/queue_sender.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/messaging/queue_sender.cpp?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/examples/messaging/queue_sender.cpp (added)
+++ qpid/trunk/qpid/cpp/examples/messaging/queue_sender.cpp Tue Aug 25 17:57:34 2009
@@ -0,0 +1,65 @@
+/*
+ *
+ * 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/messaging/Connection.h>
+#include <qpid/messaging/Message.h>
+#include <qpid/messaging/Sender.h>
+#include <qpid/messaging/Session.h>
+
+#include <cstdlib>
+#include <iostream>
+
+#include <sstream>
+
+using namespace qpid::messaging;
+
+using std::stringstream;
+using std::string;
+
+int main(int argc, char** argv) {
+    const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
+    int count = argc>2 ? atoi(argv[2]) : 10;
+
+    try {
+        Connection connection = Connection::open(url);
+        Session session = connection.newSession();
+        Sender sender = session.createSender("message_queue");
+
+	// Now send some messages ...
+	for (int i=0; i<count; i++) {
+            Message message;
+            message.getContent() << "Message " << i;
+            sender.send(message);
+	}
+	
+	// And send a final message to indicate termination.
+    	Message message("That's all, folks!");
+        sender.send(message);
+        session.sync();
+        connection.close();
+        return 0;
+    } catch(const std::exception& error) {
+        std::cout << error.what() << std::endl;
+    }
+    return 1;
+}
+
+

Added: qpid/trunk/qpid/cpp/examples/messaging/server.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/messaging/server.cpp?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/examples/messaging/server.cpp (added)
+++ qpid/trunk/qpid/cpp/examples/messaging/server.cpp Tue Aug 25 17:57:34 2009
@@ -0,0 +1,78 @@
+/*
+ *
+ * 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/messaging/Address.h>
+#include <qpid/messaging/Connection.h>
+#include <qpid/messaging/Message.h>
+#include <qpid/messaging/Receiver.h>
+#include <qpid/messaging/Sender.h>
+#include <qpid/messaging/Session.h>
+#include <qpid/messaging/Variant.h>
+
+#include <algorithm>
+#include <cstdlib>
+#include <iostream>
+#include <memory>
+#include <sstream>
+
+using namespace qpid::messaging;
+
+using std::stringstream;
+using std::string;
+
+int main(int argc, char** argv) {
+    const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
+
+    try {
+        Connection connection = Connection::open(url);
+        Session session = connection.newSession();
+        VariantMap options;
+        options["auto_acknowledge"] = 0;
+        Receiver receiver = session.createReceiver("service_queue", options);
+
+        while (true) {
+            Message request = receiver.fetch();
+            const Address& address = request.getReplyTo();
+            if (address) {
+                Sender sender = session.createSender(address);
+                std::string s = request.getContent().asString();
+                std::transform(s.begin(), s.end(), s.begin(), toupper);
+                Message response(s);
+                sender.send(response);
+                std::cout << "Processed request: " 
+                          << request.getContent().asString() 
+                          << " -> " 
+                          << response.getContent().asString() << std::endl;
+                session.acknowledge();
+            } else {
+                std::cerr << "Error: no reply address specified for request: " << request.getContent().asString() << std::endl;
+                session.reject(request);
+            }
+        }
+        connection.close();
+        return 0;
+    } catch(const std::exception& error) {
+        std::cout << error.what() << std::endl;
+    }
+    return 1;
+}
+
+

Added: qpid/trunk/qpid/cpp/examples/messaging/topic_listener.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/messaging/topic_listener.cpp?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/examples/messaging/topic_listener.cpp (added)
+++ qpid/trunk/qpid/cpp/examples/messaging/topic_listener.cpp Tue Aug 25 17:57:34 2009
@@ -0,0 +1,82 @@
+/*
+ *
+ * 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/messaging/Connection.h>
+#include <qpid/messaging/Filter.h>
+#include <qpid/messaging/Message.h>
+#include <qpid/messaging/MessageListener.h>
+#include <qpid/messaging/Session.h>
+#include <qpid/messaging/Receiver.h>
+
+#include <cstdlib>
+#include <iostream>
+
+using namespace qpid::messaging;
+      
+class Listener : public MessageListener
+{
+  public:
+    Listener(const Receiver& receiver);
+    void received(Message& message);
+    bool isFinished();
+  private:
+    Receiver receiver;
+    bool finished;
+};
+
+Listener::Listener(const Receiver& r) : receiver(r), finished(false) {}
+
+bool Listener::isFinished() { return finished; }
+
+void Listener::received(Message& message) 
+{
+    std::cout << "Message: " << message.getContent().asString() << std::endl;
+    if (message.getContent().asString() == "That's all, folks!") {
+        std::cout << "Shutting down listener" << std::endl;
+        receiver.cancel();
+        finished = true;
+    }
+}
+
+int main(int argc, char** argv) {
+    const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
+    const char* pattern = argc>2 ? argv[2] : "#.#";
+
+    try {
+        Connection connection = Connection::open(url);
+        Session session = connection.newSession();
+
+        Filter filter(Filter::WILDCARD, pattern, "control");
+        Receiver receiver = session.createReceiver("news_service", filter);
+        Listener listener(receiver);        
+        receiver.setListener(&listener);
+        receiver.setCapacity(1);
+        receiver.start();
+        while (session.dispatch() && !listener.isFinished());
+        connection.close();
+        return 0;
+    } catch(const std::exception& error) {
+        std::cout << error.what() << std::endl;
+    }
+    return 1;   
+}
+
+

Added: qpid/trunk/qpid/cpp/examples/messaging/topic_receiver.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/messaging/topic_receiver.cpp?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/examples/messaging/topic_receiver.cpp (added)
+++ qpid/trunk/qpid/cpp/examples/messaging/topic_receiver.cpp Tue Aug 25 17:57:34 2009
@@ -0,0 +1,66 @@
+/*
+ *
+ * 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/messaging/Address.h>
+#include <qpid/messaging/Connection.h>
+#include <qpid/messaging/Filter.h>
+#include <qpid/messaging/Message.h>
+#include <qpid/messaging/Receiver.h>
+#include <qpid/messaging/Session.h>
+
+#include <cstdlib>
+#include <iostream>
+
+#include <sstream>
+
+using namespace qpid::messaging;
+
+using std::stringstream;
+using std::string;
+
+int main(int argc, char** argv) {
+    const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
+    const char* pattern = argc>2 ? argv[2] : "#.#";
+
+    try {
+        Connection connection = Connection::open(url);
+        Session session = connection.newSession();
+        Filter filter(Filter::WILDCARD, pattern, "control");
+        Receiver receiver = session.createReceiver(Address("news_service", "topic"), filter);
+        while (true) {
+            Message message = receiver.fetch();
+            std::cout << "Message: " << message.getContent().asString() << std::endl;
+            if (message.getContent().asString() == "That's all, folks!") {
+                std::cout << "Cancelling receiver" << std::endl;
+                receiver.cancel();
+                break;
+            }
+        }
+
+        connection.close();
+        return 0;
+    } catch(const std::exception& error) {
+        std::cout << error.what() << std::endl;
+    }
+    return 1;   
+}
+
+

Added: qpid/trunk/qpid/cpp/examples/messaging/topic_sender.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/messaging/topic_sender.cpp?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/examples/messaging/topic_sender.cpp (added)
+++ qpid/trunk/qpid/cpp/examples/messaging/topic_sender.cpp Tue Aug 25 17:57:34 2009
@@ -0,0 +1,78 @@
+/*
+ *
+ * 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/messaging/Connection.h>
+#include <qpid/messaging/Message.h>
+#include <qpid/messaging/Sender.h>
+#include <qpid/messaging/Session.h>
+
+#include <cstdlib>
+#include <iostream>
+
+#include <sstream>
+
+using namespace qpid::messaging;
+
+using std::stringstream;
+using std::string;
+
+void sendMessages(Sender& sender, int count, const std::string& subject, const std::string& text)
+{
+    Message message;
+    message.setSubject(subject);
+    for (int i=0; i<count; i++) {
+        stringstream message_data;
+        message_data << text << i;
+        
+        message.setContent(message_data.str());
+        sender.send(message);
+    }    
+}
+
+int main(int argc, char** argv) {
+    const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
+    int count = argc>2 ? atoi(argv[2]) : 10;
+
+    try {
+        Connection connection = Connection::open(url);
+        Session session = connection.newSession();
+        Sender sender = session.createSender("news_service");
+
+	// Now send some messages to each topic...
+        sendMessages(sender, count, "usa.news", "news about the usa");
+        sendMessages(sender, count, "usa.weather", "weather report for the usa");
+        sendMessages(sender, count, "europe.news", "news about europe");
+        sendMessages(sender, count, "europe.weather", "weather report for europe");
+	
+	// And send a final message to indicate termination.
+        Message message("That's all, folks!");
+        message.setSubject("control");
+        sender.send(message);
+        session.sync();
+        connection.close();
+        return 0;
+    } catch(const std::exception& error) {
+        std::cout << error.what() << std::endl;
+    }
+    return 1;
+}
+
+

Added: qpid/trunk/qpid/cpp/include/qpid/client/amqp0_10/Codecs.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qpid/client/amqp0_10/Codecs.h?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/include/qpid/client/amqp0_10/Codecs.h (added)
+++ qpid/trunk/qpid/cpp/include/qpid/client/amqp0_10/Codecs.h Tue Aug 25 17:57:34 2009
@@ -0,0 +1,61 @@
+#ifndef QPID_CLIENT_AMQP0_10_CODECS_H
+#define QPID_CLIENT_AMQP0_10_CODECS_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/messaging/Codec.h"
+
+namespace qpid {
+namespace client {
+namespace amqp0_10 {
+
+
+/**
+ * Codec for encoding/decoding a map of Variants using the AMQP 0-10
+ * map encoding.
+ */
+class MapCodec : public qpid::messaging::Codec
+{
+  public:
+    void encode(const qpid::messaging::Variant&, std::string&);
+    void decode(const std::string&, qpid::messaging::Variant&);
+
+    static const std::string contentType;
+  private:
+};
+
+/**
+ * Codec for encoding/decoding a list of Variants using the AMQP 0-10
+ * list encoding.
+ */
+class ListCodec : public qpid::messaging::Codec
+{
+  public:
+    void encode(const qpid::messaging::Variant&, std::string&);
+    void decode(const std::string&, qpid::messaging::Variant&);
+
+    static const std::string contentType;
+  private:
+};
+
+}}} // namespace qpid::client::amqp0_10
+
+#endif  /*!QPID_CLIENT_AMQP0_10_CODECS_H*/

Added: qpid/trunk/qpid/cpp/include/qpid/messaging/Address.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qpid/messaging/Address.h?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/include/qpid/messaging/Address.h (added)
+++ qpid/trunk/qpid/cpp/include/qpid/messaging/Address.h Tue Aug 25 17:57:34 2009
@@ -0,0 +1,57 @@
+#ifndef QPID_MESSAGING_ADDRESS_H
+#define QPID_MESSAGING_ADDRESS_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 <string>
+#include "qpid/client/ClientImportExport.h"
+
+namespace qpid {
+namespace client {
+}
+
+namespace messaging {
+
+/**
+ * Represents an address to which messages can be sent and from which
+ * messages can be received. Often a simple name is sufficient for
+ * this. However this struct allows the type of address to be
+ * specified allowing more sophisticated treatment if necessary.
+ */
+struct Address
+{
+    std::string value;
+    std::string type;
+
+    QPID_CLIENT_EXTERN Address();
+    QPID_CLIENT_EXTERN Address(const std::string& address);
+    QPID_CLIENT_EXTERN Address(const std::string& address, const std::string& type);
+    QPID_CLIENT_EXTERN operator const std::string&() const;
+    QPID_CLIENT_EXTERN const std::string& toStr() const;
+    QPID_CLIENT_EXTERN operator bool() const;
+    QPID_CLIENT_EXTERN bool operator !() const;
+};
+
+QPID_CLIENT_EXTERN std::ostream& operator<<(std::ostream& out, const Address& address);
+
+}} // namespace qpid::messaging
+
+#endif  /*!QPID_MESSAGING_ADDRESS_H*/

Added: qpid/trunk/qpid/cpp/include/qpid/messaging/Codec.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qpid/messaging/Codec.h?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/include/qpid/messaging/Codec.h (added)
+++ qpid/trunk/qpid/cpp/include/qpid/messaging/Codec.h Tue Aug 25 17:57:34 2009
@@ -0,0 +1,44 @@
+#ifndef QPID_MESSAGING_CODEC_H
+#define QPID_MESSAGING_CODEC_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 <string>
+#include "qpid/client/ClientImportExport.h"
+
+namespace qpid {
+namespace messaging {
+
+class Variant;
+/**
+ *
+ */
+class Codec
+{
+  public:
+    QPID_CLIENT_EXTERN virtual ~Codec() {}
+    virtual void encode(const Variant&, std::string&) = 0;
+    virtual void decode(const std::string&, Variant&) = 0;
+  private:
+};
+}} // namespace qpid::messaging
+
+#endif  /*!QPID_MESSAGING_CODEC_H*/

Added: qpid/trunk/qpid/cpp/include/qpid/messaging/Connection.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qpid/messaging/Connection.h?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/include/qpid/messaging/Connection.h (added)
+++ qpid/trunk/qpid/cpp/include/qpid/messaging/Connection.h Tue Aug 25 17:57:34 2009
@@ -0,0 +1,67 @@
+#ifndef QPID_MESSAGING_CONNECTION_H
+#define QPID_MESSAGING_CONNECTION_H
+
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+#include <string>
+#include "qpid/client/ClientImportExport.h"
+#include "qpid/client/Handle.h"
+#include "qpid/messaging/Variant.h"
+
+namespace qpid {
+namespace client {
+
+template <class> class PrivateImplRef;
+
+}
+
+namespace messaging {
+
+class ConnectionImpl;
+class Session;
+
+class Connection : public qpid::client::Handle<ConnectionImpl>
+{
+  public:
+    static Connection open(const std::string& url, const Variant::Map& options = Variant::Map());
+
+    QPID_CLIENT_EXTERN Connection(ConnectionImpl* impl = 0);
+    QPID_CLIENT_EXTERN Connection(const Connection&);
+    QPID_CLIENT_EXTERN ~Connection();
+    QPID_CLIENT_EXTERN Connection& operator=(const Connection&);
+    QPID_CLIENT_EXTERN void close();
+    QPID_CLIENT_EXTERN Session newSession();
+  private:
+  friend class qpid::client::PrivateImplRef<Connection>;
+
+};
+
+struct InvalidOptionString : public qpid::Exception 
+{
+    InvalidOptionString(const std::string& msg);
+};
+
+QPID_CLIENT_EXTERN void parseOptionString(const std::string&, Variant::Map&);
+QPID_CLIENT_EXTERN Variant::Map parseOptionString(const std::string&);
+
+}} // namespace qpid::messaging
+
+#endif  /*!QPID_MESSAGING_CONNECTION_H*/

Added: qpid/trunk/qpid/cpp/include/qpid/messaging/Filter.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qpid/messaging/Filter.h?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/include/qpid/messaging/Filter.h (added)
+++ qpid/trunk/qpid/cpp/include/qpid/messaging/Filter.h Tue Aug 25 17:57:34 2009
@@ -0,0 +1,48 @@
+#ifndef QPID_MESSAGING_FILTER_H
+#define QPID_MESSAGING_FILTER_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 <string>
+#include <vector>
+#include "qpid/client/ClientImportExport.h"
+
+namespace qpid {
+namespace client {
+}
+
+namespace messaging {
+
+struct Filter
+{
+    std::string type;
+    std::vector<std::string> patterns;
+
+    QPID_CLIENT_EXTERN Filter(std::string type, std::string pattern);
+    QPID_CLIENT_EXTERN Filter(std::string type, std::string pattern1, std::string pattern2);
+
+    static QPID_CLIENT_EXTERN const std::string WILDCARD;
+    static QPID_CLIENT_EXTERN const std::string EXACT_MATCH;
+};
+
+}} // namespace qpid::messaging
+
+#endif  /*!QPID_MESSAGING_FILTER_H*/

Added: qpid/trunk/qpid/cpp/include/qpid/messaging/Message.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qpid/messaging/Message.h?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/include/qpid/messaging/Message.h (added)
+++ qpid/trunk/qpid/cpp/include/qpid/messaging/Message.h Tue Aug 25 17:57:34 2009
@@ -0,0 +1,90 @@
+#ifndef QPID_MESSAGING_MESSAGE_H
+#define QPID_MESSAGING_MESSAGE_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 <string>
+#include "qpid/messaging/Variant.h"
+#include "qpid/messaging/MessageContent.h"
+#include "qpid/client/ClientImportExport.h"
+
+namespace qpid {
+namespace client {
+}
+
+namespace messaging {
+
+class Address;
+class Codec;
+class MessageImpl;
+
+/**
+ * Representation of a message.
+ */
+class Message
+{
+  public:
+    QPID_CLIENT_EXTERN Message(const std::string& bytes = std::string());
+    QPID_CLIENT_EXTERN Message(const char*, size_t);
+    QPID_CLIENT_EXTERN Message(const Message&);
+    QPID_CLIENT_EXTERN ~Message();
+
+    QPID_CLIENT_EXTERN Message& operator=(const Message&);
+
+    QPID_CLIENT_EXTERN void setReplyTo(const Address&);
+    QPID_CLIENT_EXTERN const Address& getReplyTo() const;
+
+    QPID_CLIENT_EXTERN void setSubject(const std::string&);
+    QPID_CLIENT_EXTERN const std::string& getSubject() const;
+
+    QPID_CLIENT_EXTERN void setContentType(const std::string&);
+    QPID_CLIENT_EXTERN const std::string& getContentType() const;
+
+    QPID_CLIENT_EXTERN const VariantMap& getHeaders() const;
+    QPID_CLIENT_EXTERN VariantMap& getHeaders();
+
+    QPID_CLIENT_EXTERN const std::string& getBytes() const;
+    QPID_CLIENT_EXTERN std::string& getBytes();
+    QPID_CLIENT_EXTERN void setBytes(const std::string&);
+    QPID_CLIENT_EXTERN void setBytes(const char* chars, size_t count);
+    QPID_CLIENT_EXTERN const char* getRawContent() const;
+    QPID_CLIENT_EXTERN size_t getContentSize() const;
+
+    
+    QPID_CLIENT_EXTERN MessageContent& getContent();
+    QPID_CLIENT_EXTERN const MessageContent& getContent() const;
+    QPID_CLIENT_EXTERN void setContent(const std::string& s);
+    QPID_CLIENT_EXTERN void setContent(const Variant::Map&);
+    QPID_CLIENT_EXTERN void setContent(const Variant::List&);
+    
+    QPID_CLIENT_EXTERN void encode(Codec&);
+    QPID_CLIENT_EXTERN void decode(Codec&);
+
+    //TODO: move this out of the public API
+    QPID_CLIENT_EXTERN void setInternalId(void*);
+    QPID_CLIENT_EXTERN void* getInternalId();
+  private:
+    MessageImpl* impl;
+};
+}} // namespace qpid::messaging
+
+#endif  /*!QPID_MESSAGING_MESSAGE_H*/

Added: qpid/trunk/qpid/cpp/include/qpid/messaging/MessageContent.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qpid/messaging/MessageContent.h?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/include/qpid/messaging/MessageContent.h (added)
+++ qpid/trunk/qpid/cpp/include/qpid/messaging/MessageContent.h Tue Aug 25 17:57:34 2009
@@ -0,0 +1,90 @@
+#ifndef QPID_MESSAGING_MESSAGECONTENT_H
+#define QPID_MESSAGING_MESSAGECONTENT_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/messaging/Variant.h"
+#include <string>
+#include "qpid/client/ClientImportExport.h"
+
+namespace qpid {
+namespace messaging {
+
+/**
+ *
+ */
+class MessageContent
+{
+  public:
+    QPID_CLIENT_EXTERN virtual ~MessageContent() {}
+
+    virtual const std::string& asString() const = 0;
+    virtual std::string& asString() = 0;
+
+    virtual const char* asChars() const = 0;
+    virtual size_t size() const = 0;
+
+    virtual const Variant::Map& asMap() const = 0;
+    virtual Variant::Map& asMap() = 0;
+    virtual bool isMap() const = 0;
+
+    virtual const Variant::List& asList() const = 0;
+    virtual Variant::List& asList() = 0;
+    virtual bool isList() const = 0;
+
+    virtual void clear() = 0;
+
+    virtual Variant& operator[](const std::string&) = 0;
+
+
+    virtual std::ostream& print(std::ostream& out) const = 0;
+
+
+    //operator<< for variety of types... (is this a good idea?)
+    virtual MessageContent& operator<<(const std::string&) = 0;
+    virtual MessageContent& operator<<(const char*) = 0;
+    virtual MessageContent& operator<<(bool) = 0;
+    virtual MessageContent& operator<<(int8_t) = 0;
+    virtual MessageContent& operator<<(int16_t) = 0;
+    virtual MessageContent& operator<<(int32_t) = 0;
+    virtual MessageContent& operator<<(int64_t) = 0;
+    virtual MessageContent& operator<<(uint8_t) = 0;
+    virtual MessageContent& operator<<(uint16_t) = 0;
+    virtual MessageContent& operator<<(uint32_t) = 0;
+    virtual MessageContent& operator<<(uint64_t) = 0;
+    virtual MessageContent& operator<<(double) = 0;
+    virtual MessageContent& operator<<(float) = 0;
+
+    //assignment from string, map and list
+    virtual MessageContent& operator=(const std::string&) = 0;
+    virtual MessageContent& operator=(const char*) = 0;
+    virtual MessageContent& operator=(const Variant::Map&) = 0;
+    virtual MessageContent& operator=(const Variant::List&) = 0;
+    
+  private:
+};
+
+QPID_CLIENT_EXTERN std::ostream& operator<<(std::ostream& out, const MessageContent& content);
+
+}} // namespace qpid::messaging
+
+#endif  /*!QPID_MESSAGING_MESSAGECONTENT_H*/

Added: qpid/trunk/qpid/cpp/include/qpid/messaging/MessageListener.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qpid/messaging/MessageListener.h?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/include/qpid/messaging/MessageListener.h (added)
+++ qpid/trunk/qpid/cpp/include/qpid/messaging/MessageListener.h Tue Aug 25 17:57:34 2009
@@ -0,0 +1,49 @@
+#ifndef QPID_MESSAGING_MESSAGELISTENER_H
+#define QPID_MESSAGING_MESSAGELISTENER_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/client/ClientImportExport.h"
+
+namespace qpid {
+namespace messaging {
+
+class Message;
+
+/**
+ * To use a push style interface for receiving messages, applications
+ * provide implementations of this interface and pass an implementing
+ * instance to MessageSource::subscribe().
+ *
+ * Messages arriving for that subscription will then be passed to the
+ * implementation via the received() method.
+ */
+class MessageListener
+{
+  public:
+    QPID_CLIENT_EXTERN virtual ~MessageListener() {}
+    virtual void received(Message&) = 0;
+  private:
+};
+
+}} // namespace qpid::messaging
+
+#endif  /*!QPID_MESSAGING_MESSAGELISTENER_H*/

Added: qpid/trunk/qpid/cpp/include/qpid/messaging/Receiver.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qpid/messaging/Receiver.h?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/include/qpid/messaging/Receiver.h (added)
+++ qpid/trunk/qpid/cpp/include/qpid/messaging/Receiver.h Tue Aug 25 17:57:34 2009
@@ -0,0 +1,115 @@
+#ifndef QPID_MESSAGING_RECEIVER_H
+#define QPID_MESSAGING_RECEIVER_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/Exception.h"
+#include "qpid/client/ClientImportExport.h"
+#include "qpid/client/Handle.h"
+#include "qpid/sys/Time.h"
+
+namespace qpid {
+namespace client {
+
+template <class> class PrivateImplRef;
+
+}
+
+namespace messaging {
+
+class Message;
+class MessageListener;
+class ReceiverImpl;
+
+/**
+ * A pull style interface for message retrieval.
+ */
+class Receiver : public qpid::client::Handle<ReceiverImpl>
+{
+  public:
+    struct NoMessageAvailable : qpid::Exception {};
+
+    QPID_CLIENT_EXTERN Receiver(ReceiverImpl* impl = 0);
+    QPID_CLIENT_EXTERN Receiver(const Receiver&);
+    QPID_CLIENT_EXTERN ~Receiver();
+    QPID_CLIENT_EXTERN Receiver& operator=(const Receiver&);
+    /**
+     * Retrieves a message from this receivers local queue, or waits
+     * for upto the specified timeout for a message to become
+     * available. Returns false if there is no message to give after
+     * waiting for the specified timeout.
+     */
+    QPID_CLIENT_EXTERN bool get(Message& message, qpid::sys::Duration timeout=qpid::sys::TIME_INFINITE);
+    /**
+     * Retrieves a message from this receivers local queue, or waits
+     * for upto the specified timeout for a message to become
+     * available. Throws NoMessageAvailable if there is no
+     * message to give after waiting for the specified timeout.
+     */
+    QPID_CLIENT_EXTERN Message get(qpid::sys::Duration timeout=qpid::sys::TIME_INFINITE);
+    /**
+     * Retrieves a message for this receivers subscription or waits
+     * for upto the specified timeout for one to become
+     * available. Unlike get() this method will check with the server
+     * that there is no message for the subscription this receiver is
+     * serving before returning false.
+     */
+    QPID_CLIENT_EXTERN bool fetch(Message& message, qpid::sys::Duration timeout=qpid::sys::TIME_INFINITE);
+    /**
+     * Retrieves a message for this receivers subscription or waits
+     * for upto the specified timeout for one to become
+     * available. Unlike get() this method will check with the server
+     * that there is no message for the subscription this receiver is
+     * serving before throwing an exception.
+     */
+    QPID_CLIENT_EXTERN Message fetch(qpid::sys::Duration timeout=qpid::sys::TIME_INFINITE);
+    
+    /**
+     * Enables the message flow for this receiver
+     */
+    QPID_CLIENT_EXTERN void start();
+    /**
+     * Stops the message flow for this receiver (without actually
+     * cancelling the subscription).
+     */
+    QPID_CLIENT_EXTERN void stop();
+    /**
+     * Sets the capacity for the receiver. The capacity determines how
+     * many incoming messages can be held in the receiver before being
+     * requested by a client via fetch() (or pushed to a listener).
+     */
+    QPID_CLIENT_EXTERN void setCapacity(uint32_t);
+
+    /**
+     * Cancels this receiver
+     */
+    QPID_CLIENT_EXTERN void cancel();
+
+    /**
+     * Set a message listener for receiving messages asynchronously.
+     */
+    QPID_CLIENT_EXTERN void setListener(MessageListener* listener);
+  private:
+  friend class qpid::client::PrivateImplRef<Receiver>;
+};
+}} // namespace qpid::messaging
+
+#endif  /*!QPID_MESSAGING_RECEIVER_H*/

Added: qpid/trunk/qpid/cpp/include/qpid/messaging/Sender.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qpid/messaging/Sender.h?rev=807731&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/include/qpid/messaging/Sender.h (added)
+++ qpid/trunk/qpid/cpp/include/qpid/messaging/Sender.h Tue Aug 25 17:57:34 2009
@@ -0,0 +1,57 @@
+#ifndef QPID_MESSAGING_SENDER_H
+#define QPID_MESSAGING_SENDER_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/client/ClientImportExport.h"
+#include "qpid/client/Handle.h"
+
+namespace qpid {
+namespace client {
+
+template <class> class PrivateImplRef;
+
+}
+
+namespace messaging {
+
+class Message;
+class SenderImpl;
+
+/**
+ * Interface through which messages are sent.
+ */
+class Sender : public qpid::client::Handle<SenderImpl>
+{
+  public:
+    QPID_CLIENT_EXTERN Sender(SenderImpl* impl = 0);
+    QPID_CLIENT_EXTERN Sender(const Sender&);
+    QPID_CLIENT_EXTERN ~Sender();
+    QPID_CLIENT_EXTERN Sender& operator=(const Sender&);
+
+    QPID_CLIENT_EXTERN void send(Message& message);
+    QPID_CLIENT_EXTERN void cancel();
+  private:
+  friend class qpid::client::PrivateImplRef<Sender>;
+};
+}} // namespace qpid::messaging
+
+#endif  /*!QPID_MESSAGING_SENDER_H*/



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org