[Bf-blender-cvs] [6847bd4] depsgraph_refactor: Default constructors for depsnode keys.

Lukas Tönne noreply at git.blender.org
Thu Apr 17 15:32:36 CEST 2014


Commit: 6847bd475f5ba85b8bd2268d57e6479306b13b42
Author: Lukas Tönne
Date:   Thu Apr 17 15:04:21 2014 +0200
https://developer.blender.org/rB6847bd475f5ba85b8bd2268d57e6479306b13b42

Default constructors for depsnode keys.

These initialize members properly and will return NULL node pointers in
any case, so they automatically function as invalid keys, until assigned
proper values.

===================================================================

M	source/blender/depsgraph/intern/depsgraph_build.h

===================================================================

diff --git a/source/blender/depsgraph/intern/depsgraph_build.h b/source/blender/depsgraph/intern/depsgraph_build.h
index 68e87a4..afc6f7b 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.h
+++ b/source/blender/depsgraph/intern/depsgraph_build.h
@@ -104,23 +104,30 @@ private:
 
 struct RootKey
 {
+	RootKey() {}
 };
 
 struct TimeSourceKey
 {
-	TimeSourceKey(IDPtr id = NULL) : id(id) {}
+	TimeSourceKey() : id(NULL) {}
+	TimeSourceKey(IDPtr id) : id(id) {}
+	
 	IDPtr id;
 };
 
 struct IDKey
 {
+	IDKey() : id(NULL) {}
 	IDKey(IDPtr id) : id(id) {}
+	
 	IDPtr id;
 };
 
 struct ComponentKey
 {
+	ComponentKey() : id(NULL), type(DEPSNODE_TYPE_UNDEFINED), subdata("") {}
 	ComponentKey(IDPtr id, eDepsNode_Type type, const string &subdata = "") : id(id), type(type), subdata(subdata) {}
+	
 	IDPtr id;
 	eDepsNode_Type type;
 	string subdata;
@@ -128,12 +135,14 @@ struct ComponentKey
 
 struct OperationKey
 {
+	OperationKey() : id(NULL), component_subdata(""), type(DEPSNODE_TYPE_UNDEFINED), name("") {}
 	OperationKey(IDPtr id, eDepsNode_Type type, const string &name) :
 	    id(id), component_subdata(""), type(type), name(name)
 	{}
 	OperationKey(IDPtr id, const string &component_subdata, eDepsNode_Type type, const string &name) :
 	    id(id), component_subdata(component_subdata), type(type), name(name)
 	{}
+	
 	IDPtr id;
 	string component_subdata;
 	eDepsNode_Type type;




More information about the Bf-blender-cvs mailing list