From 6c4e3e3892503a9d42a5d97a6f97f98bdbf63129 Mon Sep 17 00:00:00 2001
From: Antoine Regimbeau <antoine.regimbeau@c-s.fr>
Date: Thu, 22 Feb 2018 13:48:54 +0100
Subject: [PATCH] BUG: Split otbWrapperInputImageParameter.cxx file into
 several one to limit memory usage during compilation

---
 .../ApplicationEngine/src/CMakeLists.txt      | 11 +++++++
 .../src/otbWrapperInputImageParameter.cxx     | 12 -------
 .../otbWrapperInputImageParameterCDouble.cxx  | 33 +++++++++++++++++++
 .../otbWrapperInputImageParameterCFloat.cxx   | 33 +++++++++++++++++++
 .../otbWrapperInputImageParameterCInt16.cxx   | 33 +++++++++++++++++++
 .../otbWrapperInputImageParameterCInt32.cxx   | 33 +++++++++++++++++++
 .../otbWrapperInputImageParameterDouble.cxx   | 33 +++++++++++++++++++
 .../otbWrapperInputImageParameterFloat.cxx    | 33 +++++++++++++++++++
 .../otbWrapperInputImageParameterInt16.cxx    | 33 +++++++++++++++++++
 .../otbWrapperInputImageParameterInt32.cxx    | 33 +++++++++++++++++++
 .../otbWrapperInputImageParameterUInt16.cxx   | 33 +++++++++++++++++++
 .../otbWrapperInputImageParameterUInt32.cxx   | 33 +++++++++++++++++++
 .../otbWrapperInputImageParameterUInt8.cxx    | 33 +++++++++++++++++++
 13 files changed, 374 insertions(+), 12 deletions(-)
 create mode 100644 Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterCDouble.cxx
 create mode 100644 Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterCFloat.cxx
 create mode 100644 Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterCInt16.cxx
 create mode 100644 Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterCInt32.cxx
 create mode 100644 Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterDouble.cxx
 create mode 100644 Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterFloat.cxx
 create mode 100644 Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterInt16.cxx
 create mode 100644 Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterInt32.cxx
 create mode 100644 Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt16.cxx
 create mode 100644 Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt32.cxx
 create mode 100644 Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt8.cxx

diff --git a/Modules/Wrappers/ApplicationEngine/src/CMakeLists.txt b/Modules/Wrappers/ApplicationEngine/src/CMakeLists.txt
index 45d0427a49..db3f434b5f 100644
--- a/Modules/Wrappers/ApplicationEngine/src/CMakeLists.txt
+++ b/Modules/Wrappers/ApplicationEngine/src/CMakeLists.txt
@@ -31,6 +31,17 @@ set( OTBApplicationEngine_SRC
   otbWrapperInputFilenameListParameter.cxx
   otbWrapperOutputImageParameter.cxx
   otbWrapperInputImageParameter.cxx
+  otbWrapperInputImageParameterUInt8.cxx
+  otbWrapperInputImageParameterUInt16.cxx
+  otbWrapperInputImageParameterUInt32.cxx
+  otbWrapperInputImageParameterInt16.cxx
+  otbWrapperInputImageParameterInt32.cxx
+  otbWrapperInputImageParameterCInt16.cxx
+  otbWrapperInputImageParameterCInt32.cxx
+  otbWrapperInputImageParameterCFloat.cxx
+  otbWrapperInputImageParameterCDouble.cxx
+  otbWrapperInputImageParameterFloat.cxx
+  otbWrapperInputImageParameterDouble.cxx
   otbWrapperParameterKey.cxx
   otbWrapperDocExampleStructure.cxx
   otbWrapperInputVectorDataParameter.cxx
diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameter.cxx
index fe226ef2ff..96b315b050 100644
--- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameter.cxx
+++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameter.cxx
@@ -70,18 +70,6 @@ InputImageParameter::GetImage()
 
 otbGetImageMacro(UInt8RGBImage);
 otbGetImageMacro(UInt8RGBAImage);
-otbGetImageAndVectorImageMacro(UInt8);
-otbGetImageAndVectorImageMacro(UInt16);
-otbGetImageAndVectorImageMacro(UInt32);
-otbGetImageAndVectorImageMacro(Int16);
-otbGetImageAndVectorImageMacro(Int32);
-otbGetImageAndVectorImageMacro(Float);
-otbGetImageAndVectorImageMacro(Double);
-otbGetImageAndVectorImageMacro(ComplexInt16);
-otbGetImageAndVectorImageMacro(ComplexInt32);
-otbGetImageAndVectorImageMacro(ComplexFloat);
-otbGetImageAndVectorImageMacro(ComplexDouble);
-
 
 void
 InputImageParameter::SetImage(FloatVectorImageType* image)
diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterCDouble.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterCDouble.cxx
new file mode 100644
index 0000000000..0ab35a7de9
--- /dev/null
+++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterCDouble.cxx
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
+ *
+ * This file is part of Orfeo Toolbox
+ *
+ *     https://www.orfeo-toolbox.org/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "otbWrapperInputImageParameter.h"
+#include "otbWrapperInputImageParameterMacros.h"
+#include "itksys/SystemTools.hxx"
+#include "otbWrapperTypes.h"
+#include "otb_boost_string_header.h"
+
+namespace otb
+{
+namespace Wrapper
+{
+otbGetImageAndVectorImageMacro(ComplexDouble);
+}
+}
diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterCFloat.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterCFloat.cxx
new file mode 100644
index 0000000000..454b8abb56
--- /dev/null
+++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterCFloat.cxx
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
+ *
+ * This file is part of Orfeo Toolbox
+ *
+ *     https://www.orfeo-toolbox.org/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "otbWrapperInputImageParameter.h"
+#include "otbWrapperInputImageParameterMacros.h"
+#include "itksys/SystemTools.hxx"
+#include "otbWrapperTypes.h"
+#include "otb_boost_string_header.h"
+
+namespace otb
+{
+namespace Wrapper
+{
+otbGetImageAndVectorImageMacro(ComplexFloat);
+}
+}
diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterCInt16.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterCInt16.cxx
new file mode 100644
index 0000000000..c6de185a12
--- /dev/null
+++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterCInt16.cxx
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
+ *
+ * This file is part of Orfeo Toolbox
+ *
+ *     https://www.orfeo-toolbox.org/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "otbWrapperInputImageParameter.h"
+#include "otbWrapperInputImageParameterMacros.h"
+#include "itksys/SystemTools.hxx"
+#include "otbWrapperTypes.h"
+#include "otb_boost_string_header.h"
+
+namespace otb
+{
+namespace Wrapper
+{
+otbGetImageAndVectorImageMacro(ComplexInt16);
+}
+}
\ No newline at end of file
diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterCInt32.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterCInt32.cxx
new file mode 100644
index 0000000000..d6cbab06f1
--- /dev/null
+++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterCInt32.cxx
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
+ *
+ * This file is part of Orfeo Toolbox
+ *
+ *     https://www.orfeo-toolbox.org/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "otbWrapperInputImageParameter.h"
+#include "otbWrapperInputImageParameterMacros.h"
+#include "itksys/SystemTools.hxx"
+#include "otbWrapperTypes.h"
+#include "otb_boost_string_header.h"
+
+namespace otb
+{
+namespace Wrapper
+{
+otbGetImageAndVectorImageMacro(ComplexInt32);
+}
+}
diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterDouble.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterDouble.cxx
new file mode 100644
index 0000000000..b3b6ec7d51
--- /dev/null
+++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterDouble.cxx
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
+ *
+ * This file is part of Orfeo Toolbox
+ *
+ *     https://www.orfeo-toolbox.org/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "otbWrapperInputImageParameter.h"
+#include "otbWrapperInputImageParameterMacros.h"
+#include "itksys/SystemTools.hxx"
+#include "otbWrapperTypes.h"
+#include "otb_boost_string_header.h"
+
+namespace otb
+{
+namespace Wrapper
+{
+otbGetImageAndVectorImageMacro(Double);
+}
+}
diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterFloat.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterFloat.cxx
new file mode 100644
index 0000000000..77dab91387
--- /dev/null
+++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterFloat.cxx
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
+ *
+ * This file is part of Orfeo Toolbox
+ *
+ *     https://www.orfeo-toolbox.org/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "otbWrapperInputImageParameter.h"
+#include "otbWrapperInputImageParameterMacros.h"
+#include "itksys/SystemTools.hxx"
+#include "otbWrapperTypes.h"
+#include "otb_boost_string_header.h"
+
+namespace otb
+{
+namespace Wrapper
+{
+otbGetImageAndVectorImageMacro(Float);
+}
+}
diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterInt16.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterInt16.cxx
new file mode 100644
index 0000000000..4b645f1560
--- /dev/null
+++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterInt16.cxx
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
+ *
+ * This file is part of Orfeo Toolbox
+ *
+ *     https://www.orfeo-toolbox.org/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "otbWrapperInputImageParameter.h"
+#include "otbWrapperInputImageParameterMacros.h"
+#include "itksys/SystemTools.hxx"
+#include "otbWrapperTypes.h"
+#include "otb_boost_string_header.h"
+
+namespace otb
+{
+namespace Wrapper
+{
+otbGetImageAndVectorImageMacro(Int16);
+}
+}
diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterInt32.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterInt32.cxx
new file mode 100644
index 0000000000..66b6e3fa89
--- /dev/null
+++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterInt32.cxx
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
+ *
+ * This file is part of Orfeo Toolbox
+ *
+ *     https://www.orfeo-toolbox.org/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "otbWrapperInputImageParameter.h"
+#include "otbWrapperInputImageParameterMacros.h"
+#include "itksys/SystemTools.hxx"
+#include "otbWrapperTypes.h"
+#include "otb_boost_string_header.h"
+
+namespace otb
+{
+namespace Wrapper
+{
+otbGetImageAndVectorImageMacro(Int32);
+}
+}
diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt16.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt16.cxx
new file mode 100644
index 0000000000..89dcd5b648
--- /dev/null
+++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt16.cxx
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
+ *
+ * This file is part of Orfeo Toolbox
+ *
+ *     https://www.orfeo-toolbox.org/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "otbWrapperInputImageParameter.h"
+#include "otbWrapperInputImageParameterMacros.h"
+#include "itksys/SystemTools.hxx"
+#include "otbWrapperTypes.h"
+#include "otb_boost_string_header.h"
+
+namespace otb
+{
+namespace Wrapper
+{
+otbGetImageAndVectorImageMacro(UInt16);
+}
+}
diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt32.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt32.cxx
new file mode 100644
index 0000000000..2df611b114
--- /dev/null
+++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt32.cxx
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
+ *
+ * This file is part of Orfeo Toolbox
+ *
+ *     https://www.orfeo-toolbox.org/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "otbWrapperInputImageParameter.h"
+#include "otbWrapperInputImageParameterMacros.h"
+#include "itksys/SystemTools.hxx"
+#include "otbWrapperTypes.h"
+#include "otb_boost_string_header.h"
+
+namespace otb
+{
+namespace Wrapper
+{
+otbGetImageAndVectorImageMacro(UInt32);
+}
+}
diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt8.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt8.cxx
new file mode 100644
index 0000000000..9f1c38e815
--- /dev/null
+++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt8.cxx
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
+ *
+ * This file is part of Orfeo Toolbox
+ *
+ *     https://www.orfeo-toolbox.org/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "otbWrapperInputImageParameter.h"
+#include "otbWrapperInputImageParameterMacros.h"
+#include "itksys/SystemTools.hxx"
+#include "otbWrapperTypes.h"
+#include "otb_boost_string_header.h"
+
+namespace otb
+{
+namespace Wrapper
+{
+otbGetImageAndVectorImageMacro(UInt8);
+}
+}
-- 
GitLab