This routine adds the line at the end of the internal list of lines.
Rename it to append() in case we ever want to introduce prepend().
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
line_bulk lines;
for (auto& it: offsets)
- lines.add(this->get_line(it));
+ lines.append(this->get_line(it));
return ::std::move(lines);
}
line_bulk lines;
for (unsigned int i = 0; i < this->num_lines(); i++)
- lines.add(this->get_line(i));
+ lines.append(this->get_line(i));
return ::std::move(lines);
}
line_bulk lines;
for (auto& it: names)
- lines.add(this->find_line(it));
+ lines.append(this->find_line(it));
return ::std::move(lines);
}
* @note The new line must be owned by the same chip as all the other
* lines already held by this line_bulk object.
*/
- GPIOD_API void add(const line& new_line);
+ GPIOD_API void append(const line& new_line);
/**
* @brief Get the line at given offset.
this->_m_bulk.reserve(lines.size());
for (auto& it: lines)
- this->add(it);
+ this->append(it);
}
-void line_bulk::add(const line& new_line)
+void line_bulk::append(const line& new_line)
{
if (!new_line)
throw ::std::logic_error("line_bulk cannot hold empty line objects");
"error polling for events");
} else if (rv > 0) {
for (unsigned int i = 0; i < event_bulk.num_lines; i++)
- ret.add(line(event_bulk.lines[i], this->_m_bulk[i].get_chip()));
+ ret.append(line(event_bulk.lines[i], this->_m_bulk[i].get_chip()));
}
return ::std::move(ret);