diff options
author | Alan Conway <aconway@apache.org> | 2008-04-04 14:42:36 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-04-04 14:42:36 +0000 |
commit | 37b17edcaeb1fd79eae8801a8b395a63f33a5cf7 (patch) | |
tree | 3f153f504822fb27b71f38c67cc3d88a047ecf21 /cpp/src/qpid/Serializer.h | |
parent | 892d5f2f1cca71f7f42bace628ee1ca1296cc6bf (diff) | |
download | qpid-python-37b17edcaeb1fd79eae8801a8b395a63f33a5cf7.tar.gz |
src/qpid/amqp_0_10/Assembly.cpp,.h:
- remove unused class.
src/qpid/Serializer.h, src/qpid/amqp_0_10/Map.h:
- Enforce map Size limits using serializer.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@644727 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/Serializer.h')
-rw-r--r-- | cpp/src/qpid/Serializer.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cpp/src/qpid/Serializer.h b/cpp/src/qpid/Serializer.h index d3e5264864..6b67a4ccf8 100644 --- a/cpp/src/qpid/Serializer.h +++ b/cpp/src/qpid/Serializer.h @@ -22,6 +22,7 @@ * */ +#include <limits> #include <algorithm> #include "qpid/Exception.h" // FIXME aconway 2008-04-03: proper exception class. @@ -101,6 +102,12 @@ template <class Derived> class Serializer { return l; } + /** Get the max number of bytes that can be processed under the + * current limit. + */ + size_t getLimit() const { + return limit - bytes; + } /** Set absolute limit. */ void setAbsLimit(size_t n) { limit = n; |