[Bf-blender-cvs] [8133fb0fade] functions: cleanup

Jacques Lucke noreply at git.blender.org
Sun Feb 10 20:27:00 CET 2019


Commit: 8133fb0fade65507070364300bb28294488c063d
Author: Jacques Lucke
Date:   Sun Feb 10 12:38:11 2019 +0100
Branches: functions
https://developer.blender.org/rB8133fb0fade65507070364300bb28294488c063d

cleanup

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

M	source/blender/functions/core/cpu.hpp
M	source/blender/functions/core/data_flow_graph.hpp

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

diff --git a/source/blender/functions/core/cpu.hpp b/source/blender/functions/core/cpu.hpp
index 3c26323cc80..46754180723 100644
--- a/source/blender/functions/core/cpu.hpp
+++ b/source/blender/functions/core/cpu.hpp
@@ -62,9 +62,7 @@ namespace FN {
 
 	class Tuple {
 	public:
-		Tuple() = default;
-
-		Tuple(const SmallTypeVector &types)
+		Tuple(const SmallTypeVector &types = {})
 			: m_types(types)
 		{
 			int total_size = 0;
@@ -80,6 +78,9 @@ namespace FN {
 			m_data = std::malloc(total_size);
 		}
 
+		/* Has to be implemented explicitely in the future. */
+		Tuple(const Tuple &tuple) = delete;
+
 		~Tuple()
 		{
 			for (uint i = 0; i < m_types.size(); i++) {
@@ -146,7 +147,7 @@ namespace FN {
 			return (void *)((char *)m_data + m_offsets[index]);
 		}
 
-		const SmallTypeVector m_types;
+		SmallTypeVector m_types;
 		SmallVector<CPPTypeInfo *> m_type_info;
 		SmallVector<uint> m_offsets;
 		SmallVector<bool> m_initialized;
diff --git a/source/blender/functions/core/data_flow_graph.hpp b/source/blender/functions/core/data_flow_graph.hpp
index 00705044dc9..99f67fd04c2 100644
--- a/source/blender/functions/core/data_flow_graph.hpp
+++ b/source/blender/functions/core/data_flow_graph.hpp
@@ -18,7 +18,7 @@ namespace FN {
 		static inline Socket Output(const Node *node, uint index);
 
 		inline const Node *node() const;
-		inline const DataFlowGraph *graph() const;
+		inline DataFlowGraph *graph() const;
 
 		inline bool is_input() const;
 		inline bool is_output() const;
@@ -37,8 +37,8 @@ namespace FN {
 			: m_node(node), m_is_output(is_output), m_index(index) {}
 
 		const Node *m_node;
-		const bool m_is_output;
-		const uint m_index;
+		bool m_is_output;
+		uint m_index;
 	};
 
 
@@ -47,7 +47,7 @@ namespace FN {
 
 	class Node {
 	public:
-		Node(const DataFlowGraph *graph, const SharedFunction &function)
+		Node(DataFlowGraph *graph, SharedFunction &function)
 			: m_graph(graph), m_function(function) {}
 
 		Socket input(uint index) const
@@ -60,7 +60,7 @@ namespace FN {
 			return Socket::Output(this, index);
 		}
 
-		const DataFlowGraph *graph() const
+		DataFlowGraph *graph() const
 		{
 			return m_graph;
 		}
@@ -76,8 +76,8 @@ namespace FN {
 		}
 
 	private:
-		const DataFlowGraph *m_graph;
-		const SharedFunction m_function;
+		DataFlowGraph *m_graph;
+		SharedFunction m_function;
 	};
 
 	class Link {
@@ -112,8 +112,8 @@ namespace FN {
 		Link(Socket from, Socket to)
 			: m_from(from), m_to(to) {}
 
-		const Socket m_from;
-		const Socket m_to;
+		Socket m_from;
+		Socket m_to;
 	};
 
 	class GraphLinks {
@@ -171,7 +171,7 @@ namespace FN {
 			}
 		}
 
-		const Node *insert(const SharedFunction &function)
+		const Node *insert(SharedFunction &function)
 		{
 			BLI_assert(this->can_modify());
 			const Node *node = new Node(this, function);
@@ -248,7 +248,7 @@ namespace FN {
 		return m_node;
 	}
 
-	const DataFlowGraph *Socket::graph() const
+	DataFlowGraph *Socket::graph() const
 	{
 		return this->node()->graph();
 	}



More information about the Bf-blender-cvs mailing list