Android-cuttlefish cvd tool
Public Member Functions | Private Attributes | List of all members
cuttlefish::FileMonitorSource Class Reference

#include <file_monitor_source.h>

Inheritance diagram for cuttlefish::FileMonitorSource:
Inheritance graph
[legend]
Collaboration diagram for cuttlefish::FileMonitorSource:
Collaboration graph
[legend]

Public Member Functions

 FileMonitorSource (std::string path, std::unique_ptr< ReaderSeeker > file_io, std::function< Result< std::string >(std::string_view)> colorize_line, std::function< Result< bool >(std::string_view)> filter_line)
 
 ~FileMonitorSource () override
 
MonitorOutput Report (size_t rows, size_t columns) override
 
SharedFD ReadyFd () override
 
- Public Member Functions inherited from cuttlefish::MonitorSource
virtual ~MonitorSource ()
 
virtual MonitorOutput Report (size_t rows, size_t columns)=0
 
virtual SharedFD ReadyFd ()=0
 

Private Attributes

std::string path_
 
std::unique_ptr< ReaderSeekerfile_io_
 
std::function< Result< std::string >(std::string_view)> colorize_line_
 
std::function< Result< bool >(std::string_view)> filter_line_
 
SharedFD inotify_fd_
 

Constructor & Destructor Documentation

◆ FileMonitorSource()

cuttlefish::FileMonitorSource::FileMonitorSource ( std::string  path,
std::unique_ptr< ReaderSeeker file_io,
std::function< Result< std::string >(std::string_view)>  colorize_line,
std::function< Result< bool >(std::string_view)>  filter_line 
)

◆ ~FileMonitorSource()

cuttlefish::FileMonitorSource::~FileMonitorSource ( )
overridedefault

Member Function Documentation

◆ ReadyFd()

SharedFD cuttlefish::FileMonitorSource::ReadyFd ( )
overridevirtual

When this file descriptor is ready for reading (as defined by poll), it is ready to report new data from Report.

If the file descriptor is invalid, the source is always considered ready.

Implements cuttlefish::MonitorSource.

◆ Report()

MonitorOutput cuttlefish::FileMonitorSource::Report ( size_t  rows,
size_t  columns 
)
overridevirtual

Pulls new information from the data source if there is any and returns the text that should be shown in the monitor window.

rows and columns are hints for the output. May output more or less.

Implements cuttlefish::MonitorSource.

Member Data Documentation

◆ colorize_line_

std::function<Result<std::string>(std::string_view)> cuttlefish::FileMonitorSource::colorize_line_
private

◆ file_io_

std::unique_ptr<ReaderSeeker> cuttlefish::FileMonitorSource::file_io_
private

◆ filter_line_

std::function<Result<bool>(std::string_view)> cuttlefish::FileMonitorSource::filter_line_
private

◆ inotify_fd_

SharedFD cuttlefish::FileMonitorSource::inotify_fd_
private

◆ path_

std::string cuttlefish::FileMonitorSource::path_
private

The documentation for this class was generated from the following files: