Add project files.

This commit is contained in:
2022-03-05 12:44:06 +02:00
parent 453a74459f
commit f4f90b2533
517 changed files with 195610 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
#ifndef FILEMONITOR_FREEBSD_INCLUDED
#define FILEMONITOR_FREEBSD_INCLUDED
#include "IFileMonitor.h"
#include <unistd.h>
#include <sys/event.h>
#include <sys/types.h>
#include <sys/signal.h>
#include <sys/time.h>
struct FileIOContext_FreeBSD
{
int fhMonitor;
int idxToEventList; // evtTrigger & evtMonitor index should be same
PFN_FileChangeListener pListenFunc;
};
class FileMonitorFreeBSD : public IFileMonitor
{
private:
FileMonitorFreeBSD(); //hidden
public:
virtual ~FileMonitorFreeBSD();
void AddWatch (const std::string& strFileName, PFN_FileChangeListener pListenerFunc);
void Update (DWORD dwPulses);
static FileMonitorFreeBSD& Instance()
{
static FileMonitorFreeBSD theMonitor;
return theMonitor;
}
private:
typedef boost::unordered_map<std::string, FileIOContext_FreeBSD> TMonitorFileHashMap;
typedef std::vector<struct kevent> TEventList;
TMonitorFileHashMap m_FileLists;
TEventList m_MonitoredEventLists;
TEventList m_TriggeredEventLists;
int m_KernelEventQueue;
};
#endif //FILEMONITOR_FREEBSD_INCLUDED