*/
// EXTERNAL INCLUDES
-#include <boost/function.hpp>
+#include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/signals/callback.h>
+#include <file-descriptor-monitor.h>
// INTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
-#include <base/interfaces/trigger-event-interface.h>
+#include <trigger-event-interface.h>
namespace Dali
{
namespace Adaptor
{
-class FileDescriptorMonitor;
/**
* The TriggerEvent class is used to send events between threads. For example, this can be used
*
* The implementation of TriggerEvent uses an event file descriptor.
*/
-class DALI_IMPORT_API TriggerEvent : public TriggerEventInterface
+class TriggerEvent : public TriggerEventInterface
{
public:
* Creates an event file descriptor and starts a GSource which reads from the file
* descriptor when there is data.
*
- * @param[in] functor to call
- * @param[in] options, trigger event options.
+ * @param[in] callback The callback to call
+ * @param[in] options Trigger event options.
+ * @note The ownership of callback is taken by this class.
*/
- TriggerEvent( boost::function<void()> functor, TriggerEventInterface::Options options = TriggerEventInterface::NONE );
+ TriggerEvent( CallbackBase* callback, TriggerEventInterface::Options options );
/**
* Destructor
private:
/**
- * Called when our event file descriptor has been written to.
+ * @brief Called when our event file descriptor has been written to.
+ * @param[in] eventBitMask bit mask of events that occured on the file descriptor
*/
- void Triggered();
+ void Triggered( FileDescriptorMonitor::EventType eventBitMask );
private:
private:
FileDescriptorMonitor* mFileDescriptorMonitor;
- boost::function<void()> mFunctor; ///< Function object to call
+ CallbackBase* mCallback;
int mFileDescriptor;
TriggerEventInterface::Options mOptions;
};