diff options
Diffstat (limited to 'runtime/base/bit_vector.h')
-rw-r--r-- | runtime/base/bit_vector.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/runtime/base/bit_vector.h b/runtime/base/bit_vector.h index 426d7c4ae0..8f9afff47d 100644 --- a/runtime/base/bit_vector.h +++ b/runtime/base/bit_vector.h @@ -207,10 +207,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: static constexpr uint32_t kWordBytes = sizeof(uint32_t); |