summaryrefslogtreecommitdiff
path: root/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
commitf02516da02dd2d5707d396d3d7b76406ab66c673 (patch)
treec8ffced237d9521707a21065026694295dbd50fe /cpp/include
parente14614102113c3ff0241feefe7759517923b19de (diff)
downloadqpid-python-f02516da02dd2d5707d396d3d7b76406ab66c673.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/qpid@1306595 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/include')
-rw-r--r--cpp/include/qpid/framing/Array.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/cpp/include/qpid/framing/Array.h b/cpp/include/qpid/framing/Array.h
index 1e97be3bb4..4f82d4dbf0 100644
--- a/cpp/include/qpid/framing/Array.h
+++ b/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: