30 void Positions::add(uint32_t position, uint32_t offset, uint32_t line,
const string& path)
32 if (!elements.empty() && position < elements.back().position)
34 throw std::logic_error(
"Positions must be monotonically increasing");
36 elements.push_back(
line_t(position, offset, line, path));
40 uint32_t position, uint32_t first, uint32_t last)
const 42 while (first + 1 < last)
44 uint32_t i = (first + last) / 2;
45 if (position < elements[i].position)
54 return elements[first];
59 if (elements.size() == 0)
61 throw std::logic_error(
"No positions have been added");
63 return find(position, 0, elements.size());
69 for (
size_t i = 0; i < elements.size(); i++)
71 std::cout << elements[i].position <<
" " 72 << elements[i].offset <<
" " 73 << elements[i].line <<
" " 74 << elements[i].path << std::endl;
void dump()
Dump table to stdout.
std::ostream & operator<<(std::ostream &os, const SignalFlow::strs_t &s)
const std::string message
void add(uint32_t position, uint32_t offset, uint32_t line, const std::string &path)
Add information about a line to the container.