32 static std::atomic<unsigned>
index = 0;
41 return std::is_same_v<ColumnarModeDefault,ColumnarModeArray>;
51 throw std::runtime_error (
"tool does not implement IColumnarTool");
63 m_toolWrapper = std::make_shared<ColumnarToolWrapper> (m_tool);
72 m_toolWrapper = std::make_shared<ColumnarToolWrapper> (m_tool);
82 if (m_systTool ==
nullptr)
85 throw std::runtime_error (
"failed to apply systematic variation");
94 throw std::runtime_error (
"tool not initialized");
95 return m_toolWrapper->getColumnInfo ();
104 throw std::runtime_error (
"tool not initialized");
105 return m_toolWrapper->getColumnNames ();
115 std::vector<std::string>
result;
127 throw std::runtime_error (
"tool not initialized");
128 return *m_toolWrapper;
149 throw std::runtime_error (
"column already exists: " +
column.name);
159 if (
column == m_columnMap.end())
160 throw std::runtime_error (
"adding unknown column: " +
name);
161 if (m_inputs.contains (
name))
162 throw std::runtime_error (
"column added twice: " +
name);
163 if (
column->second.type == &
typeid(
float))
165 else if (
column->second.type == &
typeid(
char))
167 else if (
column->second.type == &
typeid(
int))
170 addInputTyped<std::uint8_t> (
name,
data);
172 addInputTyped<std::uint16_t> (
name,
data);
174 addInputTyped<std::uint32_t> (
name,
data);
176 addInputTyped<std::uint64_t> (
name,
data);
178 throw std::logic_error (
"column name " +
name +
" has unsupported type " +
column->second.type->name() +
", extend test handler to support it");
187 if (
column == m_columnMap.end())
188 throw std::runtime_error (
"adding unknown column: " +
name);
189 if (m_expectations.contains (
name))
190 throw std::runtime_error (
"column added twice: " +
name);
191 if (
column->second.type == &
typeid(
float))
193 else if (
column->second.type == &
typeid(
char))
195 else if (
column->second.type == &
typeid(
int))
198 addExpectationTyped<std::uint8_t> (
name,
values);
200 addExpectationTyped<std::uint16_t> (
name,
values);
202 addExpectationTyped<std::uint32_t> (
name,
values);
204 addExpectationTyped<std::uint64_t> (
name,
values);
206 throw std::logic_error (
"column name " +
name +
" has unsupported type " +
column->second.type->name() +
", extend test handler to support it");
215 if (
iter == m_inputs.end())
216 throw std::runtime_error (
"column not found: " +
name);
217 return std::visit ([] (
const auto&
data) {
return data.size(); },
iter->second);
225 for (
auto& [
name, columnInfo] : m_columnMap)
227 if (
auto iter = m_inputs.find (columnInfo.name);
iter != m_inputs.end())
229 switch (columnInfo.accessMode)
232 std::visit ([&] (
const auto&
data)
234 m_columnData->setColumn (
iter->first,
data.size(),
data.data());
239 std::visit ([&] (
auto&
data)
241 m_columnData->setColumn (
iter->first,
data.size(),
data.data());
242 }, m_activeColumns[
iter->first] =
iter->second);
245 throw std::runtime_error (
"column mode unknown: " + columnInfo.name);
256 m_columnData->call ();
264 for (
auto& [
name,
info] : m_columnMap)
269 auto iter = m_activeColumns.find (
name);
270 if (
iter == m_activeColumns.end())
273 if (
info.type == &
typeid(
float))
274 checkExpectationTyped<float> (
name);
275 else if (
info.type == &
typeid(
char))
276 checkExpectationTyped<char> (
name);
277 else if (
info.type == &
typeid(
int))
278 checkExpectationTyped<int> (
name);
280 checkExpectationTyped<std::uint8_t> (
name);
282 checkExpectationTyped<std::uint16_t> (
name);
284 checkExpectationTyped<std::uint32_t> (
name);
286 checkExpectationTyped<std::uint64_t> (
name);
288 throw std::logic_error (
"column name " +
name +
" has unsupported type " +
info.type->name() +
", extend test handler to support it");