From 6a86496385687df452379ea26aa4bbf71b657e6b Mon Sep 17 00:00:00 2001 From: Matej Sekoranja Date: Tue, 31 Jul 2012 11:47:42 +0200 Subject: [PATCH] added BitSet::size() --- pvDataApp/misc/bitSet.cpp | 4 ++++ pvDataApp/misc/bitSet.h | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/pvDataApp/misc/bitSet.cpp b/pvDataApp/misc/bitSet.cpp index 2c85528..fcccf13 100644 --- a/pvDataApp/misc/bitSet.cpp +++ b/pvDataApp/misc/bitSet.cpp @@ -191,6 +191,10 @@ namespace epics { namespace pvData { return sum; } + uint32 BitSet::size() const { + return wordsLength * BITS_PER_WORD; + } + BitSet& BitSet::operator&=(const BitSet& set) { while (wordsInUse > set.wordsInUse) diff --git a/pvDataApp/misc/bitSet.h b/pvDataApp/misc/bitSet.h index c291a19..83cb45b 100644 --- a/pvDataApp/misc/bitSet.h +++ b/pvDataApp/misc/bitSet.h @@ -151,6 +151,15 @@ namespace epics { namespace pvData { */ uint32 cardinality() const; + /** + * Returns the number of bits of space actually in use by this + * {@code BitSet} to represent bit values. + * The maximum element in the set is the size - 1st element. + * + * @return the number of bits currently in this bit set + */ + uint32 size() const; + /** * Performs a logical AND of this target bit set with the * argument bit set. This bit set is modified so that each bit in it