Depsgraph: Make has_ prefixed function to return boolean
This commit is contained in:
@@ -190,9 +190,9 @@ OperationDepsNode *DepsgraphNodeBuilder::add_operation_node(
|
||||
const char *name,
|
||||
int name_tag)
|
||||
{
|
||||
OperationDepsNode *op_node = comp_node->has_operation(opcode,
|
||||
name,
|
||||
name_tag);
|
||||
OperationDepsNode *op_node = comp_node->find_operation(opcode,
|
||||
name,
|
||||
name_tag);
|
||||
if (op_node == NULL) {
|
||||
op_node = comp_node->add_operation(op, opcode, name, name_tag);
|
||||
graph_->operations.push_back(op_node);
|
||||
@@ -262,7 +262,7 @@ OperationDepsNode *DepsgraphNodeBuilder::find_operation_node(
|
||||
int name_tag)
|
||||
{
|
||||
ComponentDepsNode *comp_node = add_component_node(id, comp_type, comp_name);
|
||||
return comp_node->has_operation(opcode, name, name_tag);
|
||||
return comp_node->find_operation(opcode, name, name_tag);
|
||||
}
|
||||
|
||||
OperationDepsNode *DepsgraphNodeBuilder::find_operation_node(
|
||||
|
||||
@@ -293,7 +293,7 @@ OperationDepsNode *DepsgraphRelationBuilder::has_node(
|
||||
if (!comp_node) {
|
||||
return NULL;
|
||||
}
|
||||
return comp_node->has_operation(key.opcode, key.name, key.name_tag);
|
||||
return comp_node->find_operation(key.opcode, key.name, key.name_tag);
|
||||
}
|
||||
|
||||
void DepsgraphRelationBuilder::add_time_relation(TimeSourceDepsNode *timesrc,
|
||||
|
||||
@@ -198,14 +198,14 @@ OperationDepsNode *ComponentDepsNode::get_operation(eDepsOperation_Code opcode,
|
||||
return get_operation(key);
|
||||
}
|
||||
|
||||
OperationDepsNode *ComponentDepsNode::has_operation(OperationIDKey key) const
|
||||
bool ComponentDepsNode::has_operation(OperationIDKey key) const
|
||||
{
|
||||
return reinterpret_cast<OperationDepsNode *>(BLI_ghash_lookup(operations_map, &key));
|
||||
return find_operation(key) != NULL;
|
||||
}
|
||||
|
||||
OperationDepsNode *ComponentDepsNode::has_operation(eDepsOperation_Code opcode,
|
||||
const char *name,
|
||||
int name_tag) const
|
||||
bool ComponentDepsNode::has_operation(eDepsOperation_Code opcode,
|
||||
const char *name,
|
||||
int name_tag) const
|
||||
{
|
||||
OperationIDKey key(opcode, name, name_tag);
|
||||
return has_operation(key);
|
||||
@@ -216,7 +216,7 @@ OperationDepsNode *ComponentDepsNode::add_operation(const DepsEvalOperationCb& o
|
||||
const char *name,
|
||||
int name_tag)
|
||||
{
|
||||
OperationDepsNode *op_node = has_operation(opcode, name, name_tag);
|
||||
OperationDepsNode *op_node = find_operation(opcode, name, name_tag);
|
||||
if (!op_node) {
|
||||
DepsNodeFactory *factory = deg_get_node_factory(DEG_NODE_TYPE_OPERATION);
|
||||
op_node = (OperationDepsNode *)factory->create_node(this->owner->id, "", name);
|
||||
|
||||
@@ -89,10 +89,10 @@ struct ComponentDepsNode : public DepsNode {
|
||||
int name_tag) const;
|
||||
|
||||
/* Check operation exists and return it. */
|
||||
OperationDepsNode *has_operation(OperationIDKey key) const;
|
||||
OperationDepsNode *has_operation(eDepsOperation_Code opcode,
|
||||
const char *name,
|
||||
int name_tag) const;
|
||||
bool has_operation(OperationIDKey key) const;
|
||||
bool has_operation(eDepsOperation_Code opcode,
|
||||
const char *name,
|
||||
int name_tag) const;
|
||||
|
||||
/**
|
||||
* Create a new node for representing an operation and add this to graph
|
||||
|
||||
Reference in New Issue
Block a user