IBR-DTNSuite
0.12
|
#include <FileMonitor.h>
Public Member Functions | |
FileMonitor () | |
virtual | ~FileMonitor () |
void | watch (const ibrcommon::File &watch) |
const std::string | getName () const |
Public Member Functions inherited from dtn::daemon::IndependentComponent | |
IndependentComponent () | |
virtual | ~IndependentComponent () |
virtual void | initialize () throw () |
virtual void | startup () throw () |
virtual void | terminate () throw () |
Public Member Functions inherited from dtn::daemon::Component | |
virtual | ~Component ()=0 |
Protected Member Functions | |
void | componentUp () throw () |
void | componentRun () throw () |
void | componentDown () throw () |
void | __cancellation () throw () |
Protected Member Functions inherited from dtn::daemon::IndependentComponent | |
void | run () throw () |
Protected Member Functions inherited from ibrcommon::JoinableThread | |
virtual | ~JoinableThread ()=0 |
void | join (void) throw (ThreadException) |
bool | isRunning (void) |
void | start (int priority=0) throw (ThreadException) |
void | stop () throw () |
JoinableThread (size_t size=DEFAULT_STACKSIZE) | |
Additional Inherited Members |
Definition at line 55 of file FileMonitor.h.
dtn::net::FileMonitor::FileMonitor | ( | ) |
Definition at line 94 of file FileMonitor.cpp.
|
virtual |
Definition at line 99 of file FileMonitor.cpp.
References ibrcommon::JoinableThread::join().
|
protectedvirtual |
This method is called after componentDown() and should should guarantee that blocking calls in componentRun() will unblock.
Implements dtn::daemon::IndependentComponent.
Definition at line 171 of file FileMonitor.cpp.
References ibrcommon::vsocket::down().
|
protectedvirtual |
This method is called if the component should stop. Clean-up code should be inserted here.
Implements dtn::daemon::IndependentComponent.
Definition at line 166 of file FileMonitor.cpp.
References ibrcommon::vsocket::down().
|
protectedvirtual |
This is the run method. The component should loop in there until componentDown() or __cancellation() is called.
Implements dtn::daemon::IndependentComponent.
Definition at line 131 of file FileMonitor.cpp.
References dtn::net::inotifysocket::read(), ibrcommon::vsocket::select(), and ibrcommon::Thread::sleep().
|
protectedvirtual |
Is called in preparation of the component. Before componentRun() is called.
Implements dtn::daemon::IndependentComponent.
Definition at line 121 of file FileMonitor.cpp.
References ibrcommon::LogLevel::error, IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, ibrcommon::vsocket::up(), and ibrcommon::Exception::what().
|
virtual |
Return an identifier for this component
Implements dtn::daemon::Component.
Definition at line 261 of file FileMonitor.cpp.
void dtn::net::FileMonitor::watch | ( | const ibrcommon::File & | watch) |
Definition at line 104 of file FileMonitor.cpp.
References ibrcommon::vsocket::getAll(), ibrcommon::File::getPath(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, ibrcommon::File::isDirectory(), and dtn::net::inotifysocket::watch().