#include <wvwatcher.h>
Inheritance diagram for WvFileWatcher:
Public Methods | |
WvFileWatcher (const char *_filename, int _mode) | |
virtual bool | isok () const |
virtual size_t | uread (void *buf, size_t size) |
virtual size_t | uwrite (const void *buf, size_t size) |
virtual bool | pre_select (SelectInfo &si) |
WvFileWatcher (const char *_filename, int _mode) | |
virtual bool | isok () const |
virtual size_t | uread (void *buf, size_t size) |
virtual size_t | uwrite (const void *buf, size_t size) |
virtual bool | pre_select (SelectInfo &si) |
Protected Methods | |
bool | make_ok (bool retry) |
bool | make_ok (bool retry) |
Private Attributes | |
WvString | filename |
int | openmode |
bool | once_ok |
stat | last_st |
off_t | fpos |
stat | last_st |
The file is rewound and reopened if its inode changes or its length gets shorter, under the assumption that we will want to see the entire contents of the new file.
Definition at line 22 of file include/wvwatcher.h.
|
Definition at line 19 of file wvwatcher.cc. References WvStream::close(), WvStream::errnum, filename, fpos, WvStream::isok(), last_st, once_ok, and openmode. |
|
|
|
return true if the stream is actually usable right now Reimplemented from WvStream. |
|
return true if the stream is actually usable right now Reimplemented from WvStream. Definition at line 34 of file wvwatcher.cc. References once_ok. |
|
|
|
Definition at line 40 of file wvwatcher.cc. References WvStream::close(), filename, fpos, WvStream::getrfd(), WvStream::isok(), last_st, WvFile::open(), and openmode. Referenced by pre_select(), and uwrite(). |
|
pre_select() sets up for eventually calling select(). It adds the right fds to the read, write, and except lists in the SelectInfo struct. Returns true if we already know this stream is ready, and there's no need to actually do a real select(). Some streams, such as timers, can be implemented by _only_ either returning true or false here after doing a calculation, and never actually adding anything to the SelectInfo. You can add your stream to any of the lists even if readable, writable, or isexception isn't set. This is what force_select() does. You can also choose not to add yourself to the list if you know it would be useless right now. pre_select() is only called if isok() is true. pre_select() is allowed to reduce msec_timeout (or change it if it's -1). However, it's not allowed to _increase_ msec_timeout. Reimplemented from WvStream. |
|
pre_select() sets up for eventually calling select(). It adds the right fds to the read, write, and except lists in the SelectInfo struct. Returns true if we already know this stream is ready, and there's no need to actually do a real select(). Some streams, such as timers, can be implemented by _only_ either returning true or false here after doing a calculation, and never actually adding anything to the SelectInfo. You can add your stream to any of the lists even if readable, writable, or isexception isn't set. This is what force_select() does. You can also choose not to add yourself to the list if you know it would be useless right now. pre_select() is only called if isok() is true. pre_select() is allowed to reduce msec_timeout (or change it if it's -1). However, it's not allowed to _increase_ msec_timeout. Reimplemented from WvStream. Definition at line 99 of file wvwatcher.cc. References fpos, WvStream::getrfd(), last_st, make_ok(), and once_ok. |
|
unbuffered I/O functions; these ignore the buffer, which is handled by read(). Don't call these functions unless you have a _really_ good reason. Reimplemented from WvStream. |
|
unbuffered I/O functions; these ignore the buffer, which is handled by read(). Don't call these functions unless you have a _really_ good reason. Reimplemented from WvStream. Definition at line 67 of file wvwatcher.cc. References fpos, once_ok, WvStream::select(), size, and WvStream::uread(). |
|
unbuffered I/O functions; these ignore the buffer, which is handled by write(). Don't call these functions unless you have a _really_ good reason. Reimplemented from WvStream. |
|
unbuffered I/O functions; these ignore the buffer, which is handled by write(). Don't call these functions unless you have a _really_ good reason. Reimplemented from WvStream. Definition at line 83 of file wvwatcher.cc. References fpos, make_ok(), once_ok, size, and WvStream::uwrite(). |
|
Definition at line 24 of file streams/wvwatcher.h. Referenced by make_ok(), and WvFileWatcher(). |
|
Definition at line 28 of file streams/wvwatcher.h. Referenced by make_ok(), pre_select(), uread(), uwrite(), and WvFileWatcher(). |
|
Definition at line 27 of file streams/wvwatcher.h. |
|
Definition at line 27 of file include/wvwatcher.h. Referenced by make_ok(), pre_select(), and WvFileWatcher(). |
|
Definition at line 26 of file streams/wvwatcher.h. Referenced by isok(), pre_select(), uread(), uwrite(), and WvFileWatcher(). |
|
Definition at line 25 of file streams/wvwatcher.h. Referenced by make_ok(), and WvFileWatcher(). |