aboutsummaryrefslogtreecommitdiffstats
path: root/chilbert
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-08-11 18:53:23 +0200
committerDavid Robillard <d@drobilla.net>2018-09-29 14:46:19 +0200
commit7c4a75add8ee00eb791aa074e84c608c9bcf7c5f (patch)
treec91c0053e0aae808525b6da8e1264eca21e9bfaa /chilbert
parent9ea2c312d7641e60f8955067b2c301151dad5403 (diff)
downloadchilbert-7c4a75add8ee00eb791aa074e84c608c9bcf7c5f.tar.gz
chilbert-7c4a75add8ee00eb791aa074e84c608c9bcf7c5f.tar.bz2
chilbert-7c4a75add8ee00eb791aa074e84c608c9bcf7c5f.zip
Add methods to set all bits
Diffstat (limited to 'chilbert')
-rw-r--r--chilbert/BigBitVec.hpp7
-rw-r--r--chilbert/FixBitVec.hpp7
2 files changed, 14 insertions, 0 deletions
diff --git a/chilbert/BigBitVec.hpp b/chilbert/BigBitVec.hpp
index 1f97039..7a1b49a 100644
--- a/chilbert/BigBitVec.hpp
+++ b/chilbert/BigBitVec.hpp
@@ -75,6 +75,13 @@ public:
return *this;
}
+ /// Set all bits to one
+ CBigBitVec& set()
+ {
+ memset(m_pcRacks.get(), 0xFF, sizeof(CFixBitVec) * m_iRacks);
+ return *this;
+ }
+
/// Truncate to a given precision in bits (zero MSBs)
CBigBitVec& truncate(const int bits)
{
diff --git a/chilbert/FixBitVec.hpp b/chilbert/FixBitVec.hpp
index 2106aa5..ac02e40 100644
--- a/chilbert/FixBitVec.hpp
+++ b/chilbert/FixBitVec.hpp
@@ -43,6 +43,13 @@ public:
/// Return the size in bits
int size() const { return FBV_BITS; }
+ /// Set all bits to one
+ CFixBitVec& set()
+ {
+ m_rack = FBV1S;
+ return *this;
+ }
+
/// Set all bits to zero
CFixBitVec& reset()
{