ewmscp
..
|
smart copy class for inotify_event. More...
Public Member Functions | |
inotify_event_copy (const inotify_event_wrapper *aEvent) | |
~inotify_event_copy () | |
clock_type::time_point | timeStamp () const |
const inotify_event_wrapper * | getEvent () const |
Static Public Member Functions | |
static void | doCopyLeftovers () |
static inotify_event_copy * | getStaleSingles () |
get the next old inotify_event. More... | |
static void | forget (inotify_event_copy *what) |
deletes a copy. More... | |
static inotify_event_copy * | getPartner (const inotify_event_wrapper *event, clock_type::time_point then) |
get partner of a half rename event. More... | |
Protected Member Functions | |
void | doCopyIfNeeded () |
make a real copy of this inotify_event. More... | |
Static Protected Member Functions | |
static std::map< uint32_t, inotify_event_copy > & | getRenameEvents () |
return a map which contains the inotify_event_copys More... | |
static bool | cmp (const inotify_event_copy *lhs, const inotify_event_copy *rhs) |
function to order inotify_event_copys by time More... | |
static std::multiset< inotify_event_copy *, decltype(cmp) * > & | getSingleEvents () |
return a multiset containing single inotify_event_copys ordered by time More... | |
Protected Attributes | |
std::remove_reference< decltype(getSingleEvents())>::type::iterator | singleEventIterator |
iterator into the multiset containing the single events More... | |
const inotify_event_wrapper * | event |
pointer to the event, either the original or a copy More... | |
clock_type::time_point | then |
the time the event was recorded More... | |
bool | isCopy |
true if it's a copy. We can't use singleEventIterator as this might be getSingleEvents().end() after erasing it. More... | |
smart copy class for inotify_event.
This is needed only for matching the two halves of rename event pairs! This class holds a pointer to an inotify_event_wrapper. Normally this is in the current buffer returned by the last read() from the inotify object. If a rename-event pair is not completely inside one buffer a real copy has to be made and processing of the pair can then happen in the next buffer.
Definition at line 177 of file inotify_watch.cpp.
|
inline |
Definition at line 211 of file inotify_watch.cpp.
|
inline |
Definition at line 214 of file inotify_watch.cpp.
|
inlinestaticprotected |
function to order inotify_event_copys by time
Definition at line 185 of file inotify_watch.cpp.
References then.
Referenced by getSingleEvents().
|
inlineprotected |
make a real copy of this inotify_event.
Definition at line 199 of file inotify_watch.cpp.
References getEvent(), getSingleEvents(), isCopy, and singleEventIterator.
|
inlinestatic |
Definition at line 226 of file inotify_watch.cpp.
References getRenameEvents().
Referenced by main().
|
inlinestatic |
deletes a copy.
It will remove it from both the singles set as well as from the map, and call (indirectlly, through the erase in the map) the destructor. Is static with a parameter instead of a normal member, because that would destroy it's own this in the erase from the map.
Definition at line 254 of file inotify_watch.cpp.
References inotify_event_wrapper::cookie(), getEvent(), getRenameEvents(), getSingleEvents(), and singleEventIterator.
Referenced by main().
|
inline |
Definition at line 222 of file inotify_watch.cpp.
References event.
Referenced by doCopyIfNeeded(), and forget().
|
inlinestatic |
get partner of a half rename event.
If the other half of the rename event is already known a pointer to it is returned. If not a copy of this event is emplaced into the half rename event map and a nullptr is returned.
Definition at line 267 of file inotify_watch.cpp.
References inotify_event_wrapper::cookie(), event, getRenameEvents(), and then.
Referenced by main().
|
inlinestaticprotected |
return a map which contains the inotify_event_copys
Definition at line 180 of file inotify_watch.cpp.
Referenced by doCopyLeftovers(), forget(), and getPartner().
|
inlinestaticprotected |
return a multiset containing single inotify_event_copys ordered by time
Definition at line 189 of file inotify_watch.cpp.
References cmp().
Referenced by doCopyIfNeeded(), forget(), and getStaleSingles().
|
inlinestatic |
get the next old inotify_event.
return a pointer to the next old (>5s) half of a rename event the parameter then is set to the time of the event. If no old event is found a nullptr is returned;
Definition at line 237 of file inotify_watch.cpp.
References getSingleEvents().
Referenced by main().
|
inline |
|
protected |
pointer to the event, either the original or a copy
Definition at line 194 of file inotify_watch.cpp.
Referenced by getEvent(), getPartner(), and ~inotify_event_copy().
|
protected |
true if it's a copy. We can't use singleEventIterator as this might be getSingleEvents().end() after erasing it.
Definition at line 196 of file inotify_watch.cpp.
Referenced by doCopyIfNeeded(), and ~inotify_event_copy().
|
protected |
iterator into the multiset containing the single events
Definition at line 193 of file inotify_watch.cpp.
Referenced by doCopyIfNeeded(), and forget().
|
protected |
the time the event was recorded
Definition at line 195 of file inotify_watch.cpp.
Referenced by cmp(), getPartner(), and timeStamp().