|
fswatch 1.20.1
|
Type representing a file change event. More...
#include <event.hpp>
Public Member Functions | |
| event (std::string path, time_t evt_time, std::vector< fsw_event_flag > flags) | |
| Constructs an event. | |
| event (std::string path, time_t evt_time, std::vector< fsw_event_flag > flags, unsigned long correlation_id) | |
| Constructs an event. | |
| event (std::string path, time_t evt_time, std::vector< fsw_event_flag > flags, unsigned long correlation_id, process_metadata process) | |
| Constructs an event with optional process metadata. | |
| virtual | ~event () |
| Destructs an event. | |
| std::string | get_path () const |
| Returns the path of the event. | |
| time_t | get_time () const |
| Returns the time of the event. | |
| std::vector< fsw_event_flag > | get_flags () const |
| Returns the flags of the event. | |
| unsigned long | get_correlation_id () const |
| Returns the correlation_id of the file of the event. | |
| bool | has_process_id () const |
| Returns true if the event has process attribution metadata. | |
| long long | get_process_id () const |
| Returns the process or thread identifier associated with this event. | |
| process_id_kind | get_process_id_kind () const |
| Returns the process identifier kind. | |
| bool | has_process_pidfd () const |
| Returns true if the event has a process file descriptor. | |
| int | get_process_pidfd () const |
| Returns the process file descriptor associated with this event. | |
Static Public Member Functions | |
| static std::string | get_process_id_kind_name (process_id_kind kind) |
| Get the display name of a process identifier kind. | |
| static fsw_event_flag | get_event_flag_by_name (const std::string &name) |
| Get event flag by name. | |
| static std::string | get_event_flag_name (const fsw_event_flag &flag) |
| Get the name of an event flag. | |
Type representing a file change event.
This class represents a file change event in the libfswatch API. An event contains:
| fsw::event::event | ( | std::string | path, |
| time_t | evt_time, | ||
| std::vector< fsw_event_flag > | flags ) |
Constructs an event.
| path | The path the event refers to. |
| evt_time | The time the event was raised. |
| flags | The vector of flags specifying the type of the event. |
| fsw::event::event | ( | std::string | path, |
| time_t | evt_time, | ||
| std::vector< fsw_event_flag > | flags, | ||
| unsigned long | correlation_id ) |
Constructs an event.
| path | The path the event refers to. |
| evt_time | The time the event was raised. |
| flags | The vector of flags specifying the type of the event. |
| correlation_id | The correlation_id of the file the event refers to. |
| fsw::event::event | ( | std::string | path, |
| time_t | evt_time, | ||
| std::vector< fsw_event_flag > | flags, | ||
| unsigned long | correlation_id, | ||
| process_metadata | process ) |
Constructs an event with optional process metadata.
| path | The path the event refers to. |
| evt_time | The time the event was raised. |
| flags | The vector of flags specifying the type of the event. |
| correlation_id | The correlation_id of the file the event refers to. |
| process | The optional process metadata associated with the event. |
|
virtualdefault |
Destructs an event.
This is a virtual destructor that performs no operations.
| unsigned long fsw::event::get_correlation_id | ( | ) | const |
Returns the correlation_id of the file of the event.
|
static |
Get event flag by name.
| name | The name of the event flag to look for. |
name, otherwise | libfsw_exception | if no event flag is found. |
|
static |
Get the name of an event flag.
| flag | The event flag. |
flag. | libfsw_exception | if no event flag is found. |
| vector< fsw_event_flag > fsw::event::get_flags | ( | ) | const |
Returns the flags of the event.
| string fsw::event::get_path | ( | ) | const |
Returns the path of the event.
| long long fsw::event::get_process_id | ( | ) | const |
Returns the process or thread identifier associated with this event.
Returns 0 when no process attribution metadata is available.
| int fsw::event::get_process_pidfd | ( | ) | const |
Returns the process file descriptor associated with this event.
Returns -1 when no process file descriptor is available. The descriptor is owned by the event producer and is only valid during callback processing.
| time_t fsw::event::get_time | ( | ) | const |
Returns the time of the event.