1 #ifndef __DALI_INTERNAL_TRIGGER_EVENT_H__
2 #define __DALI_INTERNAL_TRIGGER_EVENT_H__
5 * Copyright (c) 2014 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 <boost/function.hpp>
25 #include <dali/public-api/common/dali-common.h>
26 #include <base/interfaces/trigger-event-interface.h>
37 class FileDescriptorMonitor;
40 * The TriggerEvent class is used to send events between threads. For example, this can be used
41 * to wake up one thread from another thread.
43 * Typically, these should be created in the application thread.
45 * The observer will be informed whenever the event is triggered.
47 * The implementation of TriggerEvent uses an event file descriptor.
49 class TriggerEvent : public TriggerEventInterface
55 * Creates an event file descriptor and starts a GSource which reads from the file
56 * descriptor when there is data.
58 * @param[in] functor to call
59 * @param[in] options, trigger event options.
61 TriggerEvent( boost::function<void()> functor, TriggerEventInterface::Options options = TriggerEventInterface::NONE );
73 * This can be called from one thread in order to wake up another thread.
80 * Called when our event file descriptor has been written to.
90 FileDescriptorMonitor* mFileDescriptorMonitor;
91 boost::function<void()> mFunctor; ///< Function object to call
93 TriggerEventInterface::Options mOptions;
96 } // namespace Adaptor
98 } // namespace Internal
102 #endif // __DALI_INTERNAL_TRIGGER_EVENT_H__