genesys: Add a way to push constructed nodes to pipeline

merge-requests/244/head
Povilas Kanapickas 2020-05-23 10:39:05 +03:00
rodzic afa798d71a
commit fe323f19cb
1 zmienionych plików z 15 dodań i 3 usunięć

Wyświetl plik

@ -585,19 +585,31 @@ public:
template<class Node, class... Args>
void push_first_node(Args&&... args)
{
push_first_node(std::unique_ptr<Node>(new Node(std::forward<Args>(args)...)));
}
template<class Node>
void push_first_node(std::unique_ptr<Node>&& node)
{
if (!nodes_.empty()) {
throw SaneException("Trying to append first node when there are existing nodes");
}
nodes_.emplace_back(std::unique_ptr<Node>(new Node(std::forward<Args>(args)...)));
nodes_.emplace_back(std::move(node));
}
template<class Node, class... Args>
void push_node(Args&&... args)
{
ensure_node_exists();
nodes_.emplace_back(std::unique_ptr<Node>(new Node(*nodes_.back(),
std::forward<Args>(args)...)));
push_node(std::unique_ptr<Node>(new Node(*nodes_.back(), std::forward<Args>(args)...)));
}
template<class Node, class... Args>
void push_node(std::unique_ptr<Node>&& node)
{
ensure_node_exists();
nodes_.emplace_back(std::move(node));
}
bool get_next_row_data(std::uint8_t* out_data)