MCPcopy Create free account
hub / github.com/comaps/comaps / ForEach

Method ForEach

libs/coding/compressed_bit_vector.hpp:106–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104
105 template <typename Fn>
106 void ForEach(Fn && f) const
107 {
108 base::ControlFlowWrapper<Fn> wrapper(std::forward<Fn>(f));
109 for (size_t i = 0; i < m_bitGroups.size(); ++i)
110 {
111 for (size_t j = 0; j < kBlockSize; ++j)
112 {
113 if (((m_bitGroups[i] >> j) & 1) > 0)
114 {
115 if (wrapper(kBlockSize * i + j) == base::ControlFlow::Break)
116 return;
117 }
118 }
119 }
120 }
121
122 // Returns 0 if the group number is too large to be contained in m_bits.
123 uint64_t GetBitGroup(size_t i) const;

Callers 2

ForEachMethod · 0.45
operator()Method · 0.45

Calls 2

wrapperFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected