From b7628599ca9fa276bc9fc072804f44cd3d4765ea Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Thu, 20 Aug 2009 13:25:06 +0000 Subject: Add List class to handle encoding of AMQP 0-10 list type. Fill out accessors for different FieldValue types. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@806162 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/framing/FieldTable.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'cpp/src/qpid/framing/FieldTable.cpp') diff --git a/cpp/src/qpid/framing/FieldTable.cpp b/cpp/src/qpid/framing/FieldTable.cpp index bc832e9db4..255a3b74a4 100644 --- a/cpp/src/qpid/framing/FieldTable.cpp +++ b/cpp/src/qpid/framing/FieldTable.cpp @@ -185,13 +185,8 @@ template bool getRawFixedWidthValue(FieldTable::ValuePtr vptr, T& value) { if (vptr && vptr->getType() == typecode) { - FixedWidthValue* fwv = dynamic_cast< FixedWidthValue* >(&vptr->getData()); - if (fwv) { - uint8_t* const octets = Endian::convertIfRequired(fwv->rawOctets(), width); - uint8_t* const target = reinterpret_cast(&value); - for (uint i = 0; i < width; ++i) target[i] = octets[i]; - return true; - } + value = vptr->get(); + return true; } return false; } @@ -370,5 +365,16 @@ void FieldTable::erase(const std::string& name) values.erase(name); } +std::pair FieldTable::insert(const ValueMap::value_type& value) +{ + return values.insert(value); +} + +FieldTable::ValueMap::iterator FieldTable::insert(ValueMap::iterator position, const ValueMap::value_type& value) +{ + return values.insert(position, value); +} + + } } -- cgit v1.2.1