MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / string_view>

Method string_view>

pj_datastore/src/chunk.cpp:146–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144
145template <>
146void TopicChunkBuilder::set<std::string_view>(std::size_t col_index, std::string_view value) {
147 PJ_ASSERT(row_in_progress_, "set<string_view> called without begin_row");
148 PJ_ASSERT(col_index < columns_.size(), "col_index out of bounds");
149 columns_[col_index].appendString(value);
150 auto& cs = stats_.column_stats[col_index];
151 const std::size_t current_row = columns_[col_index].rowCount() - 1;
152 if (current_row == 0) {
153 cs.run_count = 1;
154 } else {
155 std::string_view prev = columns_[col_index].readString(current_row - 1);
156 if (value != prev) {
157 cs.is_constant = false;
158 cs.run_count++;
159 }
160 }
161}
162
163void TopicChunkBuilder::setNull(std::size_t col_index) {
164 PJ_ASSERT(row_in_progress_, "set_null called without begin_row");

Callers

nothing calls this directly

Calls 4

appendStringMethod · 0.80
sizeMethod · 0.45
rowCountMethod · 0.45
readStringMethod · 0.45

Tested by

no test coverage detected