libmoost
|
#include <ionotify_linux.hpp>
Public Types | |
enum | file_action { CREATED = 0, CHANGED = 1, DELETED = 2 } |
typedef boost::function< void(file_action fa, const std::string &path)> | callback_t |
typedef file_watcher::file_action | file_action |
typedef file_watcher::callback_t | callback_t |
Public Member Functions | |
ionotify (bool stop_immediately=false) | |
~ionotify () | |
void | insert (std::string const &path, callback_t const &callback, bool call_now=false) |
void | erase (std::string const &path) |
void | start () |
void | stop () |
ionotify (bool ignore_dup_events=false, bool stop_immediately=false) | |
~ionotify () | |
void | insert (std::string const &path, callback_t const &callback, bool call_now=false) |
void | erase (std::string const &path) |
void | start () |
void | stop () |
Static Public Attributes | |
static file_action const | CHANGED = file_watcher::CHANGED |
static file_action const | CREATED = file_watcher::CREATED |
static file_action const | DELETED = file_watcher::DELETED |
Private Types | |
typedef std::pair< callback_t, std::string > | event_t |
typedef std::map< int, event_t > | event_map_t |
typedef std::map< std::string, int > | path_map_t |
typedef boost::shared_ptr < boost::thread > | pthread_t |
Private Member Functions | |
bool | is_file_action (int mask, int eventid) |
bool | get_file_action (int mask, file_action &fa) |
void | thread_proc () |
Private Attributes | |
int | fd_ |
event_map_t | event_map_ |
path_map_t | path_map_ |
pthread_t | pthread_event |
boost::shared_mutex | smtx_event_ |
boost::mutex | mtx_stop_start_ |
boost::asio::io_service | ioservice_ |
boost::shared_ptr < boost::asio::io_service::work > | spwork_ |
pthread_t | pthread_handler |
bool | stop_immediately_ |
file_watcher | fw_ |
Static Private Attributes | |
static const int | EVENT_MASK = IN_ATTRIB | IN_DELETE | IN_DELETE_SELF | IN_MODIFY | IN_MOVE_SELF | IN_MOVED_FROM |
Definition at line 55 of file ionotify_linux.hpp.
Definition at line 48 of file ionotify_windows.hpp.
typedef boost::function<void(file_action fa, const std::string & path)> moost::io::ionotify::callback_t |
Definition at line 90 of file ionotify_linux.hpp.
typedef std::map<int, event_t> moost::io::ionotify::event_map_t [private] |
Definition at line 94 of file ionotify_linux.hpp.
typedef std::pair<callback_t, std::string> moost::io::ionotify::event_t [private] |
Definition at line 93 of file ionotify_linux.hpp.
Definition at line 47 of file ionotify_windows.hpp.
typedef std::map<std::string, int> moost::io::ionotify::path_map_t [private] |
Definition at line 95 of file ionotify_linux.hpp.
typedef boost::shared_ptr<boost::thread> moost::io::ionotify::pthread_t [private] |
Definition at line 96 of file ionotify_linux.hpp.
CREATED |
File creation (here to be backwards compatible with file_watcher, but not directly supported by inotify!) |
CHANGED |
File modification. |
DELETED |
File deletion. |
Definition at line 83 of file ionotify_linux.hpp.
moost::io::ionotify::ionotify | ( | bool | stop_immediately = false | ) | [inline] |
Definition at line 58 of file ionotify_linux.hpp.
moost::io::ionotify::~ionotify | ( | ) | [inline] |
moost::io::ionotify::ionotify | ( | bool | ignore_dup_events = false , |
bool | stop_immediately = false |
||
) | [inline] |
Definition at line 39 of file ionotify_windows.hpp.
moost::io::ionotify::~ionotify | ( | ) | [inline] |
Definition at line 43 of file ionotify_windows.hpp.
void moost::io::ionotify::erase | ( | std::string const & | path | ) | [inline] |
void moost::io::ionotify::erase | ( | std::string const & | path | ) | [inline] |
Definition at line 124 of file ionotify_linux.hpp.
bool moost::io::ionotify::get_file_action | ( | int | mask, |
file_action & | fa | ||
) | [inline, private] |
Definition at line 196 of file ionotify_linux.hpp.
void moost::io::ionotify::insert | ( | std::string const & | path, |
callback_t const & | callback, | ||
bool | call_now = false |
||
) | [inline] |
void moost::io::ionotify::insert | ( | std::string const & | path, |
callback_t const & | callback, | ||
bool | call_now = false |
||
) | [inline] |
bool moost::io::ionotify::is_file_action | ( | int | mask, |
int | eventid | ||
) | [inline, private] |
void moost::io::ionotify::start | ( | ) | [inline] |
void moost::io::ionotify::start | ( | ) | [inline] |
Definition at line 139 of file ionotify_linux.hpp.
void moost::io::ionotify::stop | ( | ) | [inline] |
void moost::io::ionotify::stop | ( | ) | [inline] |
void moost::io::ionotify::thread_proc | ( | ) | [inline, private] |
Definition at line 208 of file ionotify_linux.hpp.
file_action const moost::io::ionotify::CHANGED = file_watcher::CHANGED [static] |
Definition at line 49 of file ionotify_windows.hpp.
file_action const moost::io::ionotify::CREATED = file_watcher::CREATED [static] |
Definition at line 50 of file ionotify_windows.hpp.
file_action const moost::io::ionotify::DELETED = file_watcher::DELETED [static] |
Definition at line 51 of file ionotify_windows.hpp.
event_map_t moost::io::ionotify::event_map_ [private] |
Definition at line 312 of file ionotify_linux.hpp.
const int moost::io::ionotify::EVENT_MASK = IN_ATTRIB | IN_DELETE | IN_DELETE_SELF | IN_MODIFY | IN_MOVE_SELF | IN_MOVED_FROM [static, private] |
Definition at line 98 of file ionotify_linux.hpp.
int moost::io::ionotify::fd_ [private] |
Definition at line 311 of file ionotify_linux.hpp.
file_watcher moost::io::ionotify::fw_ [private] |
Definition at line 75 of file ionotify_windows.hpp.
boost::asio::io_service moost::io::ionotify::ioservice_ [private] |
Definition at line 317 of file ionotify_linux.hpp.
boost::mutex moost::io::ionotify::mtx_stop_start_ [private] |
Definition at line 316 of file ionotify_linux.hpp.
path_map_t moost::io::ionotify::path_map_ [private] |
Definition at line 313 of file ionotify_linux.hpp.
pthread_t moost::io::ionotify::pthread_event [private] |
Definition at line 314 of file ionotify_linux.hpp.
Definition at line 319 of file ionotify_linux.hpp.
boost::shared_mutex moost::io::ionotify::smtx_event_ [private] |
Definition at line 315 of file ionotify_linux.hpp.
boost::shared_ptr<boost::asio::io_service::work> moost::io::ionotify::spwork_ [private] |
Definition at line 318 of file ionotify_linux.hpp.
bool moost::io::ionotify::stop_immediately_ [private] |
Definition at line 320 of file ionotify_linux.hpp.