Decode one row of a chunk column into a VarValue, based on the column's StorageKind.
| 105 | |
| 106 | // Decode one row of a chunk column into a VarValue, based on the column's StorageKind. |
| 107 | static VarValue decodeAsVarvalue(const TopicChunk& chunk, std::size_t col, std::size_t row, StorageKind kind) { |
| 108 | switch (kind) { |
| 109 | case StorageKind::kFloat32: |
| 110 | case StorageKind::kFloat64: |
| 111 | return chunk.readNumericAsDouble(col, row); |
| 112 | case StorageKind::kInt32: |
| 113 | case StorageKind::kInt64: |
| 114 | return chunk.readNumericAsInt64(col, row); |
| 115 | case StorageKind::kUint64: |
| 116 | return chunk.readNumericAsUint64(col, row); |
| 117 | case StorageKind::kBool: |
| 118 | return static_cast<int64_t>(chunk.readBool(col, row) ? 1 : 0); |
| 119 | case StorageKind::kString: |
| 120 | return std::string(chunk.readString(col, row)); |
| 121 | } |
| 122 | return 0.0; |
| 123 | } |
| 124 | |
| 125 | // Write a VarValue to a DataWriter row at (topic, col), coercing to out_kind. |
| 126 | static void writeVarvalue( |
no test coverage detected