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

#include <MountPointScanner.hh>

Inheritance diagram for diskCache::MountPointScanner:
Inheritance graph
[legend]
Collaboration diagram for diskCache::MountPointScanner:
Collaboration graph
[legend]

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 ()
 

Static Private Member Functions

static void decrement ()
 
static void increment ()
 
static void on_exit ()
 
static void start (const std::string &MountPoint, ScanResults &Answer)
 
static bool mount_point_reset ()
 Obtain the state indicating the need to rebuild the cache. More...
 
static bool mount_point_reset (bool Value)
 Set the state indicating the need to rebuild the cache. More...
 

Private Attributes

std::string m_mount_point
 
std::string m_results
 
ScanResultsm_scan_results
 
controller_typem_controller
 

Static Private Attributes

static LDASTools::AL::MutexLock::baton_type m_variable_baton
 Protect static variables in a threaded environment. More...
 
static LDASTools::AL::ConditionalVariable m_scan_completed
 
static LDASTools::AL::MutexLock::baton_type m_active_count_baton
 
static concurrency_type m_active_count = 0
 
static concurrency_type m_concurrency = 10
 
static LDASTools::AL::MutexLock::baton_type m_first_scan_completed_baton
 
static INT_4U m_first_scan_completed = 0
 
static LDASTools::AL::MutexLock::baton_type m_mount_point_cache_reset_baton
 
static bool m_mount_point_cache_reset = false
 
static scanner_sync_type p_scanner_sync
 Variable needed to syncronize access to scanner. More...
 
static scanner_sync_rw_type::baton_type p_scanner_sync_baton
 Syncronize access to scanner. More...
 

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

◆ decrement()

static void diskCache::MountPointScanner::decrement ( )
inlinestaticprivate

◆ 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.

◆ increment()

static void diskCache::MountPointScanner::increment ( )
inlinestaticprivate

◆ mount_point_reset() [1/2]

static bool diskCache::MountPointScanner::mount_point_reset ( )
inlinestaticprivate

Obtain the state indicating the need to rebuild the cache.

◆ mount_point_reset() [2/2]

static bool diskCache::MountPointScanner::mount_point_reset ( bool  Value)
inlinestaticprivate

Set the state indicating the need to rebuild the cache.

◆ on_exit()

void diskCache::MountPointScanner::on_exit ( )
staticprivate

◆ 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

◆ start()

void diskCache::MountPointScanner::start ( const std::string &  MountPoint,
ScanResults Answer 
)
inlinestaticprivate

◆ 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

Member Data Documentation

◆ m_active_count

MountPointScanner::concurrency_type diskCache::MountPointScanner::m_active_count = 0
staticprivate

◆ m_active_count_baton

MutexLock::baton_type diskCache::MountPointScanner::m_active_count_baton
staticprivate

◆ m_concurrency

MountPointScanner::concurrency_type diskCache::MountPointScanner::m_concurrency = 10
staticprivate

◆ m_controller

controller_type* diskCache::MountPointScanner::m_controller
private

◆ m_first_scan_completed

INT_4U diskCache::MountPointScanner::m_first_scan_completed = 0
staticprivate

◆ m_first_scan_completed_baton

MutexLock::baton_type diskCache::MountPointScanner::m_first_scan_completed_baton
staticprivate

◆ m_mount_point

std::string diskCache::MountPointScanner::m_mount_point
private

◆ m_mount_point_cache_reset

bool diskCache::MountPointScanner::m_mount_point_cache_reset = false
staticprivate

◆ m_mount_point_cache_reset_baton

MutexLock::baton_type diskCache::MountPointScanner::m_mount_point_cache_reset_baton
staticprivate

◆ m_results

std::string diskCache::MountPointScanner::m_results
private

◆ m_scan_completed

ConditionalVariable diskCache::MountPointScanner::m_scan_completed
staticprivate

◆ m_scan_results

ScanResults& diskCache::MountPointScanner::m_scan_results
private

◆ m_variable_baton

MutexLock::baton_type diskCache::MountPointScanner::m_variable_baton
staticprivate

Protect static variables in a threaded environment.

◆ p_scanner_sync

MountPointScanner::scanner_sync_type diskCache::MountPointScanner::p_scanner_sync
staticprivate
Initial value:
=
true

Variable needed to syncronize access to scanner.

◆ p_scanner_sync_baton

MountPointScanner::scanner_sync_rw_type::baton_type diskCache::MountPointScanner::p_scanner_sync_baton
staticprivate

Syncronize access to scanner.


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