summaryrefslogtreecommitdiffstats
path: root/runtime/base/bit_vector.h
diff options
context:
space:
mode:
authorJean Christophe Beyler <jean.christophe.beyler@intel.com>2014-05-22 15:43:50 -0700
committerJean Christophe Beyler <jean.christophe.beyler@intel.com>2014-05-23 09:31:27 -0700
commit520f37bb5c34c5d86ad0091cb84a84c163a2fa9c (patch)
tree8c1ebd76a690dfa328821cd26b78d48531848cfa /runtime/base/bit_vector.h
parentb8033db2a8dc6f7c7e29b1552177542964f56e44 (diff)
downloadart-520f37bb5c34c5d86ad0091cb84a84c163a2fa9c.tar.gz
art-520f37bb5c34c5d86ad0091cb84a84c163a2fa9c.tar.bz2
art-520f37bb5c34c5d86ad0091cb84a84c163a2fa9c.zip
ART: Added print indices back to BitVector Dumper
- Added an API to get the indices set instead of 001...0 format Change-Id: I75841e41ca9b7ef77a0717715669dbe12506d6a1 Signed-Off-By: Jean Christophe Beyler <jean.christophe.beyler@intel.com>
Diffstat (limited to 'runtime/base/bit_vector.h')
-rw-r--r--runtime/base/bit_vector.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/runtime/base/bit_vector.h b/runtime/base/bit_vector.h
index 2a6839619a..3e965e4e9a 100644
--- a/runtime/base/bit_vector.h
+++ b/runtime/base/bit_vector.h
@@ -149,10 +149,37 @@ class BitVector {
bool EnsureSizeAndClear(unsigned int num);
void Dump(std::ostream& os, const char* prefix) const;
+
+ /**
+ * @brief last_entry is this the last entry for the dot dumping
+ * @details if not, a "|" is appended to the dump.
+ */
void DumpDot(FILE* file, const char* prefix, bool last_entry = false) const;
+ /**
+ * @brief last_entry is this the last entry for the dot dumping
+ * @details if not, a "|" is appended to the dump.
+ */
+ void DumpIndicesDot(FILE* file, const char* prefix, bool last_entry = false) const;
+
protected:
- void DumpHelper(std::ostringstream& buffer, const char* prefix) const;
+ /**
+ * @brief Dump the bitvector into buffer in a 00101..01 format.
+ * @param buffer the ostringstream used to dump the bitvector into.
+ */
+ void DumpHelper(const char* prefix, std::ostringstream& buffer) const;
+
+ /**
+ * @brief Dump the bitvector in a 1 2 5 8 format, where the numbers are the bit set.
+ * @param buffer the ostringstream used to dump the bitvector into.
+ */
+ void DumpIndicesHelper(const char* prefix, std::ostringstream& buffer) const;
+
+ /**
+ * @brief Wrapper to perform the bitvector dumping with the .dot format.
+ * @param buffer the ostringstream used to dump the bitvector into.
+ */
+ void DumpDotHelper(bool last_entry, FILE* file, std::ostringstream& buffer) const;
private:
Allocator* const allocator_;