diff options
Diffstat (limited to 'cpp/include/qpid/framing/FieldValue.h')
| -rw-r--r-- | cpp/include/qpid/framing/FieldValue.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cpp/include/qpid/framing/FieldValue.h b/cpp/include/qpid/framing/FieldValue.h index 7b4dee1529..e5746c8065 100644 --- a/cpp/include/qpid/framing/FieldValue.h +++ b/cpp/include/qpid/framing/FieldValue.h @@ -99,6 +99,7 @@ class FieldValue { template <class T, int W> T getIntegerValue() const; template <class T, int W> T getFloatingPointValue() const; + template <int W> void getFixedWidthValue(unsigned char*) const; template <class T> bool get(T&) const; protected: @@ -209,6 +210,16 @@ inline T FieldValue::getFloatingPointValue() const { } } +template <int W> void FieldValue::getFixedWidthValue(unsigned char* value) const +{ + FixedWidthValue<W>* const fwv = dynamic_cast< FixedWidthValue<W>* const>(data.get()); + if (fwv) { + for (uint i = 0; i < W; ++i) value[i] = fwv->rawOctets()[i]; + } else { + throw InvalidConversionException(); + } +} + template <> inline float FieldValue::get<float>() const { return getFloatingPointValue<float, 4>(); @@ -417,6 +428,11 @@ class ListValue : public FieldValue { QPID_COMMON_EXTERN ListValue(const List&); }; +class UuidValue : public FieldValue { + public: + QPID_COMMON_EXTERN UuidValue(const unsigned char*); +}; + template <class T> bool getEncodedValue(FieldTable::ValuePtr vptr, T& value) { |
