![]() |
TSDuck v3.46-4930
MPEG Transport Stream Toolkit
|
#include <tsPollFiles.h>
Public Member Functions | |
| PollFiles ()=default | |
| template<class Rep1, class Period1, class Rep2, class Period2> | |
| PollFiles (const UString &wildcard, PollFilesListener *listener=nullptr, const cn::duration< Rep1, Period1 > &poll_interval=DEFAULT_POLL_INTERVAL, const cn::duration< Rep2, Period2 > &min_stable_delay=DEFAULT_MIN_STABLE_DELAY, Report &report=(ts::CerrReport::Instance())) | |
| bool | pollOnce () |
| void | pollRepeatedly () |
| void | setFileWildcard (const UString &wildcard) |
| void | setListener (PollFilesListener *listener) |
| template<class Rep, class Period> | |
| void | setMinStableDelay (const cn::duration< Rep, Period > &min_stable_delay) |
| template<class Rep, class Period> | |
| void | setPollInterval (const cn::duration< Rep, Period > &poll_interval) |
Static Public Attributes | |
| static constexpr cn::milliseconds | DEFAULT_MIN_STABLE_DELAY = cn::milliseconds(500) |
| static constexpr cn::milliseconds | DEFAULT_POLL_INTERVAL = cn::milliseconds(1000) |
A class to poll files for modifications.
|
default |
Default constructor
|
inline |
Constructor.
| [in] | wildcard | Wildcard specification of files to poll (eg "/path/to/*.dat"). |
| [in] | listener | Invoked on file modification. Can be null. |
| [in] | poll_interval | Interval between two poll operations. |
| [in] | min_stable_delay | A file size needs to be stable during that duration for the file to be reported as added or modified. This prevent too frequent poll notifications when a file is being written and his size modified at each poll. |
| [in,out] | report | For debug messages only. |
|
inline |
Set a new file wildcard specification to poll.
| [in] | wildcard | Wildcard specification of files to poll (eg "/path/to/*.dat"). |
|
inline |
Set a new file listener.
| [in] | listener | Invoked on file modification. Can be null. |
|
inline |
Set a new polling interval.
| [in] | poll_interval | Interval in milliseconds between two poll operations. |
|
inline |
Set a new minimum file stability delay.
| [in] | min_stable_delay | A file size needs to be stable during that duration for the file to be reported as added or modified. This prevent too frequent poll notifications when a file is being written and his size modified at each poll. |
| void ts::PollFiles::pollRepeatedly | ( | ) |
Poll files continuously until the listener asks to terminate. Invoke the listener each time something has changed. The first time, all files are reported as "added".
| bool ts::PollFiles::pollOnce | ( | ) |
Perform one poll operation, notify listener if necessary, and return immediately.
|
staticconstexpr |
Default interval between two poll operations.
|
staticconstexpr |
Default minimum file stability delay. A file size needs to be stable during that duration for the file to be reported as added or modified. This prevent too frequent poll notifications when a file is being written and his size modified at each poll.