Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WsFsTreeUpdater.h
Go to the documentation of this file.
1 
14 #ifndef WS_FS_TREE_UPDATER_H__
15 #define WS_FS_TREE_UPDATER_H__
16 
17 #define BOOST_NO_DEPRECATED
18 
20 
21 #include <list>
22 
23 #include "WsAbstractMonitor.h"
24 
25 #include <boost/thread.hpp>
26 class WsMonitor;
27 
28 
35 public:
41  WsFsTreeUpdater(const std::string& p, unsigned int delay, bool m = false);
42 
44 
49  int update();
50 
55 
62 private:
63 
71  int startRegularUpdate();
72 
78  int threadUpdate();
79 
83  std::string m_rootPath;
84 
89 
94 
98  unsigned int m_delay;
99 
101 
102  boost::mutex m_lMutex;
103  boost::mutex m_updateMutex;
105 };
106 
107 #endif
boost::mutex m_updateMutex
bool m_isMonitor
Use Gamin or no.
Monitors the filesystem and call the WsFsTreeUpdater::update() method accordignly.
Definition: WsMonitor.h:31
int update()
update the fsTree
std::string m_rootPath
RootPath.
handles the update of the FileSystemTree
FileSystemTreePtr m_fsTree
FileSystemTreePtr getLastTree()
returns the last created tree
boost::mutex m_lMutex
int startRegularUpdate()
Starts the regular update of the tree.
boost::shared_ptr< WsFileSystemTree > FileSystemTreePtr
int threadUpdate()
Updates the tree in a thread.
WsAbstractMonitor * m_monitor
Pointer to the file monitoring class used.
unsigned int m_delay
Delay after which the FileSystemTree will be updated if changed occured.
WsFsTreeUpdater(const std::string &p, unsigned int delay, bool m=false)
constrictor
Structure representing all the fs tree from the root.
bool isLastVersion(FileSystemTreePtr fs)
checks whether the fs is the last version
Abstract class used for monitoring the filesystem.