[Bf-blender-cvs] [1bde9ab004a] functions: remove signature and paramter classes

Jacques Lucke noreply at git.blender.org
Fri May 17 12:05:05 CEST 2019


Commit: 1bde9ab004a22a70f65e914a7a5dd779a51fe62e
Author: Jacques Lucke
Date:   Fri May 17 12:02:22 2019 +0200
Branches: functions
https://developer.blender.org/rB1bde9ab004a22a70f65e914a7a5dd779a51fe62e

remove signature and paramter classes

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

M	source/blender/functions/CMakeLists.txt
M	source/blender/functions/FN_core.hpp
M	source/blender/functions/core/function.hpp
D	source/blender/functions/core/parameter.cpp
D	source/blender/functions/core/parameter.hpp
D	source/blender/functions/core/signature.cpp
D	source/blender/functions/core/signature.hpp

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

diff --git a/source/blender/functions/CMakeLists.txt b/source/blender/functions/CMakeLists.txt
index e1f0416729e..4d437421457 100644
--- a/source/blender/functions/CMakeLists.txt
+++ b/source/blender/functions/CMakeLists.txt
@@ -37,10 +37,6 @@ set(SRC
   initialize.cpp
 
   core/type.hpp
-  core/parameter.hpp
-  core/parameter.cpp
-  core/signature.hpp
-  core/signature.cpp
   core/function.hpp
   core/function.cpp
   core/data_flow_graph.hpp
diff --git a/source/blender/functions/FN_core.hpp b/source/blender/functions/FN_core.hpp
index 5f312056922..e3cab7046b4 100644
--- a/source/blender/functions/FN_core.hpp
+++ b/source/blender/functions/FN_core.hpp
@@ -2,8 +2,6 @@
 
 #include "FN_core-c.h"
 #include "core/type.hpp"
-#include "core/parameter.hpp"
-#include "core/signature.hpp"
 #include "core/function.hpp"
 #include "core/source_info.hpp"
 #include "core/function_graph.hpp"
diff --git a/source/blender/functions/core/function.hpp b/source/blender/functions/core/function.hpp
index fdd9094c5d0..18f180fbafb 100644
--- a/source/blender/functions/core/function.hpp
+++ b/source/blender/functions/core/function.hpp
@@ -1,6 +1,6 @@
 #pragma once
 
-#include "signature.hpp"
+#include "type.hpp"
 
 namespace FN {
 
diff --git a/source/blender/functions/core/parameter.cpp b/source/blender/functions/core/parameter.cpp
deleted file mode 100644
index 9a1c7f280e4..00000000000
--- a/source/blender/functions/core/parameter.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "parameter.hpp"
-
-namespace FN {
-
-void Parameter::print() const
-{
-  std::cout << this->type()->name() << " - " << this->name();
-}
-
-} /* namespace FN */
diff --git a/source/blender/functions/core/parameter.hpp b/source/blender/functions/core/parameter.hpp
deleted file mode 100644
index fdad1771f60..00000000000
--- a/source/blender/functions/core/parameter.hpp
+++ /dev/null
@@ -1,52 +0,0 @@
-#pragma once
-
-#include "type.hpp"
-
-namespace FN {
-
-class Parameter {
- public:
-  Parameter(StringRef name, const SharedType &type) : m_name(name.to_std_string()), m_type(type)
-  {
-  }
-
-  const StringRefNull name() const
-  {
-    return m_name;
-  }
-
-  SharedType type() const
-  {
-    return m_type;
-  }
-
-  SharedType &type()
-  {
-    return m_type;
-  }
-
-  void print() const;
-
- private:
-  const std::string m_name;
-  SharedType m_type;
-};
-
-class InputParameter final : public Parameter {
- public:
-  InputParameter(StringRef name, const SharedType &type) : Parameter(name, type)
-  {
-  }
-};
-
-class OutputParameter final : public Parameter {
- public:
-  OutputParameter(StringRef name, const SharedType &type) : Parameter(name, type)
-  {
-  }
-};
-
-using InputParameters = SmallVector<InputParameter>;
-using OutputParameters = SmallVector<OutputParameter>;
-
-} /* namespace FN */
diff --git a/source/blender/functions/core/signature.cpp b/source/blender/functions/core/signature.cpp
deleted file mode 100644
index f49c2aff74b..00000000000
--- a/source/blender/functions/core/signature.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "signature.hpp"
-
-namespace FN {
-
-TypeVector Signature::input_types() const
-{
-  TypeVector types;
-  for (const InputParameter &param : this->inputs()) {
-    types.append(param.type());
-  }
-  return types;
-}
-
-TypeVector Signature::output_types() const
-{
-  TypeVector types;
-  for (const OutputParameter &param : this->outputs()) {
-    types.append(param.type());
-  }
-  return types;
-}
-
-bool Signature::has_interface(const TypeVector &inputs, const TypeVector &outputs) const
-{
-  return (true && TypeVector::all_equal(this->input_types(), inputs) &&
-          TypeVector::all_equal(this->output_types(), outputs));
-}
-
-bool Signature::has_interface(const Signature &other) const
-{
-  return this->has_interface(other.input_types(), other.output_types());
-}
-
-} /* namespace FN */
diff --git a/source/blender/functions/core/signature.hpp b/source/blender/functions/core/signature.hpp
deleted file mode 100644
index fc6f225aefc..00000000000
--- a/source/blender/functions/core/signature.hpp
+++ /dev/null
@@ -1,39 +0,0 @@
-#pragma once
-
-#include "parameter.hpp"
-
-namespace FN {
-
-class Signature {
- public:
-  Signature() = default;
-  ~Signature() = default;
-
-  Signature(const InputParameters &inputs, const OutputParameters &outputs)
-      : m_inputs(inputs), m_outputs(outputs)
-  {
-  }
-
-  inline const InputParameters &inputs() const
-  {
-    return m_inputs;
-  }
-
-  inline const OutputParameters &outputs() const
-  {
-    return m_outputs;
-  }
-
-  TypeVector input_types() const;
-  TypeVector output_types() const;
-
-  bool has_interface(const TypeVector &inputs, const TypeVector &outputs) const;
-
-  bool has_interface(const Signature &other) const;
-
- private:
-  const InputParameters m_inputs;
-  const OutputParameters m_outputs;
-};
-
-} /* namespace FN */



More information about the Bf-blender-cvs mailing list