/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
processRun = true;
}
+ std::string_view GetProcessorName() const override
+ {
+ return "TestProcessor";
+ }
+
bool processRun;
};
}
}
+ std::string_view GetProcessorName() const override
+ {
+ return "NewTestProcessor";
+ }
+
void SetProcessorToUnregister(Integration::Processor* processor)
{
unregisterProcessor = processor;
END_TEST;
}
+
+int UtcDaliCoreProcessorGetProcessorName(void)
+{
+ // Test post-processor
+ TestApplication application;
+ Integration::Core& core = application.GetCore();
+
+ NewTestProcessor testProcessor1(core);
+ TestProcessor testProcessor2;
+
+ DALI_TEST_EQUALS(std::string(testProcessor1.GetProcessorName()), "NewTestProcessor", TEST_LOCATION);
+ DALI_TEST_EQUALS(std::string(testProcessor2.GetProcessorName()), "TestProcessor", TEST_LOCATION);
+
+ END_TEST;
+}
#define DALI_INTEGRATION_PROCESSOR_INTERFACE_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
+// EXTERNAL INCLUDES
+#include <string_view>
+
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
*/
virtual void Process(bool postProcessor = false) = 0;
+ /**
+ * @brief Get the name of this processor if we setup.
+ * @return The name of this processor.
+ */
+ virtual std::string_view GetProcessorName() const = 0;
+
protected:
/**
* Virtual protected destructor
{
if(!mProcessorUnregistered)
{
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ std::ostringstream stream;
+ stream << "[" << processor->GetProcessorName() << "]";
+ DALI_TRACE_BEGIN_WITH_MESSAGE(gTraceFilter, "DALI_CORE_RUN_PROCESSOR", stream.str().c_str());
+ }
+#endif
processor->Process(false);
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ std::ostringstream stream;
+ stream << "[" << processor->GetProcessorName() << "]";
+ DALI_TRACE_END_WITH_MESSAGE(gTraceFilter, "DALI_CORE_RUN_PROCESSOR", stream.str().c_str());
+ }
+#endif
}
else
{
auto iter = std::find(mProcessors.Begin(), mProcessors.End(), processor);
if(iter != mProcessors.End())
{
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ std::ostringstream stream;
+ stream << "[" << processor->GetProcessorName() << "]";
+ DALI_TRACE_BEGIN_WITH_MESSAGE(gTraceFilter, "DALI_CORE_RUN_PROCESSOR", stream.str().c_str());
+ }
+#endif
processor->Process(false);
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ std::ostringstream stream;
+ stream << "[" << processor->GetProcessorName() << "]";
+ DALI_TRACE_END_WITH_MESSAGE(gTraceFilter, "DALI_CORE_RUN_PROCESSOR", stream.str().c_str());
+ }
+#endif
}
}
}
{
if(!mPostProcessorUnregistered)
{
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ std::ostringstream stream;
+ stream << "[" << processor->GetProcessorName() << "]";
+ DALI_TRACE_BEGIN_WITH_MESSAGE(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSOR", stream.str().c_str());
+ }
+#endif
processor->Process(true);
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ std::ostringstream stream;
+ stream << "[" << processor->GetProcessorName() << "]";
+ DALI_TRACE_END_WITH_MESSAGE(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSOR", stream.str().c_str());
+ }
+#endif
}
else
{
auto iter = std::find(mPostProcessors.Begin(), mPostProcessors.End(), processor);
if(iter != mPostProcessors.End())
{
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ std::ostringstream stream;
+ stream << "[" << processor->GetProcessorName() << "]";
+ DALI_TRACE_BEGIN_WITH_MESSAGE(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSOR", stream.str().c_str());
+ }
+#endif
processor->Process(true);
+#ifdef TRACE_ENABLED
+ if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+ {
+ std::ostringstream stream;
+ stream << "[" << processor->GetProcessorName() << "]";
+ DALI_TRACE_END_WITH_MESSAGE(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSOR", stream.str().c_str());
+ }
+#endif
}
}
}