summaryrefslogtreecommitdiff
path: root/cpp/include
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/include')
-rw-r--r--cpp/include/qpid/Options.h4
-rw-r--r--cpp/include/qpid/Url.h6
-rw-r--r--cpp/include/qpid/framing/Array.h22
-rw-r--r--cpp/include/qpid/framing/FieldTable.h56
-rw-r--r--cpp/include/qpid/framing/SequenceNumber.h6
-rw-r--r--cpp/include/qpid/framing/SequenceSet.h6
-rw-r--r--cpp/include/qpid/sys/MemStat.h38
-rw-r--r--cpp/include/qpid/types/Variant.h4
8 files changed, 60 insertions, 82 deletions
diff --git a/cpp/include/qpid/Options.h b/cpp/include/qpid/Options.h
index 63d91c2d72..9860076195 100644
--- a/cpp/include/qpid/Options.h
+++ b/cpp/include/qpid/Options.h
@@ -163,10 +163,12 @@ struct Options : public po::options_description {
*/
struct CommonOptions : public Options {
QPID_COMMON_EXTERN CommonOptions(const std::string& name=std::string(),
- const std::string& configfile=std::string());
+ const std::string& configfile=std::string(),
+ const std::string& clientConfigFile=std::string());
bool help;
bool version;
std::string config;
+ std::string clientConfig;
};
diff --git a/cpp/include/qpid/Url.h b/cpp/include/qpid/Url.h
index 915b08ac5f..b3ff9576e2 100644
--- a/cpp/include/qpid/Url.h
+++ b/cpp/include/qpid/Url.h
@@ -39,7 +39,7 @@ struct Url : public std::vector<Address> {
* on a multi-homed host. */
QPID_COMMON_EXTERN static Url getIpAddressesUrl(uint16_t port);
- struct Invalid : public Exception { Invalid(const std::string& s); };
+ struct Invalid : public Exception { QPID_COMMON_EXTERN Invalid(const std::string& s); };
/** Convert to string form. */
QPID_COMMON_EXTERN std::string str() const;
@@ -52,6 +52,8 @@ struct Url : public std::vector<Address> {
/** Parse url, throw Invalid if invalid. */
explicit Url(const std::string& url) { parse(url.c_str()); }
+ /** Parse url, throw Invalid if invalid. */
+ explicit Url(const std::string& url, const std::string& defaultProtocol) { parse(url.c_str(), defaultProtocol); }
/** Parse url, throw Invalid if invalid. */
explicit Url(const char* url) { parse(url); }
@@ -66,10 +68,12 @@ struct Url : public std::vector<Address> {
*@exception Invalid if the url is invalid.
*/
QPID_COMMON_EXTERN void parse(const char* url);
+ QPID_COMMON_EXTERN void parse(const char* url, const std::string& defaultProtocol);
QPID_COMMON_INLINE_EXTERN void parse(const std::string& url) { parse(url.c_str()); }
/** Replace contesnts with parsed URL. Replace with empty URL if invalid. */
QPID_COMMON_EXTERN void parseNoThrow(const char* url);
+ QPID_COMMON_EXTERN void parseNoThrow(const char* url, const std::string& defaultProtocol);
/** Add a protocol tag to be recognzed in URLs.
* Only for use by protcol plug-in initializers.
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:
diff --git a/cpp/include/qpid/framing/FieldTable.h b/cpp/include/qpid/framing/FieldTable.h
index bdcef6d7fd..1986a72d10 100644
--- a/cpp/include/qpid/framing/FieldTable.h
+++ b/cpp/include/qpid/framing/FieldTable.h
@@ -1,3 +1,6 @@
+#ifndef _FieldTable_
+#define _FieldTable_
+
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,15 +21,17 @@
* under the License.
*
*/
-#include <iostream>
-#include <vector>
+
+#include "qpid/framing/amqp_types.h"
+#include "qpid/sys/Mutex.h"
+
#include <boost/shared_ptr.hpp>
+#include <boost/shared_array.hpp>
+
+#include <iosfwd>
#include <map>
-#include "qpid/framing/amqp_types.h"
-#include "qpid/CommonImportExport.h"
-#ifndef _FieldTable_
-#define _FieldTable_
+#include "qpid/CommonImportExport.h"
namespace qpid {
/**
@@ -56,10 +61,10 @@ class FieldTable
typedef ValueMap::reference reference;
typedef ValueMap::value_type value_type;
- QPID_COMMON_INLINE_EXTERN FieldTable() {};
- QPID_COMMON_EXTERN FieldTable(const FieldTable& ft);
- QPID_COMMON_EXTERN ~FieldTable();
- QPID_COMMON_EXTERN FieldTable& operator=(const FieldTable& ft);
+ QPID_COMMON_EXTERN FieldTable();
+ QPID_COMMON_EXTERN FieldTable(const FieldTable&);
+ QPID_COMMON_EXTERN FieldTable& operator=(const FieldTable&);
+ // Compiler default destructor fine
QPID_COMMON_EXTERN uint32_t encodedSize() const;
QPID_COMMON_EXTERN void encode(Buffer& buffer) const;
QPID_COMMON_EXTERN void decode(Buffer& buffer);
@@ -91,32 +96,35 @@ class FieldTable
QPID_COMMON_EXTERN bool getArray(const std::string& name, Array& value) const;
QPID_COMMON_EXTERN bool getFloat(const std::string& name, float& value) const;
QPID_COMMON_EXTERN bool getDouble(const std::string& name, double& value) const;
- //bool getTimestamp(const std::string& name, uint64_t& value) const;
- //bool getDecimal(string& name, xxx& value);
+ //QPID_COMMON_EXTERN bool getTimestamp(const std::string& name, uint64_t& value) const;
+ //QPID_COMMON_EXTERN bool getDecimal(string& name, xxx& value);
QPID_COMMON_EXTERN void erase(const std::string& name);
QPID_COMMON_EXTERN bool operator==(const FieldTable& other) const;
// Map-like interface.
- ValueMap::const_iterator begin() const { return values.begin(); }
- ValueMap::const_iterator end() const { return values.end(); }
- ValueMap::const_iterator find(const std::string& s) const { return values.find(s); }
+ QPID_COMMON_EXTERN ValueMap::const_iterator begin() const;
+ QPID_COMMON_EXTERN ValueMap::const_iterator end() const;
+ QPID_COMMON_EXTERN ValueMap::const_iterator find(const std::string& s) const;
- ValueMap::iterator begin() { return values.begin(); }
- ValueMap::iterator end() { return values.end(); }
- ValueMap::iterator find(const std::string& s) { return values.find(s); }
+ QPID_COMMON_EXTERN ValueMap::iterator begin();
+ QPID_COMMON_EXTERN ValueMap::iterator end();
+ QPID_COMMON_EXTERN ValueMap::iterator find(const std::string& s);
QPID_COMMON_EXTERN std::pair <ValueMap::iterator, bool> insert(const ValueMap::value_type&);
QPID_COMMON_EXTERN ValueMap::iterator insert(ValueMap::iterator, const ValueMap::value_type&);
- void clear() { values.clear(); }
-
- // ### Hack Alert
-
- ValueMap::iterator getValues() { return values.begin(); }
+ QPID_COMMON_EXTERN void clear();
private:
- ValueMap values;
+ void realDecode() const;
+ void flushRawCache();
+
+ mutable qpid::sys::Mutex lock;
+ mutable ValueMap values;
+ mutable boost::shared_array<uint8_t> cachedBytes;
+ mutable uint32_t cachedSize; // if = 0 then non cached size as 0 is not a legal size
+ mutable bool newBytes;
QPID_COMMON_EXTERN friend std::ostream& operator<<(std::ostream& out, const FieldTable& body);
};
diff --git a/cpp/include/qpid/framing/SequenceNumber.h b/cpp/include/qpid/framing/SequenceNumber.h
index eed15a4b75..dd85d97a52 100644
--- a/cpp/include/qpid/framing/SequenceNumber.h
+++ b/cpp/include/qpid/framing/SequenceNumber.h
@@ -52,9 +52,9 @@ boost::equality_comparable<
uint32_t getValue() const { return uint32_t(value); }
operator uint32_t() const { return uint32_t(value); }
- void encode(Buffer& buffer) const;
- void decode(Buffer& buffer);
- uint32_t encodedSize() const;
+ QPID_COMMON_EXTERN void encode(Buffer& buffer) const;
+ QPID_COMMON_EXTERN void decode(Buffer& buffer);
+ QPID_COMMON_EXTERN uint32_t encodedSize() const;
template <class S> void serialize(S& s) { s(value); }
diff --git a/cpp/include/qpid/framing/SequenceSet.h b/cpp/include/qpid/framing/SequenceSet.h
index 0a78e418ba..827c8999b3 100644
--- a/cpp/include/qpid/framing/SequenceSet.h
+++ b/cpp/include/qpid/framing/SequenceSet.h
@@ -38,9 +38,9 @@ class QPID_COMMON_CLASS_EXTERN SequenceSet : public RangeSet<SequenceNumber> {
SequenceSet(const SequenceNumber& start, const SequenceNumber finish) { add(start,finish); }
- void encode(Buffer& buffer) const;
- void decode(Buffer& buffer);
- uint32_t encodedSize() const;
+ QPID_COMMON_EXTERN void encode(Buffer& buffer) const;
+ QPID_COMMON_EXTERN void decode(Buffer& buffer);
+ QPID_COMMON_EXTERN uint32_t encodedSize() const;
QPID_COMMON_EXTERN bool contains(const SequenceNumber& s) const;
QPID_COMMON_EXTERN void add(const SequenceNumber& s);
diff --git a/cpp/include/qpid/sys/MemStat.h b/cpp/include/qpid/sys/MemStat.h
deleted file mode 100644
index d855786cd5..0000000000
--- a/cpp/include/qpid/sys/MemStat.h
+++ /dev/null
@@ -1,38 +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.
- *
- */
-#ifndef sys_MemStat
-#define sys_MemStat
-
-#include "qpid/CommonImportExport.h"
-#include "qmf/org/apache/qpid/broker/Memory.h"
-
-namespace qpid {
-namespace sys {
-
- class QPID_COMMON_CLASS_EXTERN MemStat {
- public:
- QPID_COMMON_EXTERN static void loadMemInfo(qmf::org::apache::qpid::broker::Memory* object);
- };
-
-}}
-
-#endif
-
diff --git a/cpp/include/qpid/types/Variant.h b/cpp/include/qpid/types/Variant.h
index 3feba4a0ec..3493559777 100644
--- a/cpp/include/qpid/types/Variant.h
+++ b/cpp/include/qpid/types/Variant.h
@@ -60,9 +60,9 @@ enum VariantType {
VAR_UUID
};
-std::string getTypeName(VariantType type);
+QPID_TYPES_EXTERN std::string getTypeName(VariantType type);
-bool isIntegerType(VariantType type);
+QPID_TYPES_EXTERN bool isIntegerType(VariantType type);
class VariantImpl;