CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::IFileWatcher Class Referenceabstract

Interface for file watcher implementations. More...

#include <CeresEngine/Foundation/IO/FileWatcher.hpp>

Inheritance diagram for CeresEngine::IFileWatcher:
CeresEngine::AppleFileWatcher CeresEngine::LinuxFileWatcher CeresEngine::Win32FileWatcher

Public Member Functions

 IFileWatcher ()
 
virtual ~IFileWatcher ()
 
virtual IFileSystemgetFileSystem () const =0
 Gets file system that this watcher watches for.
 
virtual void start ()=0
 Starts the file watching operation.
 
virtual void stop ()=0
 Stops the file watching operation.
 

Protected Member Functions

void onFileEvent (const FileHandle &handle, FileEvent event)
 Called on file event.
 

Protected Attributes

FileWatchermFileWatcher
 File watcher that owns the implementation.
 

Friends

class FileWatcher
 

Detailed Description

Interface for file watcher implementations.

Constructor & Destructor Documentation

◆ IFileWatcher()

CeresEngine::IFileWatcher::IFileWatcher ( )

◆ ~IFileWatcher()

virtual CeresEngine::IFileWatcher::~IFileWatcher ( )
virtual

Member Function Documentation

◆ getFileSystem()

virtual IFileSystem * CeresEngine::IFileWatcher::getFileSystem ( ) const
pure virtual

Gets file system that this watcher watches for.

Returns
The watched file system (can be null).

Implemented in CeresEngine::AppleFileWatcher, CeresEngine::LinuxFileWatcher, and CeresEngine::Win32FileWatcher.

◆ onFileEvent()

void CeresEngine::IFileWatcher::onFileEvent ( const FileHandle handle,
FileEvent  event 
)
protected

Called on file event.

Parameters
handleThe file handle that received the event.
eventThe type of event that has occurred.

◆ start()

virtual void CeresEngine::IFileWatcher::start ( )
pure virtual

Starts the file watching operation.

Note
This function begins to watch the file system on a background thread. On every event, onFileEvent() is called using the watcher execution context with the typeof the event and a file handle to the file or directory. To stop listening, call stop().

Implemented in CeresEngine::AppleFileWatcher, and CeresEngine::Win32FileWatcher.

◆ stop()

virtual void CeresEngine::IFileWatcher::stop ( )
pure virtual

Stops the file watching operation.

Implemented in CeresEngine::AppleFileWatcher, and CeresEngine::Win32FileWatcher.

Friends And Related Symbol Documentation

◆ FileWatcher

Member Data Documentation

◆ mFileWatcher

FileWatcher* CeresEngine::IFileWatcher::mFileWatcher
protected

File watcher that owns the implementation.

Can be null if the FileWatcher object has been destroyed.


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