summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/framing/FieldTable.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-08-20 13:25:06 +0000
committerGordon Sim <gsim@apache.org>2009-08-20 13:25:06 +0000
commitb7628599ca9fa276bc9fc072804f44cd3d4765ea (patch)
treeb64039ab1a25d893d2519114e8de3de84df14441 /cpp/src/qpid/framing/FieldTable.cpp
parent2f3b871bd7828bbf1f9642bc5837b7244e305e7b (diff)
downloadqpid-python-b7628599ca9fa276bc9fc072804f44cd3d4765ea.tar.gz
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
Diffstat (limited to 'cpp/src/qpid/framing/FieldTable.cpp')
-rw-r--r--cpp/src/qpid/framing/FieldTable.cpp20
1 files changed, 13 insertions, 7 deletions
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 <class T, int width, uint8_t typecode>
bool getRawFixedWidthValue(FieldTable::ValuePtr vptr, T& value)
{
if (vptr && vptr->getType() == typecode) {
- FixedWidthValue<width>* fwv = dynamic_cast< FixedWidthValue<width>* >(&vptr->getData());
- if (fwv) {
- uint8_t* const octets = Endian::convertIfRequired(fwv->rawOctets(), width);
- uint8_t* const target = reinterpret_cast<uint8_t*>(&value);
- for (uint i = 0; i < width; ++i) target[i] = octets[i];
- return true;
- }
+ value = vptr->get<T>();
+ return true;
}
return false;
}
@@ -370,5 +365,16 @@ void FieldTable::erase(const std::string& name)
values.erase(name);
}
+std::pair<FieldTable::ValueMap::iterator, bool> 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);
+}
+
+
}
}