diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2007-10-18 18:30:07 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2007-10-18 18:30:07 +0000 |
| commit | a9e8f2cd9aebc1b1e44f77add5bf48bbccbd0e3a (patch) | |
| tree | 850c4adb44d354204139642317f4e249e75c524a /qpid/cpp | |
| parent | d7b7eec631328f131ffc6711417c579a0ab8c8c2 (diff) | |
| download | qpid-python-a9e8f2cd9aebc1b1e44f77add5bf48bbccbd0e3a.tar.gz | |
More rearranging of template specialisation to avoid gccisms and conform correctly to the standard
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@586054 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
| -rw-r--r-- | qpid/cpp/src/qpid/framing/FieldValue.cpp | 24 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/framing/FieldValue.h | 12 |
2 files changed, 12 insertions, 24 deletions
diff --git a/qpid/cpp/src/qpid/framing/FieldValue.cpp b/qpid/cpp/src/qpid/framing/FieldValue.cpp index 71961fa98a..a7535ae4b9 100644 --- a/qpid/cpp/src/qpid/framing/FieldValue.cpp +++ b/qpid/cpp/src/qpid/framing/FieldValue.cpp @@ -82,30 +82,6 @@ void FieldValue::decode(Buffer& buffer) data->decode(buffer); } -template<> -bool FieldValue::convertsTo<int>() const -{ - return data->convertsToInt(); -} - -template<> -bool FieldValue::convertsTo<string>() const -{ - return data->convertsToString(); -} - -template<> -int FieldValue::get<int>() const -{ - return data->getInt(); -} - -template<> -std::string FieldValue::get<std::string>() const -{ - return data->getString(); -} - void FieldValue::encode(Buffer& buffer) { buffer.putOctet(typeOctet); diff --git a/qpid/cpp/src/qpid/framing/FieldValue.h b/qpid/cpp/src/qpid/framing/FieldValue.h index 171afb68d0..7e3d895b61 100644 --- a/qpid/cpp/src/qpid/framing/FieldValue.h +++ b/qpid/cpp/src/qpid/framing/FieldValue.h @@ -78,6 +78,18 @@ class FieldValue { std::auto_ptr<Data> data; }; +template <> +inline bool FieldValue::convertsTo<int>() const { return data->convertsToInt(); } + +template <> +inline bool FieldValue::convertsTo<std::string>() const { return data->convertsToString(); } + +template <> +inline int FieldValue::get<int>() const { return data->getInt(); } + +template <> +inline std::string FieldValue::get<std::string>() const { return data->getString(); } + inline std::ostream& operator<<(std::ostream& out, const FieldValue& v) { v.print(out); return out; |
