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>
void configure() override;
void prepare() override;
void invoke(ISingleoCommonData &input, bool async) override;
- const ISingleoOutputData &result() override;
+ const SingleoOutputData &result() override;
};
} // backends
#ifndef __MV_FD_OUTPUT_DATA_H__
#define __MV_FD_OUTPUT_DATA_H__
-#include "ISingleoOutputData.h"
+#include "SingleoOutputData.h"
namespace singleo
{
{
namespace backends
{
-class MvFdOutputData : public ISingleoOutputData
+class MvFdOutputData : public SingleoOutputData
{
private:
unsigned int _frame_number {};
void configure() override;
void prepare() override;
void invoke(ISingleoCommonData &input, bool async) override;
- const ISingleoOutputData &result() override;
+ const SingleoOutputData &result() override;
};
} // backends
#ifndef __MV_OD_OUTPUT_DATA_H__
#define __MV_OD_OUTPUT_DATA_H__
-#include "ISingleoOutputData.h"
+#include "SingleoOutputData.h"
namespace singleo
{
{
namespace backends
{
-class MvOdOutputData : public ISingleoOutputData
+class MvOdOutputData : public SingleoOutputData
{
private:
unsigned int _frame_number {};
throw runtime_error("Fail to destroy mv source.");
}
-const ISingleoOutputData &MvFaceDetection::result()
+const SingleoOutputData &MvFaceDetection::result()
{
unsigned long frame_number;
unsigned int result_cnt;
throw runtime_error("Fail to destroy mv source.");
}
-const ISingleoOutputData &MvObjectDetection::result()
+const SingleoOutputData &MvObjectDetection::result()
{
unsigned long frame_number;
unsigned int result_cnt;
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
#define __IINFERENCE_TASK_INTERFACE_H__
#include "ISingleoCommonData.h"
-#include "ISingleoOutputData.h"
+#include "SingleoOutputData.h"
namespace singleo
{
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
+++ /dev/null
-/**
- * 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
void configure() override;
void prepare() override;
void invoke(ISingleoCommonData &input, bool async = false) override;
- const ISingleoOutputData &result() override;
+ const SingleoOutputData &result() override;
};
} // inference
void configure() override;
void prepare() override;
void invoke(ISingleoCommonData &input, bool async = false) override;
- const ISingleoOutputData &result() override;
+ const SingleoOutputData &result() override;
};
} // inference
--- /dev/null
+/**
+ * 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
_task->invoke(input, async);
}
-const ISingleoOutputData &InferenceServiceDefault::result()
+const SingleoOutputData &InferenceServiceDefault::result()
{
return _task->result();
}
throw runtime_error("Not support yet.");
}
-const ISingleoOutputData &InferenceServiceExternal::result()
+const SingleoOutputData &InferenceServiceExternal::result()
{
throw runtime_error("Not support yet.");
}
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 {};