summaryrefslogtreecommitdiff
path: root/cpp/examples
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-12-05 21:31:26 +0000
committerAlan Conway <aconway@apache.org>2007-12-05 21:31:26 +0000
commitb1ffd4a0ac51044125b60b8cd447496a2d29b2d8 (patch)
treebb0ba4543b6281b3c12a768a2539333deb099a7a /cpp/examples
parent92d7066b28b03fad3932b92b1dd5e56a41037980 (diff)
downloadqpid-python-b1ffd4a0ac51044125b60b8cd447496a2d29b2d8.tar.gz
Fixed minor problems with example Makefiles.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@601538 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/examples')
-rw-r--r--cpp/examples/examples/direct/Makefile16
-rw-r--r--cpp/examples/examples/fanout/Makefile13
-rw-r--r--cpp/examples/examples/fanout/fanout_consumer.cpp83
-rw-r--r--cpp/examples/examples/pub-sub/Makefile10
-rw-r--r--cpp/examples/examples/request-response/Makefile9
5 files changed, 11 insertions, 120 deletions
diff --git a/cpp/examples/examples/direct/Makefile b/cpp/examples/examples/direct/Makefile
index c94e900a75..e7ed5beb58 100644
--- a/cpp/examples/examples/direct/Makefile
+++ b/cpp/examples/examples/direct/Makefile
@@ -1,20 +1,10 @@
CXX=g++
CXXFLAGS=
+LDFLAGS=-lqpidclient
-PROGRAMS=direct_config_queues listener direct_publisher direct_persistent_publisher
-all: $(PROGRAMS)
-
-direct_config_queues: direct_config_queues.cpp
- $(CXX) $(CXXFLAGS) -lqpidclient -o $@ $^
-
-listener: listener.cpp
- $(CXX) $(CXXFLAGS) -lqpidclient -o $@ $^
+PROGRAMS=direct_config_queues direct_persistent_config_queues direct_persistent_publisher direct_publisher listener
-direct_publisher: direct_publisher.cpp
- $(CXX) $(CXXFLAGS) -lqpidclient -o $@ $^
-
-direct_persistent_publisher: direct_persistent_publisher.cpp
- $(CXX) $(CXXFLAGS) -lqpidclient -o $@ $^
+all: $(PROGRAMS)
clean:
rm -f $(PROGRAMS)
diff --git a/cpp/examples/examples/fanout/Makefile b/cpp/examples/examples/fanout/Makefile
index 719a7e7416..d8fa9d7bb3 100644
--- a/cpp/examples/examples/fanout/Makefile
+++ b/cpp/examples/examples/fanout/Makefile
@@ -1,17 +1,10 @@
CXX=g++
CXXFLAGS=
+LDFLAGS=-lqpidclient
-PROGRAMS=fanout_config_queues listener fanout_publisher
-all: $(PROGRAMS)
-
-fanout_config_queues: fanout_config_queues.cpp
- $(CXX) $(CXXFLAGS) -lqpidclient -o $@ $^
+PROGRAMS=fanout_config_queues fanout_publisher listener
-listener: listener.cpp
- $(CXX) $(CXXFLAGS) -lqpidclient -o $@ $^
-
-fanout_publisher: fanout_publisher.cpp
- $(CXX) $(CXXFLAGS) -lqpidclient -o $@ $^
+all: $(PROGRAMS)
clean:
rm -f $(PROGRAMS)
diff --git a/cpp/examples/examples/fanout/fanout_consumer.cpp b/cpp/examples/examples/fanout/fanout_consumer.cpp
deleted file mode 100644
index 663c765159..0000000000
--- a/cpp/examples/examples/fanout/fanout_consumer.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/**
- * direct_listener.cpp:
- *
- * This program is one of three programs designed to be used
- * together. These programs do not specify the exchange type - the
- * default exchange type is the direct exchange.
- *
- * direct_config_queues.cpp:
- *
- * Creates a queue on a broker, binding a routing key to route
- * messages to that queue.
- *
- * direct_publisher.cpp:
- *
- * Publishes to a broker, specifying a routing key.
- *
- * direct_consumer.cpp (this program):
- *
- * Reads from a queue on the broker using session.get().
- *
- * This is less efficient that direct_listener.cpp, but simpler,
- * and can be a better approach when synchronizing messages from
- * multiple queues.
- *
- */
-
-#include <qpid/client/Dispatcher.h>
-#include <qpid/client/Connection.h>
-#include <qpid/client/Session.h>
-#include <qpid/client/ClientMessage.h>
-
-#include <unistd.h>
-#include <cstdlib>
-#include <iostream>
-
-using namespace qpid::client;
-using namespace qpid::framing;
-
-
-int main() {
- Connection connection;
- Message msg;
- try {
- connection.open("127.0.0.1", 5672);
- Session session = connection.newSession();
-
- //--------- Main body of program --------------------------------------------
-
- Listener listener(session, "destination");
- ### session.get();
-
- //-----------------------------------------------------------------------------
-
- connection.close();
- return 0;
- } catch(const std::exception& error) {
- std::cout << error.what() << std::endl;
- }
- return 1;
-}
-
-
diff --git a/cpp/examples/examples/pub-sub/Makefile b/cpp/examples/examples/pub-sub/Makefile
index d93bae72a1..4b2dd52efd 100644
--- a/cpp/examples/examples/pub-sub/Makefile
+++ b/cpp/examples/examples/pub-sub/Makefile
@@ -1,14 +1,10 @@
-CXX=g++
+CXX=g++
CXXFLAGS=
+LDFLAGS=-lqpidclient
PROGRAMS=topic_listener topic_publisher
-all: $(PROGRAMS)
-
-topic_listener: topic_listener.cpp
- $(CXX) $(CXXFLAGS) -lqpidclient -o $@ $^
-topic_publisher: topic_publisher.cpp
- $(CXX) $(CXXFLAGS) -lqpidclient -o $@ $^
+all: $(PROGRAMS)
clean:
rm -f $(PROGRAMS)
diff --git a/cpp/examples/examples/request-response/Makefile b/cpp/examples/examples/request-response/Makefile
index 32612843eb..e7ef2590d3 100644
--- a/cpp/examples/examples/request-response/Makefile
+++ b/cpp/examples/examples/request-response/Makefile
@@ -1,15 +1,10 @@
CXX=g++
CXXFLAGS=
+LDFLAGS=-lqpidclient
PROGRAMS=client server
-all: $(PROGRAMS)
-
-client: client.cpp
- $(CXX) $(CXXFLAGS) -lqpidclient -o $@ $^
-
-server: server.cpp
- $(CXX) $(CXXFLAGS) -lqpidclient -o $@ $^
+all: $(PROGRAMS)
clean:
rm -f $(PROGRAMS)