Public Member Functions | Protected Attributes | List of all members
FileWatcher Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-01-23/OnlineCalibration/FileWatcher.h"

Public Member Functions

 FileWatcher ()
 
 FileWatcher (const std::string &p)
 
void setPath (const std::string &p)
 
bool isModified ()
 
std::time_t get_time ()
 
void update ()
 

Protected Attributes

boost::filesystem::path _path
 
std::time_t _last_time
 

Detailed Description

Definition at line 7 of file FileWatcher.h.

Constructor & Destructor Documentation

FileWatcher::FileWatcher ( )
inline

Definition at line 9 of file FileWatcher.h.

9 {}
FileWatcher::FileWatcher ( const std::string p)
inline

Definition at line 11 of file FileWatcher.h.

References setPath().

11 {setPath(p);}
const char * p
Definition: xmltok.h:285
void setPath(const std::string &p)
Definition: FileWatcher.h:13

Member Function Documentation

std::time_t FileWatcher::get_time ( )
inline

Definition at line 17 of file FileWatcher.h.

References _path, and allTimeWatchdog::endl.

Referenced by isModified(), and update().

17  {
18  if(!boost::filesystem::exists(_path)){
19  mf::LogWarning("FileWatcher")<<" file \""<<_path<<"\" does not exist."
20  <<" Waiting until it is created..."<<std::endl;
21  return 0;
22  }
23  else
24  return boost::filesystem::last_write_time(_path);
25  }
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
boost::filesystem::path _path
Definition: FileWatcher.h:29
bool FileWatcher::isModified ( )
inline

Definition at line 15 of file FileWatcher.h.

References _last_time, and get_time().

Referenced by novaddt::ChannelMapMaker::analyze(), novaddt::HotMapMaker::analyze(), and novaddt::StaticMapService::preProcessEvent().

15 {return(_last_time < get_time());}
std::time_t get_time()
Definition: FileWatcher.h:17
std::time_t _last_time
Definition: FileWatcher.h:30
void FileWatcher::setPath ( const std::string p)
inline

Definition at line 13 of file FileWatcher.h.

References _path, and update().

Referenced by FileWatcher().

13 {_path=p; update();}
void update()
Definition: FileWatcher.h:27
const char * p
Definition: xmltok.h:285
boost::filesystem::path _path
Definition: FileWatcher.h:29
void FileWatcher::update ( )
inline

Member Data Documentation

std::time_t FileWatcher::_last_time
protected

Definition at line 30 of file FileWatcher.h.

Referenced by isModified(), and update().

boost::filesystem::path FileWatcher::_path
protected

Definition at line 29 of file FileWatcher.h.

Referenced by get_time(), and setPath().


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