Dali 3D User Interface Engine
List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes
Dali::Internal::Adaptor::FileDescriptorMonitor Class Reference

Monitors the given file descriptor and whenever anything is written to it, the provided callback is called. More...

#include <file-descriptor-monitor.h>

Collaboration diagram for Dali::Internal::Adaptor::FileDescriptorMonitor:
Collaboration graph


struct  Impl
 Using Impl to hide away EFL specific members. More...

Public Types

enum  EventType { FD_NO_EVENT = 0x0, FD_READABLE = 0x1, FD_WRITABLE = 0x2, FD_ERROR = 0x4 }
 Bitmask of file descriptor event types. More...

Public Member Functions

 FileDescriptorMonitor (int fileDescriptor, CallbackBase *callback, int eventBitmask)
 Constructor. More...
 ~FileDescriptorMonitor ()
 Destructor. More...

Private Member Functions

 FileDescriptorMonitor (const FileDescriptorMonitor &fileDescriptorMonitor)
FileDescriptorMonitoroperator= (const FileDescriptorMonitor &fileDescriptorMonitor)

Private Attributes


Detailed Description

Monitors the given file descriptor and whenever anything is written to it, the provided callback is called.

Definition at line 42 of file file-descriptor-monitor.h.

Member Enumeration Documentation

Bitmask of file descriptor event types.


Definition at line 49 of file file-descriptor-monitor.h.

Constructor & Destructor Documentation

Dali::Internal::Adaptor::FileDescriptorMonitor::FileDescriptorMonitor ( int  fileDescriptor,
CallbackBase callback,
int  eventBitmask 


The callback will be passed a EventType bitmask to signal what type of events occured on the file descriptor. Example:

MyClass::MyClass() { mFileDescriptorMonitor = new FileDescriptorMonitor( myFd, MakeCallback( this, &MyClass::FdCallback ), FileDescriptorMonitor::FD_READABLE ); }

void MyClass::FdCallback( EventType event ) { if( event & FileDescriptorMonitor::FD_ERROR) { LOG_ERROR("...) } if( event & FileDescriptorMonitor::FD_READABLE ) { // read from FD }


[in]fileDescriptorThe file descriptor to monitor
[in]callbackCalled when anything is written to the file descriptor
[in]eventBitmaskBitmask of what to monitor on the file descriptor ( readable / writable ).
The ownership of callback is taken by this class.
Under Linux it is possible the file descriptor monitor will signal a fd is readable or writable even when it isn’t. The developer should check for handle EAGAIN or equivalent when reading from or write to the fd.

Definition at line 107 of file ecore-file-descriptor-monitor.cpp.

References DALI_ASSERT_ALWAYS, Dali::Internal::Adaptor::FileDescriptorMonitor::Impl::EventDispatch(), FD_READABLE, FD_WRITABLE, Dali::Internal::Adaptor::FileDescriptorMonitor::Impl::mEventsToMonitor, Dali::Internal::Adaptor::FileDescriptorMonitor::Impl::mHandler, and mImpl.

Here is the call graph for this function:

Dali::Internal::Adaptor::FileDescriptorMonitor::~FileDescriptorMonitor ( )
Dali::Internal::Adaptor::FileDescriptorMonitor::FileDescriptorMonitor ( const FileDescriptorMonitor fileDescriptorMonitor)

Member Function Documentation

FileDescriptorMonitor& Dali::Internal::Adaptor::FileDescriptorMonitor::operator= ( const FileDescriptorMonitor fileDescriptorMonitor)

Member Data Documentation

Impl* Dali::Internal::Adaptor::FileDescriptorMonitor::mImpl

Definition at line 106 of file file-descriptor-monitor.h.

Referenced by FileDescriptorMonitor(), and ~FileDescriptorMonitor().

The documentation for this class was generated from the following files:
Dali Docs Home
Read more about Dali