2016-04-14 18:25:12 -04:00
|
|
|
// This class crawls the given directry hierarchy and updates it. It does so by calling the
|
|
|
|
// shared file list source. This source may be of two types:
|
|
|
|
// - local: directories are crawled n disk and files are hashed / requested from a cache
|
|
|
|
// - remote: directories are requested remotely to a providing client
|
|
|
|
//
|
2016-07-21 00:16:12 -04:00
|
|
|
class HashCache ;
|
|
|
|
class LocalDirectoryStorage ;
|
|
|
|
|
2016-04-14 18:25:12 -04:00
|
|
|
class DirectoryUpdater
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DirectoryUpdater() ;
|
|
|
|
|
|
|
|
// Does some updating job. Crawls the existing directories and checks wether it has been updated
|
|
|
|
// recently enough. If not, calls the directry source.
|
|
|
|
//
|
2016-07-20 16:10:51 -04:00
|
|
|
virtual void tick() =0;
|
2016-04-14 18:25:12 -04:00
|
|
|
|
|
|
|
//
|
|
|
|
};
|
|
|
|
|
|
|
|
class LocalDirectoryUpdater: public DirectoryUpdater
|
|
|
|
{
|
2016-07-21 00:16:12 -04:00
|
|
|
public:
|
|
|
|
LocalDirectoryUpdater(HashCache *hash_cache) ;
|
|
|
|
virtual void tick() ;
|
|
|
|
|
|
|
|
private:
|
|
|
|
HashCache *mHashCache ;
|
|
|
|
LocalDirectoryStorage *mSharedDirectories ;
|
2016-04-14 18:25:12 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
class RemoteDirectoryUpdater: public DirectoryUpdater
|
|
|
|
{
|
2016-07-20 16:10:51 -04:00
|
|
|
public:
|
|
|
|
virtual void tick() ;
|
2016-04-14 18:25:12 -04:00
|
|
|
};
|