1 #ifndef DALI_EVENT_THREAD_CALLBACK_H
2 #define DALI_EVENT_THREAD_CALLBACK_H
5 * Copyright (c) 2020 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>
30 * @brief The EventThreadCallback class provides a mechanism for the worker thread to trigger the execution of a given callback in main event thread .
32 * @note The EventThreadCallback object should only be created in the main thread.
34 class DALI_ADAPTOR_API EventThreadCallback
38 * @brief Constructor. Create an object that will call the given callback in main event thread.
40 * @param[in] callback The callback to call.
42 EventThreadCallback(CallbackBase* callback);
47 ~EventThreadCallback();
50 * @brief Trigger the calling of callback.
52 * 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
57 // undefined copy constructor.
58 EventThreadCallback(const EventThreadCallback&);
60 // undefined assignment operator
61 EventThreadCallback& operator=(const EventThreadCallback&);
69 #endif /* DALI_EVENT_THREAD_CALLBACK_H */