summaryrefslogtreecommitdiff
path: root/qpid/cpp/include
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2012-03-28 21:00:40 +0000
committerAndrew Stitcher <astitcher@apache.org>2012-03-28 21:00:40 +0000
commitc3d1faded9c8b9038cc2643c902a71a488e2d60d (patch)
treefd7de366125ea614027c5834e435e0c8237d1083 /qpid/cpp/include
parentcb0c0dbd13a27b535623ca0fdd6ef59f6f13622a (diff)
downloadqpid-python-c3d1faded9c8b9038cc2643c902a71a488e2d60d.tar.gz
QPID-3921: C++ header files need tidyup
Tidied up header use of FieldValue.h - Removed all unnecessary includes of FieldValue.h from other header files especially Array.h. (This avoids the world recompiling when working on FieldValue!) - Corrected up header guards in Array.h git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1306595 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/include')
-rw-r--r--qpid/cpp/include/qpid/framing/Array.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/qpid/cpp/include/qpid/framing/Array.h b/qpid/cpp/include/qpid/framing/Array.h
index 1e97be3bb4..4f82d4dbf0 100644
--- a/qpid/cpp/include/qpid/framing/Array.h
+++ b/qpid/cpp/include/qpid/framing/Array.h
@@ -1,3 +1,6 @@
+#ifndef QPID_FRAMING_ARRAY_H
+#define QPID_FRAMING_ARRAY_H
+
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,21 +21,22 @@
* under the License.
*
*/
+
#include "qpid/framing/amqp_types.h"
-#include "qpid/framing/FieldValue.h"
#include "qpid/framing/TypeCode.h"
+
#include <boost/shared_ptr.hpp>
+
#include <iostream>
#include <vector>
-#include "qpid/CommonImportExport.h"
-#ifndef _Array_
-#define _Array_
+#include "qpid/CommonImportExport.h"
namespace qpid {
namespace framing {
class Buffer;
+class FieldValue;
class QPID_COMMON_CLASS_EXTERN Array
{
@@ -75,12 +79,10 @@ class QPID_COMMON_CLASS_EXTERN Array
// Non-std interface
QPID_COMMON_INLINE_EXTERN void add(ValuePtr value) { push_back(value); }
- template <class T>
- void collect(std::vector<T>& out) const
- {
- for (ValueVector::const_iterator i = values.begin(); i != values.end(); ++i) {
- out.push_back((*i)->get<T>());
- }
+ // For use in standard algorithms
+ template <typename R, typename V>
+ static R get(const V& v) {
+ return v->get<R>();
}
private: