change ISingleoOutputData to SingleoOutputData
authorInki Dae <inki.dae@samsung.com>
Fri, 15 Mar 2024 01:06:31 +0000 (10:06 +0900)
committerInki Dae <inki.dae@samsung.com>
Wed, 20 Mar 2024 00:15:41 +0000 (09:15 +0900)
ISingleoOutputData class isn't interface class anymore.
So drop a prefix, 'I' from the class name.

Regarding this class, not clear to me and I'm pretty sure that
there is more better design for managing output data type and
to be able to generalize the various output data types.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
15 files changed:
inference/backends/mediavision/include/MvFaceDetection.h
inference/backends/mediavision/include/MvFdOutputData.h
inference/backends/mediavision/include/MvObjectDetection.h
inference/backends/mediavision/include/MvOdOutputData.h
inference/backends/mediavision/src/MvFaceDetection.cpp
inference/backends/mediavision/src/MvObjectDetection.cpp
inference/include/IInferenceServiceInterface.h
inference/include/IInferenceTaskInterface.h
inference/include/ISingleoOutputData.h [deleted file]
inference/include/InferenceServiceDefault.h
inference/include/InferenceServiceExternal.h
inference/include/SingleoOutputData.h [new file with mode: 0644]
inference/src/InferenceServiceDefault.cpp
inference/src/InferenceServiceExternal.cpp
services/auto_zoom/src/AutoZoom.cpp

index 271ab477c2e2e80b5e21b46ed3c4e3df5a4878a2..7bc9bd259ce7b3e079a1c14867c5939c00e9f5fb 100644 (file)
@@ -40,7 +40,7 @@ public:
        void configure() override;
        void prepare() override;
        void invoke(ISingleoCommonData &input, bool async) override;
-       const ISingleoOutputData &result() override;
+       const SingleoOutputData &result() override;
 };
 
 } // backends
index cc7b9e45d490a35b871b6cf57c2ed7cebd89b2fc..66d894e059df128868f21f667dde77846835f12f 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef __MV_FD_OUTPUT_DATA_H__
 #define __MV_FD_OUTPUT_DATA_H__
 
-#include "ISingleoOutputData.h"
+#include "SingleoOutputData.h"
 
 namespace singleo
 {
@@ -25,7 +25,7 @@ namespace inference
 {
 namespace backends
 {
-class MvFdOutputData : public ISingleoOutputData
+class MvFdOutputData : public SingleoOutputData
 {
 private:
        unsigned int _frame_number {};
index 6525c17aa471d00e5ce3d4c8d991f95ebba1ad1c..9e9b35fb1c2ad71e2c14114c85b86e00769140db 100644 (file)
@@ -40,7 +40,7 @@ public:
        void configure() override;
        void prepare() override;
        void invoke(ISingleoCommonData &input, bool async) override;
-       const ISingleoOutputData &result() override;
+       const SingleoOutputData &result() override;
 };
 
 } // backends
index 74e77091f0a0b5c087fdbb4187266a5748fbe0f2..f065e0dbb16430fcdbda8fae3c9bc95b81912df5 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef __MV_OD_OUTPUT_DATA_H__
 #define __MV_OD_OUTPUT_DATA_H__
 
-#include "ISingleoOutputData.h"
+#include "SingleoOutputData.h"
 
 namespace singleo
 {
@@ -25,7 +25,7 @@ namespace inference
 {
 namespace backends
 {
-class MvOdOutputData : public ISingleoOutputData
+class MvOdOutputData : public SingleoOutputData
 {
 private:
        unsigned int _frame_number {};
index 4e3086ed45a9117806b08bd39830aa4d2c4aec72..9a55efeda66b0d29a2df5f366cc8eb523a69dee5 100644 (file)
@@ -86,7 +86,7 @@ void MvFaceDetection::invoke(ISingleoCommonData &input, bool async)
                throw runtime_error("Fail to destroy mv source.");
 }
 
-const ISingleoOutputData &MvFaceDetection::result()
+const SingleoOutputData &MvFaceDetection::result()
 {
        unsigned long frame_number;
        unsigned int result_cnt;
index 517c233bf8c0201d82d93df7203af6b5704af474..44af54e6b71f67becde603575cce7aecfab16b02 100644 (file)
@@ -86,7 +86,7 @@ void MvObjectDetection::invoke(ISingleoCommonData &input, bool async)
                throw runtime_error("Fail to destroy mv source.");
 }
 
-const ISingleoOutputData &MvObjectDetection::result()
+const SingleoOutputData &MvObjectDetection::result()
 {
        unsigned long frame_number;
        unsigned int result_cnt;
index 1a875dc4efd0cfa5db0a28ac9e988cf553a5ba8d..a093d4335cb1d49b2069a64fd3446947eaf57c23 100644 (file)
@@ -32,7 +32,7 @@ public:
        virtual void configure() = 0;
        virtual void prepare() = 0;
        virtual void invoke(ISingleoCommonData &input, bool async = false) = 0;
-       virtual const ISingleoOutputData &result() = 0;
+       virtual const SingleoOutputData &result() = 0;
 };
 
 } // inference
index d50ca5cda397d1efaf9d075701e0e4a793e7fb5b..651dd2c46d23e0ef9a2a4267d1f6bf83e88e2a8d 100644 (file)
@@ -18,7 +18,7 @@
 #define __IINFERENCE_TASK_INTERFACE_H__
 
 #include "ISingleoCommonData.h"
-#include "ISingleoOutputData.h"
+#include "SingleoOutputData.h"
 
 namespace singleo
 {
@@ -32,7 +32,7 @@ public:
        virtual void configure() = 0;
        virtual void prepare() = 0;
        virtual void invoke(ISingleoCommonData &input, bool async = false) = 0;
-       virtual const ISingleoOutputData &result() = 0;
+       virtual const SingleoOutputData &result() = 0;
 };
 
 } // inference
diff --git a/inference/include/ISingleoOutputData.h b/inference/include/ISingleoOutputData.h
deleted file mode 100644 (file)
index ab74084..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-#ifndef __ISINGLEO_OUTPUT_DATA_H__
-#define __ISINGLEO_OUTPUT_DATA_H__
-
-#include "SingleoCommonTypes.h"
-#include "SingleoException.h"
-
-namespace singleo
-{
-namespace inference
-{
-class ISingleoOutputData
-{
-public:
-       virtual ~ISingleoOutputData() = default;
-
-       virtual void clear() = 0;
-       virtual unsigned int getFrameNumber() const = 0;
-       virtual const std::vector<OdResultType> &getOdResult() const
-       {
-               throw exception::InvalidOperation("Not supported.");
-       }
-       virtual const std::vector<FdResultType> &getFdResult() const
-       {
-               throw exception::InvalidOperation("Not supported.");
-       }
-};
-
-} // inference
-} // singleo
-
-#endif
\ No newline at end of file
index a27eb6b5253748f3b5f08286e6c74e42e25a410a..c229aed88fc4629b30dfba8fba78cb628381aa07 100644 (file)
@@ -38,7 +38,7 @@ public:
        void configure() override;
        void prepare() override;
        void invoke(ISingleoCommonData &input, bool async = false) override;
-       const ISingleoOutputData &result() override;
+       const SingleoOutputData &result() override;
 };
 
 } // inference
index c627f421eaf44e6dea92670b49db58c0bfed2f46..4fa101280d5c24c5310db50f71fc3242f45ec6cb 100644 (file)
@@ -34,7 +34,7 @@ public:
        void configure() override;
        void prepare() override;
        void invoke(ISingleoCommonData &input, bool async = false) override;
-       const ISingleoOutputData &result() override;
+       const SingleoOutputData &result() override;
 };
 
 } // inference
