diff options
Diffstat (limited to 'source/blender/depsgraph/intern/nodes/deg_node_component.h')
-rw-r--r-- | source/blender/depsgraph/intern/nodes/deg_node_component.h | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/source/blender/depsgraph/intern/nodes/deg_node_component.h b/source/blender/depsgraph/intern/nodes/deg_node_component.h index 7dec8eaaa90..969771a29c9 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_component.h +++ b/source/blender/depsgraph/intern/nodes/deg_node_component.h @@ -53,50 +53,38 @@ struct ComponentDepsNode : public DepsNode { struct OperationIDKey { eDepsOperation_Code opcode; - string name; - - - OperationIDKey() : - opcode(DEG_OPCODE_OPERATION), name("") - {} - OperationIDKey(eDepsOperation_Code opcode) : - opcode(opcode), name("") - {} - OperationIDKey(eDepsOperation_Code opcode, const string &name) : - opcode(opcode), name(name) - {} - - string identifier() const - { - char codebuf[5]; - BLI_snprintf(codebuf, sizeof(codebuf), "%d", opcode); - - return string("OperationIDKey(") + codebuf + ", " + name + ")"; - } - - bool operator==(const OperationIDKey &other) const - { - return (opcode == other.opcode) && (name == other.name); - } + const char *name; + int name_tag; + + OperationIDKey(); + OperationIDKey(eDepsOperation_Code opcode); + OperationIDKey(eDepsOperation_Code opcode, + const char *name, + int name_tag); + + string identifier() const; + bool operator==(const OperationIDKey &other) const; }; /* Typedef for container of operations */ ComponentDepsNode(); ~ComponentDepsNode(); - void init(const ID *id, const string &subdata); + void init(const ID *id, const char *subdata); string identifier() const; /* Find an existing operation, will throw an assert() if it does not exist. */ OperationDepsNode *find_operation(OperationIDKey key) const; OperationDepsNode *find_operation(eDepsOperation_Code opcode, - const string &name) const; + const char *name, + int name_tag) const; /* Check operation exists and return it. */ OperationDepsNode *has_operation(OperationIDKey key) const; OperationDepsNode *has_operation(eDepsOperation_Code opcode, - const string &name) const; + const char *name, + int name_tag) const; /** * Create a new node for representing an operation and add this to graph @@ -114,9 +102,9 @@ struct ComponentDepsNode : public DepsNode { OperationDepsNode *add_operation(eDepsOperation_Type optype, DepsEvalOperationCb op, eDepsOperation_Code opcode, - const string &name); + const char *name, + int name_tag); - void remove_operation(eDepsOperation_Code opcode, const string &name); void clear_operations(); void tag_update(Depsgraph *graph); @@ -194,7 +182,7 @@ struct PoseComponentDepsNode : public ComponentDepsNode { /* Bone Component */ struct BoneComponentDepsNode : public ComponentDepsNode { - void init(const ID *id, const string &subdata); + void init(const ID *id, const char *subdata); struct bPoseChannel *pchan; /* the bone that this component represents */ |