// 'fold' calculated by counting traces in a gather may be incorrect if there are duplicate-key
// traces, so we'll ignore it and use the count of unique offset values
fold=static_cast<int>(offsetValues.size());
// Determine if offset values are suitable for computed respacing: Values are monotonically increasing
bool
isSane=false;
size_t
numSorted=0;
// check that offset start/end/step is consistent
if(offsetStart+(fold-1)*offsetStep!=offsetEnd)
// check each gather to see if offsets are ordered within every gather
for(constauto&entry:gatherOffsetValues)
{
constauto
msgFormat="The detected gather offset start/end/step of '{0}/{1}/{2}' is not consistent with the detected fold of '{3}'. This may indicate an incorrect header format for Offset trace header.";
// the offset spacing doesn't conform to our needs for respacing, so force the setting from Auto to Off
traceSpacingByOffset=TraceSpacingByOffset::Off;
}
else
{
// traceSpacingByOffset is set to On, but detected offset values aren't compatible with the respacing scheme
automsg="The detected gather offset values are not monotonically increasing. This may indicate an incorrect header format for the trace header Offset field and/or an incorrect option value for --respace-gathers.";