Skip to content
Snippets Groups Projects
Commit 7a4295f7 authored by Oliver Heidmann's avatar Oliver Heidmann Committed by Uwe Schulzweida
Browse files

fixed Node::is_done not returning false on variable input operators

parent f675344f
No related branches found
No related tags found
2 merge requests!137fixed operator-nodes not being removed properly from the stack,!136fixed operator-nodes not being removed properly from the stack
......@@ -2,7 +2,6 @@
#include "cdo_output.h"
#include "cdo_node_attach_exception.h"
Node::Node(std::vector<std::string>::const_iterator p_iter, const std::string &p_oper, const std::string &args,
module_constraints p_constraints)
: iter(p_iter), oper(p_oper), arguments(args), constraints(p_constraints), isFile(false), isOutFile(false)
......@@ -31,19 +30,19 @@ Node::has_missing_input()
return true;
}
//Returns True for files and operators that have the required number of inputs
//Variable input operators always return false
//0 Input operators always return true becaus children.size() == 0
// Returns True for files and operators that have the required number of inputs
// Variable input operators always return false
// 0 Input operators always return true becaus children.size() == 0
bool
Node::is_done()
{
bool done = false;
if (isFile && !isOutFile) { done = true; }
else if ((int) children.size() == constraints.streamInCnt)
{
done = true;
}
if (constraints.streamInCnt == -1) { done = false; } // varibale inputs always false
else if (isFile && !isOutFile) { done = true; } // files always true
else if ((int) children.size() == constraints.streamInCnt) { done = true; }
Debug(CDO_NODE, "%s is done: %s", oper, done ? "true" : "false");
return done;
}
......@@ -58,10 +57,7 @@ Node::append(std::shared_ptr<Node> &node)
{
throw NodeAttachException(iter, errmsg_node_to_many_inputs);
}
if (node->numOut() == 0)
{
throw NodeAttachException(node, errmsg_node_no_output);
}
if (node->numOut() == 0) { throw NodeAttachException(node, errmsg_node_no_output); }
if (get_restriction() == PositionRestrictions::FilesOnly && !node->isFile)
{
size_t start = ((*iter)[0] == '-') ? 1 : 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment