summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/framing/FieldValue.cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2007-10-18 14:06:09 +0000
committerAndrew Stitcher <astitcher@apache.org>2007-10-18 14:06:09 +0000
commit07969f395f233bf940029304f06fa0fd7bfcd193 (patch)
treef1cb2e7c090665545d177d2cb3a6c4053c3b7003 /cpp/src/qpid/framing/FieldValue.cpp
parente77ead1fcc4ab32323a1a1212e42498ed6c4b60e (diff)
downloadqpid-python-07969f395f233bf940029304f06fa0fd7bfcd193.tar.gz
Recast int to FixedWidthValue conversions to avoid tamplate specialisation and be more general
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@585966 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/framing/FieldValue.cpp')
-rw-r--r--cpp/src/qpid/framing/FieldValue.cpp111
1 files changed, 0 insertions, 111 deletions
diff --git a/cpp/src/qpid/framing/FieldValue.cpp b/cpp/src/qpid/framing/FieldValue.cpp
index a43c0710ae..71961fa98a 100644
--- a/cpp/src/qpid/framing/FieldValue.cpp
+++ b/cpp/src/qpid/framing/FieldValue.cpp
@@ -26,117 +26,6 @@
namespace qpid {
namespace framing {
-/*
- * Specialisations for construction from integers
- */
-template<>
-FixedWidthValue<8>::FixedWidthValue(uint64_t v)
-{
- octets[7] = (uint8_t) (0xFF & v); v >>= 8;
- octets[6] = (uint8_t) (0xFF & v); v >>= 8;
- octets[5] = (uint8_t) (0xFF & v); v >>= 8;
- octets[4] = (uint8_t) (0xFF & v); v >>= 8;
- octets[3] = (uint8_t) (0xFF & v); v >>= 8;
- octets[2] = (uint8_t) (0xFF & v); v >>= 8;
- octets[1] = (uint8_t) (0xFF & v); v >>= 8;
- octets[0] = (uint8_t) (0xFF & v);
-}
-
-template<>
-FixedWidthValue<4>::FixedWidthValue(uint64_t v)
-{
- octets[3] = (uint8_t) (0xFF & v); v >>= 8;
- octets[2] = (uint8_t) (0xFF & v); v >>= 8;
- octets[1] = (uint8_t) (0xFF & v); v >>= 8;
- octets[0] = (uint8_t) (0xFF & v);
-}
-
-template<>
-FixedWidthValue<2>::FixedWidthValue(uint64_t v)
-{
- octets[1] = (uint8_t) (0xFF & v); v >>= 8;
- octets[0] = (uint8_t) (0xFF & v);
-}
-
-template<>
-FixedWidthValue<1>::FixedWidthValue(uint64_t v)
-{
- octets[0] = (uint8_t) (0xFF & v);
-}
-
-/*
- * Specialisations for turning into integers
- */
-template<>
-int64_t FixedWidthValue<8>::getInt() const
-{
- int64_t v = 0;
- v |= octets[0]; v <<= 8;
- v |= octets[1]; v <<= 8;
- v |= octets[2]; v <<= 8;
- v |= octets[3]; v <<= 8;
- v |= octets[4]; v <<= 8;
- v |= octets[5]; v <<= 8;
- v |= octets[6]; v <<= 8;
- v |= octets[7];
- return v;
-}
-
-template<>
-int64_t FixedWidthValue<4>::getInt() const
-{
- int64_t v = 0;
- v |= octets[0]; v <<= 8;
- v |= octets[1]; v <<= 8;
- v |= octets[2]; v <<= 8;
- v |= octets[3];
- return v;
-}
-
-template<>
-int64_t FixedWidthValue<2>::getInt() const
-{
- int64_t v = 0;
- v |= octets[0]; v <<= 8;
- v |= octets[1];
- return v;
-}
-
-template<>
-int64_t FixedWidthValue<1>::getInt() const
-{
- int64_t v = 0;
- v |= octets[0];
- return v;
-}
-
-/*
- * Specialisations for convertion to int predicate
- */
-template<>
-bool FixedWidthValue<8>::convertsToInt() const
-{
- return true;
-}
-
-template<>
-bool FixedWidthValue<4>::convertsToInt() const
-{
- return true;
-}
-
-template<>
-bool FixedWidthValue<2>::convertsToInt() const
-{
- return true;
-}
-
-template<>
-bool FixedWidthValue<1>::convertsToInt() const
-{
- return true;
-}
-
void FieldValue::decode(Buffer& buffer)
{
typeOctet = buffer.getOctet();