diff options
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; |