ldas-tools-diskcacheAPI  2.5.6
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
diskCache::MountPointScanner Class Reference

#include <MountPointScanner.hh>

Inheritance diagram for diskCache::MountPointScanner:

Classes

class  ScanResults
 
class  SyncRequest
 

Public Types

typedef MountPointManagerSingleton::mount_point_name_container_type mount_point_container_type
 
typedef INT_4U concurrency_type
 
typedef bool scanner_sync_type
 
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::WRITE, scanner_sync_typescanner_sync_rw_type
 
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::READ, scanner_sync_typescanner_sync_ro_type
 
typedef LDASTools::AL::TaskThread controller_type
 

Public Member Functions

 MountPointScanner (const std::string &MountPoint, ScanResults &Answer, controller_type *Controller)
 
 ~MountPointScanner ()
 
const std::string & Results () const
 
virtual void OnCompletion (int TaskThreadState)
 
virtual void operator() ()
 

Static Public Member Functions

static INT_4U Active ()
 
static bool CancellationRequest (std::string &Reason)
 Check the cancellation state. More...
 
static concurrency_type Concurrency ()
 
static void Concurrency (concurrency_type Value)
 
static bool FirstScanComplete ()
 Reports the status of having completed the first scan. More...
 
static void FirstScanSet (bool Value)
 Sets the status of having completed the first scan. More...
 
static INT_4U ScanIteration ()
 Reports the status of having completed the first scan. More...
 
static void CriticalSection (bool Value)
 
static void Rebuild ()
 Rebuild of the cache. More...
 
static void Scan (const mount_point_container_type &MountPoints, ScanResults &Answer)
 
static scanner_sync_rw_type Sync ()
 
static scanner_sync_ro_type SyncRO ()
 
static void Wait ()
 

Member Typedef Documentation

◆ concurrency_type

◆ controller_type

typedef LDASTools::AL::TaskThread diskCache::MountPointScanner::controller_type

◆ mount_point_container_type

◆ scanner_sync_ro_type

typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::READ, scanner_sync_type > diskCache::MountPointScanner::scanner_sync_ro_type

◆ scanner_sync_rw_type

typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::WRITE, scanner_sync_type > diskCache::MountPointScanner::scanner_sync_rw_type

◆ scanner_sync_type

Constructor & Destructor Documentation

◆ MountPointScanner()

diskCache::MountPointScanner::MountPointScanner ( const std::string &  MountPoint,
ScanResults Answer,
controller_type Controller 
)
inline

◆ ~MountPointScanner()

diskCache::MountPointScanner::~MountPointScanner ( )
inline

Member Function Documentation

◆ Active()

static INT_4U diskCache::MountPointScanner::Active ( )
inlinestatic

◆ CancellationRequest()

bool diskCache::MountPointScanner::CancellationRequest ( std::string &  Reason)
static

Check the cancellation state.

Parameters
[out]ReasonIf the MountPointScanner is requesting that scanning threads cancel themselves, this string will have a meassage explaining why.
Returns
If the MountPointScanner is requesting that scanning threads cancel themselves, the value true is returned; false otherwise.

This method allows for cooperative thread cancellation. Threads that may block the scanning of the mount points, should periodicly check if a request to terminate the current scan has been made. This allows threads to cancel themselves when it may be easier to perform any cleanup that needs to occur.

◆ Concurrency() [1/2]

MountPointScanner::concurrency_type diskCache::MountPointScanner::Concurrency ( )
inlinestatic

◆ Concurrency() [2/2]

void diskCache::MountPointScanner::Concurrency ( concurrency_type  Value)
inlinestatic

◆ CriticalSection()

static void diskCache::MountPointScanner::CriticalSection ( bool  Value)
inlinestatic

◆ FirstScanComplete()

bool diskCache::MountPointScanner::FirstScanComplete ( )
inlinestatic

Reports the status of having completed the first scan.

Returns
If the first scan through all entries in the mount point list has completed, the value true is returned; otherwise false

This method simply returns true once the scanner is in update mode. If this method returns false, then the scanner is working on its first pass through the mount point list.

◆ FirstScanSet()

void diskCache::MountPointScanner::FirstScanSet ( bool  Value)
inlinestatic

Sets the status of having completed the first scan.

Some actions need to reset the status concearning the first scan.

Parameters
[in]ValueNew value for the status of having completed the first scan.

◆ OnCompletion()

void diskCache::MountPointScanner::OnCompletion ( int  TaskThreadState)
virtual
Todo:
Report scanning results

◆ operator()()

void diskCache::MountPointScanner::operator() ( )
virtual

◆ Rebuild()

void diskCache::MountPointScanner::Rebuild ( )
inlinestatic

Rebuild of the cache.

Set up the scanner to do a full rebuild of the cache.

◆ Results()

const std::string& diskCache::MountPointScanner::Results ( ) const
inline

◆ Scan()

void diskCache::MountPointScanner::Scan ( const mount_point_container_type MountPoints,
ScanResults Answer 
)
static

◆ ScanIteration()

INT_4U diskCache::MountPointScanner::ScanIteration ( )
inlinestatic

Reports the status of having completed the first scan.

Returns
If the first scan through all entries in the mount point list has completed, the value true is returned; otherwise false

◆ Sync()

MountPointScanner::scanner_sync_rw_type diskCache::MountPointScanner::Sync ( )
inlinestatic

◆ SyncRO()

MountPointScanner::scanner_sync_ro_type diskCache::MountPointScanner::SyncRO ( )
inlinestatic

◆ Wait()

static void diskCache::MountPointScanner::Wait ( )
inlinestatic

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