From f02516da02dd2d5707d396d3d7b76406ab66c673 Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Wed, 28 Mar 2012 21:00:40 +0000 Subject: 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 --- cpp/include/qpid/framing/Array.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'cpp/include') 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 + #include #include -#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 - void collect(std::vector& out) const - { - for (ValueVector::const_iterator i = values.begin(); i != values.end(); ++i) { - out.push_back((*i)->get()); - } + // For use in standard algorithms + template + static R get(const V& v) { + return v->get(); } private: -- cgit v1.2.1