diff --git a/inference/include/SingleoOutputData.h b/inference/include/SingleoOutputData.h
new file mode 100644 (file)
index 0000000..6a8bca8
--- /dev/null
@@ -0,0 +1,48 @@
+/**
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#ifndef __ISINGLEO_OUTPUT_DATA_H__
+#define __ISINGLEO_OUTPUT_DATA_H__
+
+#include "SingleoCommonTypes.h"
+#include "SingleoException.h"
+
+namespace singleo
+{
+namespace inference
+{
+class SingleoOutputData
+{
+public:
+       SingleoOutputData() = default;
+       virtual ~SingleoOutputData() = default;
+
+       virtual void clear() = 0;
+       virtual unsigned int getFrameNumber() const = 0;
+       virtual const std::vector<OdResultType> &getOdResult() const
+       {
+               throw exception::InvalidOperation("Not supported.");
+       }
+       virtual const std::vector<FdResultType> &getFdResult() const
+       {
+               throw exception::InvalidOperation("Not supported.");
+       }
+};
+
+} // inference
+} // singleo
+
+#endif
\ No newline at end of file
index bfaf6e6953894a48211b83f0a4a6a4ce3974d271..02ba4f40f31987cc8ae99f424132f066b31fb6d3 100644 (file)
@@ -59,7 +59,7 @@ void InferenceServiceDefault::invoke(ISingleoCommonData &input, bool async)
        _task->invoke(input, async);
 }
 
-const ISingleoOutputData &InferenceServiceDefault::result()
+const SingleoOutputData &InferenceServiceDefault::result()
 {
        return _task->result();
 }
index eec84a70c7ee36a0993a8f60127750fc9eb9146d..0a9089aa2753d6442a2e76e2f7b7e78ed8ce07bc 100644 (file)
@@ -43,7 +43,7 @@ void InferenceServiceExternal::invoke(ISingleoCommonData &input, bool async)
        throw runtime_error("Not support yet.");
 }
 
-const ISingleoOutputData &InferenceServiceExternal::result()
+const SingleoOutputData &InferenceServiceExternal::result()
 {
        throw runtime_error("Not support yet.");
 }
index 6d606366a801b513b60e7b170a41838fd588d55e..1c0500b43e0ee02985d64ee20ea55d4058e1bc24 100644 (file)
@@ -146,7 +146,7 @@ void AutoZoom::performAsync()
 
 void AutoZoom::updateResult()
 {
-       const ISingleoOutputData &output_data = _inference_service->result();
+       auto &output_data = _inference_service->result();
        unsigned int frame_number = output_data.getFrameNumber();
        Rect rect;
        size_t result_cnt {};