#include <dali/public-api/adaptor-framework/window.h>
#include <dali/public-api/adaptor-framework/application-configuration.h>
+#ifdef DALI_ADAPTOR_COMPILATION
+#include <dali/integration-api/log-factory-interface.h>
+#else
+#include <dali/integration-api/adaptors/log-factory-interface.h>
+#endif
+
namespace Dali
{
*/
void RenderOnce();
+ /**
+ * @brief The log factory allows installation of a logger function in worker threads.
+ * @return An interface to a logging factory
+ */
+ const LogFactoryInterface& GetLogFactory();
+
public: // Signals
/**
adaptor_integration_api_header_files = \
$(adaptor_integration_api_dir)/adaptor.h \
$(adaptor_integration_api_dir)/egl-interface.h \
+ $(adaptor_integration_api_dir)/log-factory-interface.h \
$(adaptor_integration_api_dir)/thread-synchronization-interface.h \
$(adaptor_integration_api_dir)/trigger-event-interface.h \
$(adaptor_integration_api_dir)/trigger-event-factory-interface.h \
--- /dev/null
+#ifndef DALI_ADAPTOR_LOG_FACTORY_INTERFACE_H
+#define DALI_ADAPTOR_LOG_FACTORY_INTERFACE_H
+
+/*
+ * Copyright (c) 2017 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.
+ * 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.
+ */
+
+namespace Dali
+{
+
+class LogFactoryInterface
+{
+public:
+ /**
+ * @brief Install a log function for this thread.
+ *
+ * Only need to use once per thread, before any processing occurs.
+ */
+ virtual void InstallLogFunction() const = 0;
+};
+
+} // namespace Dali
+
+
+#endif //DALI_ADAPTOR_LOG_FACTORY_INTERFACE_H
RequestUpdateOnce();
}
+const LogFactoryInterface& Adaptor::GetLogFactory()
+{
+ return *mEnvironmentOptions;
+}
+
void Adaptor::RequestUpdateOnce()
{
if( mThreadController )
*/
void RenderOnce();
+ /**
+ * @copydoc Dali::Adaptor::GetLogFactory
+ */
+ const LogFactoryInterface& GetLogFactory();
+
public: //AdaptorInternalServices
/**
mImpl->RenderOnce();
}
+const LogFactoryInterface& Adaptor::GetLogFactory()
+{
+ return mImpl->GetLogFactory();
+}
+
Adaptor::Adaptor()
: mImpl( NULL )
{
// INTERNAL INCLUDES
#include <dali/internal/adaptor/common/threading-mode.h>
+#include <dali/integration-api/log-factory-interface.h>
namespace Dali
{
* the ability to install a log function.
*
*/
-class EnvironmentOptions
+class EnvironmentOptions : public Dali::LogFactoryInterface
{
public:
EnvironmentOptions();
/**
- * non-virtual destructor, not intended as a base class
+ * Virtual Destructor for interface cleanup
*/
- ~EnvironmentOptions();
+ virtual ~EnvironmentOptions();
/**
* @param logFunction logging function
/**
* Install the log function for the current thread.
*/
- void InstallLogFunction() const;
+ virtual void InstallLogFunction() const;
/**
* Un-install the log function for the current thread.