1 #ifndef __DALI_EVENT_THREAD_CALLBACK_H_
2 #define __DALI_EVENT_THREAD_CALLBACK_H_
5 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/signals/callback.h>
25 #include <dali/public-api/dali-adaptor-common.h>
31 * @brief The EventThreadCallback class provides a mechanism for the worker thread to trigger the execution of a given callback in main event thread .
33 * @note The EventThreadCallback object should only be created in the main thread.
35 class DALI_ADAPTOR_API EventThreadCallback
40 * @brief Constructor. Create an object that will call the given callback in main event thread.
42 * @param[in] callback The callback to call.
44 EventThreadCallback( CallbackBase* callback );
49 ~EventThreadCallback();
52 * @brief Trigger the calling of callback.
54 * The method can be used from worker threads to notify the main thread as main thread is running the event loop and thus cannot be blocked
60 // undefined copy constructor.
61 EventThreadCallback( const EventThreadCallback& );
63 // undefined assignment operator
64 EventThreadCallback& operator=( const EventThreadCallback& );
74 #endif /* __DALI_EVENT_THREAD_CALLBACK_H_ */