ldas-tools-diskcacheAPI  2.7.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
diskCache::Cache::Directory Class Reference

Directory caching scheme. More...

#include <Directory.hh>

Collaboration diagram for diskCache::Cache::Directory:
Collaboration graph
[legend]

Classes

class  FileCacheError
 Exception thrown when a file could not be added to a cache. More...
 
class  functor_dump
 
class  functor_reset
 
class  ScanResults
 
class  StartIsNotADirectoryError
 The top most entry is not a directory. More...
 
class  SymbolicLinkError
 Report symbolic links as errors. More...
 

Public Types

enum  { MODIFIED_RESET, MODIFIED_NEW_DIRECTORY, MODIFIED_OFFLINE }
 
enum  file_type {
  UNKNOWN_TYPE, FILE_TYPE, DIRECTORY_TYPE, UNKNOWN_TYPE,
  FILE_TYPE, DIRECTORY_TYPE, UNKNOWN_TYPE, FILE_TYPE,
  DIRECTORY_TYPE
}
 
enum  directory_state {
  DIRECTORY_NEW, DIRECTORY_UPDATED, DIRECTORY_REMOVED, DIRECTORY_OFFLINE,
  DIRECTORY_NEW, DIRECTORY_UPDATED, DIRECTORY_REMOVED, DIRECTORY_OFFLINE,
  DIRECTORY_NEW, DIRECTORY_UPDATED, DIRECTORY_REMOVED, DIRECTORY_OFFLINE
}
 
enum  { MODIFIED_RESET, MODIFIED_NEW_DIRECTORY, MODIFIED_OFFLINE }
 
enum  file_type {
  UNKNOWN_TYPE, FILE_TYPE, DIRECTORY_TYPE, UNKNOWN_TYPE,
  FILE_TYPE, DIRECTORY_TYPE, UNKNOWN_TYPE, FILE_TYPE,
  DIRECTORY_TYPE
}
 
enum  directory_state {
  DIRECTORY_NEW, DIRECTORY_UPDATED, DIRECTORY_REMOVED, DIRECTORY_OFFLINE,
  DIRECTORY_NEW, DIRECTORY_UPDATED, DIRECTORY_REMOVED, DIRECTORY_OFFLINE,
  DIRECTORY_NEW, DIRECTORY_UPDATED, DIRECTORY_REMOVED, DIRECTORY_OFFLINE
}
 
enum  { MODIFIED_RESET, MODIFIED_NEW_DIRECTORY, MODIFIED_OFFLINE }
 
enum  file_type {
  UNKNOWN_TYPE, FILE_TYPE, DIRECTORY_TYPE, UNKNOWN_TYPE,
  FILE_TYPE, DIRECTORY_TYPE, UNKNOWN_TYPE, FILE_TYPE,
  DIRECTORY_TYPE
}
 
enum  directory_state {
  DIRECTORY_NEW, DIRECTORY_UPDATED, DIRECTORY_REMOVED, DIRECTORY_OFFLINE,
  DIRECTORY_NEW, DIRECTORY_UPDATED, DIRECTORY_REMOVED, DIRECTORY_OFFLINE,
  DIRECTORY_NEW, DIRECTORY_UPDATED, DIRECTORY_REMOVED, DIRECTORY_OFFLINE
}
 
typedef boost::shared_ptr< Directorydirref_type
 
typedef INT_4U size_type
 
typedef INT_4U timestamp_type
 
typedef std::set< std::string > children_type
 
typedef std::set< std::string > ignored_type
 
typedef RegistrySingleton::id_type search_id_type
 
typedef boost::shared_ptr< Streams::Streamablesearch_data_type
 
typedef LDASTools::AL::unordered_map< search_id_type, search_data_typeindex_container_type
 
typedef std::list< std::string > excluded_directories_type
 
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::WRITE, excluded_directories_typeexcluded_directories_rw_type
 
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::READ, excluded_directories_typeexcluded_directories_ro_type
 
typedef boost::shared_ptr< Directorydirref_type
 
typedef INT_4U size_type
 
typedef INT_4U timestamp_type
 
typedef std::set< std::string > children_type
 
typedef std::set< std::string > ignored_type
 
typedef RegistrySingleton::id_type search_id_type
 
typedef boost::shared_ptr< Streams::Streamablesearch_data_type
 
typedef LDASTools::AL::unordered_map< search_id_type, search_data_typeindex_container_type
 
typedef std::list< std::string > excluded_directories_type
 
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::WRITE, excluded_directories_typeexcluded_directories_rw_type
 
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::READ, excluded_directories_typeexcluded_directories_ro_type
 
typedef boost::shared_ptr< Directorydirref_type
 
typedef INT_4U size_type
 
typedef INT_4U timestamp_type
 
typedef std::set< std::string > children_type
 
typedef std::set< std::string > ignored_type
 
typedef RegistrySingleton::id_type search_id_type
 
typedef boost::shared_ptr< Streams::Streamablesearch_data_type
 
typedef LDASTools::AL::unordered_map< search_id_type, search_data_typeindex_container_type
 
typedef std::list< std::string > excluded_directories_type
 
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::WRITE, excluded_directories_typeexcluded_directories_rw_type
 
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::READ, excluded_directories_typeexcluded_directories_ro_type
 

Public Member Functions

 Directory ()
 Default Constructor. More...
 
 Directory (const std::string &Path, const std::string &Root)
 Constructor with a directory path. More...
 
 Directory (const std::string &Path, dirref_type Parent)
 Constructor with a directory path and parent. More...
 
virtual ~Directory ()
 Destructor. More...
 
void AddSubdirectory (dirref_type Dir)
 
template<typename Op >
void Children (Op &Operation) const
 Iterate over the collection of subdirectories. More...
 
template<typename Op >
void ChildrenReverse (Op &Operation) const
 Reverse iterate over the collection of subdirectories. More...
 
virtual bool Configure (const std::string &Variable, const std::string &Value)
 Allow for customization. More...
 
size_type DirectoryCount () const
 
void Find (QueryAnswer &Answer) const
 Find a collection of files. More...
 
size_type FileCount () const
 
const std::string & Fullname () const
 Return the fully qualified name of the directory. More...
 
bool IsRoot () const
 Return true if this object represents a root directory. More...
 
bool IsOffline () const
 Return true if the directory is offline. More...
 
const std::string & Name () const
 Return the relative name of the directory. More...
 
template<typename StreamT >
StreamT & Read (StreamT &Stream)
 Read the common information from a stream. More...
 
const std::string & Root () const
 Retrieve the directory where this tree is rooted. More...
 
dirref_type Scan (DirectoryManager &DirectoryCollection, ScanResults &Results, const std::string &Caller, const std::string &JobInfo) const
 Scan current directory directory. More...
 
timestamp_type TimeModified () const
 Report the last time the directory had been modified. More...
 
template<typename StreamT >
StreamT & Write (StreamT &Stream) const
 Write the information out to a stream. More...
 
 Directory ()
 Default Constructor. More...
 
 Directory (const std::string &Path, const std::string &Root)
 Constructor with a directory path. More...
 
 Directory (const std::string &Path, dirref_type Parent)
 Constructor with a directory path and parent. More...
 
virtual ~Directory ()
 Destructor. More...
 
void AddSubdirectory (dirref_type Dir)
 
template<typename Op >
void Children (Op &Operation) const
 Iterate over the collection of subdirectories. More...
 
template<typename Op >
void ChildrenReverse (Op &Operation) const
 Reverse iterate over the collection of subdirectories. More...
 
virtual bool Configure (const std::string &Variable, const std::string &Value)
 Allow for customization. More...
 
size_type DirectoryCount () const
 
void Find (QueryAnswer &Answer) const
 Find a collection of files. More...
 
size_type FileCount () const
 
const std::string & Fullname () const
 Return the fully qualified name of the directory. More...
 
bool IsRoot () const
 Return true if this object represents a root directory. More...
 
bool IsOffline () const
 Return true if the directory is offline. More...
 
const std::string & Name () const
 Return the relative name of the directory. More...
 
template<typename StreamT >
StreamT & Read (StreamT &Stream)
 Read the common information from a stream. More...
 
const std::string & Root () const
 Retrieve the directory where this tree is rooted. More...
 
dirref_type Scan (DirectoryManager &DirectoryCollection, ScanResults &Results, const std::string &Caller, const std::string &JobInfo) const
 Scan current directory directory. More...
 
timestamp_type TimeModified () const
 Report the last time the directory had been modified. More...
 
template<typename StreamT >
StreamT & Write (StreamT &Stream) const
 Write the information out to a stream. More...
 
 Directory ()
 Default Constructor. More...
 
 Directory (const std::string &Path, const std::string &Root)
 Constructor with a directory path. More...
 
 Directory (const std::string &Path, dirref_type Parent)
 Constructor with a directory path and parent. More...
 
virtual ~Directory ()
 Destructor. More...
 
void AddSubdirectory (dirref_type Dir)
 
template<typename Op >
void Children (Op &Operation) const
 Iterate over the collection of subdirectories. More...
 
template<typename Op >
void ChildrenReverse (Op &Operation) const
 Reverse iterate over the collection of subdirectories. More...
 
virtual bool Configure (const std::string &Variable, const std::string &Value)
 Allow for customization. More...
 
size_type DirectoryCount () const
 
void Find (QueryAnswer &Answer) const
 Find a collection of files. More...
 
size_type FileCount () const
 
const std::string & Fullname () const
 Return the fully qualified name of the directory. More...
 
bool IsRoot () const
 Return true if this object represents a root directory. More...
 
bool IsOffline () const
 Return true if the directory is offline. More...
 
const std::string & Name () const
 Return the relative name of the directory. More...
 
template<typename StreamT >
StreamT & Read (StreamT &Stream)
 Read the common information from a stream. More...
 
const std::string & Root () const
 Retrieve the directory where this tree is rooted. More...
 
dirref_type Scan (DirectoryManager &DirectoryCollection, ScanResults &Results, const std::string &Caller, const std::string &JobInfo) const
 Scan current directory directory. More...
 
timestamp_type TimeModified () const
 Report the last time the directory had been modified. More...
 
template<typename StreamT >
StreamT & Write (StreamT &Stream) const
 Write the information out to a stream. More...
 
template<>
OASCIIWrite (OASCII &Stream) const
 
template<>
IBinaryRead (IBinary &Stream)
 
template<>
OBinaryWrite (OBinary &Stream) const
 

Static Public Member Functions

static const excluded_directories_ro_type ExcludedDirectories ()
 Obtain patterns of directories to exclude. More...
 
static void ExcludedDirectories (excluded_directories_type &Dirs)
 Modify the list of directories to be excluded. More...
 
static const excluded_directories_ro_type ExcludedDirectories ()
 Obtain patterns of directories to exclude. More...
 
static void ExcludedDirectories (excluded_directories_type &Dirs)
 Modify the list of directories to be excluded. More...
 
static const excluded_directories_ro_type ExcludedDirectories ()
 Obtain patterns of directories to exclude. More...
 
static void ExcludedDirectories (excluded_directories_type &Dirs)
 Modify the list of directories to be excluded. More...
 

Protected Member Functions

boost::shared_ptr< Directoryparent () const
 Return the parent associated with this directory. More...
 
const children_typechildren () const
 Retrieve the set of children. More...
 
search_data_type searchData (search_id_type Key)
 
boost::shared_ptr< Directoryparent () const
 Return the parent associated with this directory. More...
 
const children_typechildren () const
 Retrieve the set of children. More...
 
search_data_type searchData (search_id_type Key)
 
boost::shared_ptr< Directoryparent () const
 Return the parent associated with this directory. More...
 
const children_typechildren () const
 Retrieve the set of children. More...
 
search_data_type searchData (search_id_type Key)
 

Private Member Functions

 Directory (const Directory &Source)
 Copy Constructor. More...
 
bool is_parent_of (dirref_type Child) const
 Check for direct relationship. More...
 
dirref_type update (ScanResults &Results, const DirectoryManager &DirectoryCollection, const StatInfo &Stat) const
 
void read_directory (DirectoryScanData &ScanData, const StatInfo &Stat)
 
void reset (boost::shared_ptr< Directory > Dir)
 
 Directory (const Directory &Source)
 Copy Constructor. More...
 
bool is_parent_of (dirref_type Child) const
 Check for direct relationship. More...
 
dirref_type update (ScanResults &Results, const DirectoryManager &DirectoryCollection, const StatInfo &Stat) const
 
void read_directory (DirectoryScanData &ScanData, const StatInfo &Stat)
 
void reset (boost::shared_ptr< Directory > Dir)
 
 Directory (const Directory &Source)
 Copy Constructor. More...
 
bool is_parent_of (dirref_type Child) const
 Check for direct relationship. More...
 
dirref_type update (ScanResults &Results, const DirectoryManager &DirectoryCollection, const StatInfo &Stat) const
 
void read_directory (DirectoryScanData &ScanData, const StatInfo &Stat)
 
void reset (boost::shared_ptr< Directory > Dir)
 

Static Private Member Functions

static excluded_directories_rw_type excluded_directories_rw ()
 Get a modifiable version of the excluded dirs. More...
 
static RegistrySingleton::id_type get_sdgtx_id ()
 Get the id for the SDGTx indexing class. More...
 
static bool is_updated (timestamp_type Old, timestamp_type New)
 
static excluded_directories_rw_type excluded_directories_rw ()
 Get a modifiable version of the excluded dirs. More...
 
static RegistrySingleton::id_type get_sdgtx_id ()
 Get the id for the SDGTx indexing class. More...
 
static bool is_updated (timestamp_type Old, timestamp_type New)
 
static excluded_directories_rw_type excluded_directories_rw ()
 Get a modifiable version of the excluded dirs. More...
 
static RegistrySingleton::id_type get_sdgtx_id ()
 Get the id for the SDGTx indexing class. More...
 
static bool is_updated (timestamp_type Old, timestamp_type New)
 

Private Attributes

index_container_type m_indexes
 
Devices::element_type device
 Device on which the directory is located. More...
 
children_type m_subdirs
 Collection of subdirectories. More...
 
ignored_type m_subdirs_ignored
 
std::string m_name
 
timestamp_type m_last_time_modified
 
std::string m_root
 
bool is_root
 
LDASTools::AL::MutexLock::baton_type m_scan_baton
 Prevent being modified by multiple threads. More...
 
directory_state m_state
 

Static Private Attributes

static LDASTools::AL::MutexLock::baton_type SDGTX_ID_baton
 
static RegistrySingleton::id_type SDGTx_ID
 
static RegistrySingleton::ascii_key_type SDGTx_ID_KEY = "SDGTx"
 
static excluded_directories_rw_type::baton_type p_excluded_directories_baton
 
static excluded_directories_type p_excluded_directories
 

Friends

class functor_reset
 

Detailed Description

Directory caching scheme.

This caching scheme is for the caching of directory information. It is not used directly by end users to search for files, but instead is used as the driver for detecting changes to the file system and causing search caches to be updated.

Member Typedef Documentation

◆ children_type [1/3]

◆ children_type [2/3]

◆ children_type [3/3]

◆ dirref_type [1/3]

◆ dirref_type [2/3]

◆ dirref_type [3/3]

◆ excluded_directories_ro_type [1/3]

typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::READ, excluded_directories_type > diskCache::Cache::Directory::excluded_directories_ro_type

◆ excluded_directories_ro_type [2/3]

typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::READ, excluded_directories_type > diskCache::Cache::Directory::excluded_directories_ro_type

◆ excluded_directories_ro_type [3/3]

typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::READ, excluded_directories_type > diskCache::Cache::Directory::excluded_directories_ro_type

◆ excluded_directories_rw_type [1/3]

typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::WRITE, excluded_directories_type > diskCache::Cache::Directory::excluded_directories_rw_type

◆ excluded_directories_rw_type [2/3]

typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::WRITE, excluded_directories_type > diskCache::Cache::Directory::excluded_directories_rw_type

◆ excluded_directories_rw_type [3/3]

typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::WRITE, excluded_directories_type > diskCache::Cache::Directory::excluded_directories_rw_type

◆ excluded_directories_type [1/3]

◆ excluded_directories_type [2/3]

◆ excluded_directories_type [3/3]

◆ ignored_type [1/3]

◆ ignored_type [2/3]

◆ ignored_type [3/3]

◆ index_container_type [1/3]

◆ index_container_type [2/3]

◆ index_container_type [3/3]

◆ search_data_type [1/3]

◆ search_data_type [2/3]

◆ search_data_type [3/3]

◆ search_id_type [1/3]

◆ search_id_type [2/3]

◆ search_id_type [3/3]

◆ size_type [1/3]

◆ size_type [2/3]

◆ size_type [3/3]

◆ timestamp_type [1/3]

◆ timestamp_type [2/3]

◆ timestamp_type [3/3]

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MODIFIED_RESET 

Directory needs to be rescanned.

This state is useful for flagging a single directory for rescanning. Some examples of when a directory would be flagged in this manor would be the:

  • one second bug
  • Symbolic links appear in the directory.
MODIFIED_NEW_DIRECTORY 

Directory has been newly created.

When a directory is first seen, it is given this state. This allows for some optimization as it does not need to Calculate any differences.

MODIFIED_OFFLINE 

A timeout occured during reading.

This error indicates that a directory or subdirectory received a timeout error condition during a scan. The mount point was flagged as being offline and flagged with this state. Once the mount point becomes available, the entire mount point is rescanned.

◆ anonymous enum

anonymous enum
Enumerator
MODIFIED_RESET 

Directory needs to be rescanned.

This state is useful for flagging a single directory for rescanning. Some examples of when a directory would be flagged in this manor would be the:

  • one second bug
  • Symbolic links appear in the directory.
MODIFIED_NEW_DIRECTORY 

Directory has been newly created.

When a directory is first seen, it is given this state. This allows for some optimization as it does not need to Calculate any differences.

MODIFIED_OFFLINE 

A timeout occured during reading.

This error indicates that a directory or subdirectory received a timeout error condition during a scan. The mount point was flagged as being offline and flagged with this state. Once the mount point becomes available, the entire mount point is rescanned.

◆ anonymous enum

anonymous enum
Enumerator
MODIFIED_RESET 

Directory needs to be rescanned.

This state is useful for flagging a single directory for rescanning. Some examples of when a directory would be flagged in this manor would be the:

  • one second bug
  • Symbolic links appear in the directory.
MODIFIED_NEW_DIRECTORY 

Directory has been newly created.

When a directory is first seen, it is given this state. This allows for some optimization as it does not need to Calculate any differences.

MODIFIED_OFFLINE 

A timeout occured during reading.

This error indicates that a directory or subdirectory received a timeout error condition during a scan. The mount point was flagged as being offline and flagged with this state. Once the mount point becomes available, the entire mount point is rescanned.

◆ directory_state [1/3]

Enumerator
DIRECTORY_NEW 
DIRECTORY_UPDATED 
DIRECTORY_REMOVED 
DIRECTORY_OFFLINE 
DIRECTORY_NEW 
DIRECTORY_UPDATED 
DIRECTORY_REMOVED 
DIRECTORY_OFFLINE 
DIRECTORY_NEW 
DIRECTORY_UPDATED 
DIRECTORY_REMOVED 
DIRECTORY_OFFLINE 

◆ directory_state [2/3]

Enumerator
DIRECTORY_NEW 
DIRECTORY_UPDATED 
DIRECTORY_REMOVED 
DIRECTORY_OFFLINE 
DIRECTORY_NEW 
DIRECTORY_UPDATED 
DIRECTORY_REMOVED 
DIRECTORY_OFFLINE 
DIRECTORY_NEW 
DIRECTORY_UPDATED 
DIRECTORY_REMOVED 
DIRECTORY_OFFLINE 

◆ directory_state [3/3]

Enumerator
DIRECTORY_NEW 
DIRECTORY_UPDATED 
DIRECTORY_REMOVED 
DIRECTORY_OFFLINE 
DIRECTORY_NEW 
DIRECTORY_UPDATED 
DIRECTORY_REMOVED 
DIRECTORY_OFFLINE 
DIRECTORY_NEW 
DIRECTORY_UPDATED 
DIRECTORY_REMOVED 
DIRECTORY_OFFLINE 

◆ file_type [1/3]

Enumerator
UNKNOWN_TYPE 
FILE_TYPE 
DIRECTORY_TYPE 
UNKNOWN_TYPE 
FILE_TYPE 
DIRECTORY_TYPE 
UNKNOWN_TYPE 
FILE_TYPE 
DIRECTORY_TYPE 

◆ file_type [2/3]

Enumerator
UNKNOWN_TYPE 
FILE_TYPE 
DIRECTORY_TYPE 
UNKNOWN_TYPE 
FILE_TYPE 
DIRECTORY_TYPE 
UNKNOWN_TYPE 
FILE_TYPE 
DIRECTORY_TYPE 

◆ file_type [3/3]

Enumerator
UNKNOWN_TYPE 
FILE_TYPE 
DIRECTORY_TYPE 
UNKNOWN_TYPE 
FILE_TYPE 
DIRECTORY_TYPE 
UNKNOWN_TYPE 
FILE_TYPE 
DIRECTORY_TYPE 

Constructor & Destructor Documentation

◆ Directory() [1/12]

diskCache::Cache::Directory::Directory ( )

Default Constructor.

◆ Directory() [2/12]

diskCache::Cache::Directory::Directory ( const std::string &  Path,
const std::string &  Root 
)

Constructor with a directory path.

Parameters
[in]PathThe fully qualified path.
[in]RootThe root directory

◆ Directory() [3/12]

diskCache::Cache::Directory::Directory ( const std::string &  Path,
dirref_type  Parent 
)

Constructor with a directory path and parent.

Parameters
[in]PathThe fully qualified path.
[in]ParentThe parent of this node

◆ ~Directory() [1/3]

diskCache::Cache::Directory::~Directory ( )
virtual

Destructor.

◆ Directory() [4/12]

diskCache::Cache::Directory::Directory ( const Directory Source)
private

Copy Constructor.

Implements the copy constructor for the class.

◆ Directory() [5/12]

diskCache::Cache::Directory::Directory ( )

Default Constructor.

◆ Directory() [6/12]

diskCache::Cache::Directory::Directory ( const std::string &  Path,
const std::string &  Root 
)

Constructor with a directory path.

Parameters
[in]PathThe fully qualified path.
[in]RootThe root directory

◆ Directory() [7/12]

diskCache::Cache::Directory::Directory ( const std::string &  Path,
dirref_type  Parent 
)

Constructor with a directory path and parent.

Parameters
[in]PathThe fully qualified path.
[in]ParentThe parent of this node

◆ ~Directory() [2/3]

virtual diskCache::Cache::Directory::~Directory ( )
virtual

Destructor.

◆ Directory() [8/12]

diskCache::Cache::Directory::Directory ( const Directory Source)
private

Copy Constructor.

◆ Directory() [9/12]

diskCache::Cache::Directory::Directory ( )

Default Constructor.

◆ Directory() [10/12]

diskCache::Cache::Directory::Directory ( const std::string &  Path,
const std::string &  Root 
)

Constructor with a directory path.

Parameters
[in]PathThe fully qualified path.
[in]RootThe root directory

◆ Directory() [11/12]

diskCache::Cache::Directory::Directory ( const std::string &  Path,
dirref_type  Parent 
)

Constructor with a directory path and parent.

Parameters
[in]PathThe fully qualified path.
[in]ParentThe parent of this node

◆ ~Directory() [3/3]

virtual diskCache::Cache::Directory::~Directory ( )
virtual

Destructor.

◆ Directory() [12/12]

diskCache::Cache::Directory::Directory ( const Directory Source)
private

Copy Constructor.

Member Function Documentation

◆ AddSubdirectory() [1/3]

void diskCache::Cache::Directory::AddSubdirectory ( dirref_type  Dir)
inline

◆ AddSubdirectory() [2/3]

void diskCache::Cache::Directory::AddSubdirectory ( dirref_type  Dir)
inline

◆ AddSubdirectory() [3/3]

void diskCache::Cache::Directory::AddSubdirectory ( dirref_type  Dir)
inline

◆ Children() [1/3]

template<typename Op >
void diskCache::Cache::Directory::Children ( Op &  Operation) const
inline

Iterate over the collection of subdirectories.

Parameters
[out]OperationThis is the action that should be taken for each subdirectory.

◆ Children() [2/3]

template<typename Op >
void diskCache::Cache::Directory::Children ( Op &  Operation) const

Iterate over the collection of subdirectories.

Parameters
[out]OperationThis is the action that should be taken for each subdirectory.

◆ Children() [3/3]

template<typename Op >
void diskCache::Cache::Directory::Children ( Op &  Operation) const

Iterate over the collection of subdirectories.

Parameters
[out]OperationThis is the action that should be taken for each subdirectory.

◆ children() [1/3]

const children_type& diskCache::Cache::Directory::children ( ) const
protected

Retrieve the set of children.

◆ children() [2/3]

const Directory::children_type & diskCache::Cache::Directory::children ( ) const
inlineprotected

Retrieve the set of children.

Retrieve a collection of directories that are children of this directory.

◆ children() [3/3]

const children_type& diskCache::Cache::Directory::children ( ) const
protected

Retrieve the set of children.

◆ ChildrenReverse() [1/3]

template<typename Op >
void diskCache::Cache::Directory::ChildrenReverse ( Op &  Operation) const

Reverse iterate over the collection of subdirectories.

Parameters
[out]OperationThis is the action that should be taken for each subdirectory.

◆ ChildrenReverse() [2/3]

template<typename Op >
void diskCache::Cache::Directory::ChildrenReverse ( Op &  Operation) const
inline

Reverse iterate over the collection of subdirectories.

Parameters
[out]OperationThis is the action that should be taken for each subdirectory.

◆ ChildrenReverse() [3/3]

template<typename Op >
void diskCache::Cache::Directory::ChildrenReverse ( Op &  Operation) const

Reverse iterate over the collection of subdirectories.

Parameters
[out]OperationThis is the action that should be taken for each subdirectory.

◆ Configure() [1/3]

virtual bool diskCache::Cache::Directory::Configure ( const std::string &  Variable,
const std::string &  Value 
)
virtual

Allow for customization.

Parameters
[in]VariableName of the option to modify
[in]ValueThe ascii string representation of the value for the option.
Returns
Upon successful setting of the option, true is returned; false otherwise.

◆ Configure() [2/3]

bool diskCache::Cache::Directory::Configure ( const std::string &  Variable,
const std::string &  Value 
)
virtual

Allow for customization.

Parameters
[in]VariableName of the option to modify
[in]ValueThe ascii string representation of the value for the option.
Returns
Upon successful setting of the option, true is returned; false otherwise.

Configuration of the directory cache understands the following variables:

  • exclude - A colon separated list of patterns which describe directories to be ignored.

◆ Configure() [3/3]

virtual bool diskCache::Cache::Directory::Configure ( const std::string &  Variable,
const std::string &  Value 
)
virtual

Allow for customization.

Parameters
[in]VariableName of the option to modify
[in]ValueThe ascii string representation of the value for the option.
Returns
Upon successful setting of the option, true is returned; false otherwise.

◆ DirectoryCount() [1/3]

size_type diskCache::Cache::Directory::DirectoryCount ( ) const

◆ DirectoryCount() [2/3]

Directory::size_type diskCache::Cache::Directory::DirectoryCount ( ) const
inline

◆ DirectoryCount() [3/3]

size_type diskCache::Cache::Directory::DirectoryCount ( ) const

◆ excluded_directories_rw() [1/3]

static excluded_directories_rw_type diskCache::Cache::Directory::excluded_directories_rw ( )
staticprivate

Get a modifiable version of the excluded dirs.

◆ excluded_directories_rw() [2/3]

Directory::excluded_directories_rw_type diskCache::Cache::Directory::excluded_directories_rw ( )
inlinestaticprivate

Get a modifiable version of the excluded dirs.

◆ excluded_directories_rw() [3/3]

static excluded_directories_rw_type diskCache::Cache::Directory::excluded_directories_rw ( )
staticprivate

Get a modifiable version of the excluded dirs.

◆ ExcludedDirectories() [1/6]

static const excluded_directories_ro_type diskCache::Cache::Directory::ExcludedDirectories ( )
static

Obtain patterns of directories to exclude.

◆ ExcludedDirectories() [2/6]

const Directory::excluded_directories_ro_type diskCache::Cache::Directory::ExcludedDirectories ( )
inlinestatic

Obtain patterns of directories to exclude.

◆ ExcludedDirectories() [3/6]

static const excluded_directories_ro_type diskCache::Cache::Directory::ExcludedDirectories ( )
static

Obtain patterns of directories to exclude.

◆ ExcludedDirectories() [4/6]

static void diskCache::Cache::Directory::ExcludedDirectories ( excluded_directories_type Dirs)
static

Modify the list of directories to be excluded.

Parameters
[in,out]DirsThe list of new directories to be excluded. The list passed by this variable will be swapped with the current list of directories to be excluded.

◆ ExcludedDirectories() [5/6]

void diskCache::Cache::Directory::ExcludedDirectories ( excluded_directories_type Dirs)
inlinestatic

Modify the list of directories to be excluded.

Parameters
[in,out]DirsThe list of new directories to be excluded. The list passed by this variable will be swapped with the current list of directories to be excluded.

◆ ExcludedDirectories() [6/6]

static void diskCache::Cache::Directory::ExcludedDirectories ( excluded_directories_type Dirs)
static

Modify the list of directories to be excluded.

Parameters
[in,out]DirsThe list of new directories to be excluded. The list passed by this variable will be swapped with the current list of directories to be excluded.

◆ FileCount() [1/3]

size_type diskCache::Cache::Directory::FileCount ( ) const

◆ FileCount() [2/3]

size_type diskCache::Cache::Directory::FileCount ( ) const

◆ FileCount() [3/3]

Directory::size_type diskCache::Cache::Directory::FileCount ( ) const
inline

◆ Find() [1/3]

void diskCache::Cache::Directory::Find ( QueryAnswer Answer) const

Find a collection of files.

Parameters
[in]AnswerLocal storage for query and answer.

◆ Find() [2/3]

void diskCache::Cache::Directory::Find ( QueryAnswer Answer) const

Find a collection of files.

Parameters
[in]AnswerLocal storage for query and answer.

◆ Find() [3/3]

void diskCache::Cache::Directory::Find ( QueryAnswer Answer) const

Find a collection of files.

Parameters
[in]AnswerLocal storage for query and answer.

◆ Fullname() [1/3]

const std::string& diskCache::Cache::Directory::Fullname ( ) const

Return the fully qualified name of the directory.

◆ Fullname() [2/3]

const std::string& diskCache::Cache::Directory::Fullname ( ) const

Return the fully qualified name of the directory.

◆ Fullname() [3/3]

const std::string & diskCache::Cache::Directory::Fullname ( ) const
inline

Return the fully qualified name of the directory.

Retieve the fully pathed name for the requested directory. This is achieved by walking up the geneology until the root node.

◆ get_sdgtx_id() [1/3]

static RegistrySingleton::id_type diskCache::Cache::Directory::get_sdgtx_id ( )
staticprivate

Get the id for the SDGTx indexing class.

◆ get_sdgtx_id() [2/3]

RegistrySingleton::id_type diskCache::Cache::Directory::get_sdgtx_id ( )
inlinestaticprivate

Get the id for the SDGTx indexing class.

Retrieve the numeric identifier for the SDGTx indexing class.

◆ get_sdgtx_id() [3/3]

static RegistrySingleton::id_type diskCache::Cache::Directory::get_sdgtx_id ( )
staticprivate

Get the id for the SDGTx indexing class.

◆ is_parent_of() [1/3]

bool diskCache::Cache::Directory::is_parent_of ( dirref_type  Child) const
private

Check for direct relationship.

◆ is_parent_of() [2/3]

bool diskCache::Cache::Directory::is_parent_of ( dirref_type  Child) const
private

Check for direct relationship.

◆ is_parent_of() [3/3]

bool diskCache::Cache::Directory::is_parent_of ( dirref_type  Child) const
private

Check for direct relationship.

◆ is_updated() [1/3]

static bool diskCache::Cache::Directory::is_updated ( timestamp_type  Old,
timestamp_type  New 
)
staticprivate

◆ is_updated() [2/3]

bool diskCache::Cache::Directory::is_updated ( timestamp_type  Old,
timestamp_type  New 
)
inlinestaticprivate

◆ is_updated() [3/3]

static bool diskCache::Cache::Directory::is_updated ( timestamp_type  Old,
timestamp_type  New 
)
staticprivate

◆ IsOffline() [1/3]

bool diskCache::Cache::Directory::IsOffline ( ) const

Return true if the directory is offline.

◆ IsOffline() [2/3]

bool diskCache::Cache::Directory::IsOffline ( ) const
inline

Return true if the directory is offline.

◆ IsOffline() [3/3]

bool diskCache::Cache::Directory::IsOffline ( ) const

Return true if the directory is offline.

◆ IsRoot() [1/3]

bool diskCache::Cache::Directory::IsRoot ( ) const
inline

Return true if this object represents a root directory.

◆ IsRoot() [2/3]

bool diskCache::Cache::Directory::IsRoot ( ) const

Return true if this object represents a root directory.

◆ IsRoot() [3/3]

bool diskCache::Cache::Directory::IsRoot ( ) const

Return true if this object represents a root directory.

◆ Name() [1/3]

const std::string & diskCache::Cache::Directory::Name ( ) const
inline

Return the relative name of the directory.

Returns
The relative name of the directory.

The relative name is simple the name associated with this directory information as referenced by its parent. A root directory name must be fully qualified.

◆ Name() [2/3]

const std::string& diskCache::Cache::Directory::Name ( ) const

Return the relative name of the directory.

Returns
The relative name of the directory.

◆ Name() [3/3]

const std::string& diskCache::Cache::Directory::Name ( ) const

Return the relative name of the directory.

Returns
The relative name of the directory.

◆ parent() [1/3]

boost::shared_ptr< Directory > diskCache::Cache::Directory::parent ( ) const
protected

Return the parent associated with this directory.

◆ parent() [2/3]

boost::shared_ptr< Directory > diskCache::Cache::Directory::parent ( ) const
protected

Return the parent associated with this directory.

◆ parent() [3/3]

boost::shared_ptr< Directory > diskCache::Cache::Directory::parent ( ) const
protected

Return the parent associated with this directory.

◆ Read() [1/4]

template<>
IBinary& diskCache::Cache::Directory::Read ( IBinary Stream)

Initialize the memory contents from the stream. This reads the contents for a single directory.

Todo:
This can be optimized by reading the root followed by reading the path relative to the root. The current implementation is waistful as the root portion is in both names.

◆ Read() [2/4]

template<typename StreamT >
StreamT& diskCache::Cache::Directory::Read ( StreamT &  Stream)

Read the common information from a stream.

◆ Read() [3/4]

template<typename StreamT >
StreamT& diskCache::Cache::Directory::Read ( StreamT &  Stream)

Read the common information from a stream.

◆ Read() [4/4]

template<typename StreamT >
StreamT& diskCache::Cache::Directory::Read ( StreamT &  Stream)

Read the common information from a stream.

◆ read_directory() [1/3]

void diskCache::Cache::Directory::read_directory ( DirectoryScanData ScanData,
const StatInfo Stat 
)
private

◆ read_directory() [2/3]

void diskCache::Cache::Directory::read_directory ( DirectoryScanData ScanData,
const StatInfo Stat 
)
private

◆ read_directory() [3/3]

void diskCache::Cache::Directory::read_directory ( DirectoryScanData ScanData,
const StatInfo Stat 
)
private

◆ reset() [1/3]

void diskCache::Cache::Directory::reset ( boost::shared_ptr< Directory Dir)
private

◆ reset() [2/3]

void diskCache::Cache::Directory::reset ( boost::shared_ptr< Directory Dir)
private

◆ reset() [3/3]

void diskCache::Cache::Directory::reset ( boost::shared_ptr< Directory Dir)
private

◆ Root() [1/3]

const std::string& diskCache::Cache::Directory::Root ( ) const

Retrieve the directory where this tree is rooted.

Returns
The name of the earliest node in the tree.

◆ Root() [2/3]

const std::string& diskCache::Cache::Directory::Root ( ) const

Retrieve the directory where this tree is rooted.

Returns
The name of the earliest node in the tree.

◆ Root() [3/3]

const std::string & diskCache::Cache::Directory::Root ( ) const
inline

Retrieve the directory where this tree is rooted.

Returns
The name of the earliest node in the tree.

The root name is the name of the node that appears highest in the tree. Taking any node as a start, the tree is assended until the one with no parent is reached. It is the name of this node which is returned.

◆ Scan() [1/3]

Directory::dirref_type diskCache::Cache::Directory::Scan ( DirectoryManager DirectoryCollection,
ScanResults Results,
const std::string &  Caller,
const std::string &  JobInfo 
) const

Scan current directory directory.

Returns
If differences are found while scanning, then a new node is returned which reflects the current status of the directory. All other cases result a NULL node being returned.

◆ Scan() [2/3]

dirref_type diskCache::Cache::Directory::Scan ( DirectoryManager DirectoryCollection,
ScanResults Results,
const std::string &  Caller,
const std::string &  JobInfo 
) const

Scan current directory directory.

Returns
If differences are found while scanning, then a new node is returned which reflects the current status of the directory. All other cases result a NULL node being returned.

◆ Scan() [3/3]

dirref_type diskCache::Cache::Directory::Scan ( DirectoryManager DirectoryCollection,
ScanResults Results,
const std::string &  Caller,
const std::string &  JobInfo 
) const

Scan current directory directory.

Returns
If differences are found while scanning, then a new node is returned which reflects the current status of the directory. All other cases result a NULL node being returned.

◆ searchData() [1/3]

search_data_type diskCache::Cache::Directory::searchData ( search_id_type  Key)
protected

◆ searchData() [2/3]

Directory::search_data_type diskCache::Cache::Directory::searchData ( search_id_type  Key)
inlineprotected

◆ searchData() [3/3]

search_data_type diskCache::Cache::Directory::searchData ( search_id_type  Key)
protected

◆ TimeModified() [1/3]

timestamp_type diskCache::Cache::Directory::TimeModified ( ) const

Report the last time the directory had been modified.

◆ TimeModified() [2/3]

Directory::timestamp_type diskCache::Cache::Directory::TimeModified ( ) const
inline

Report the last time the directory had been modified.

◆ TimeModified() [3/3]

timestamp_type diskCache::Cache::Directory::TimeModified ( ) const

Report the last time the directory had been modified.

◆ update() [1/3]

dirref_type diskCache::Cache::Directory::update ( ScanResults Results,
const DirectoryManager DirectoryCollection,
const StatInfo Stat 
) const
private

◆ update() [2/3]

dirref_type diskCache::Cache::Directory::update ( ScanResults Results,
const DirectoryManager DirectoryCollection,
const StatInfo Stat 
) const
private

◆ update() [3/3]

Directory::dirref_type diskCache::Cache::Directory::update ( ScanResults Results,
const DirectoryManager DirectoryCollection,
const StatInfo Stat 
) const
private

◆ Write() [1/5]

template<>
OASCII& diskCache::Cache::Directory::Write ( OASCII Stream) const
Todo:
Loop over all of the associated indexes and have them dump their information to the Stream NOTE: This currently only dumps the SDTx information

◆ Write() [2/5]

template<>
OBinary& diskCache::Cache::Directory::Write ( OBinary Stream) const
Todo:
This can be optimized by writing the root followed by Writing the path relative to the root. The current implementation is waistful as the root portion is in both names.
Todo:
Loop over all of the associated indexes and have them dump their information to the Stream

◆ Write() [3/5]

template<typename StreamT >
StreamT& diskCache::Cache::Directory::Write ( StreamT &  Stream) const

Write the information out to a stream.

◆ Write() [4/5]

template<typename StreamT >
StreamT& diskCache::Cache::Directory::Write ( StreamT &  Stream) const

Write the information out to a stream.

◆ Write() [5/5]

template<typename StreamT >
StreamT& diskCache::Cache::Directory::Write ( StreamT &  Stream) const

Write the information out to a stream.

Friends And Related Function Documentation

◆ functor_reset

functor_reset
friend

Member Data Documentation

◆ device

Devices::element_type diskCache::Cache::Directory::device
mutableprivate

Device on which the directory is located.

◆ is_root

bool diskCache::Cache::Directory::is_root
private

◆ m_indexes

index_container_type diskCache::Cache::Directory::m_indexes
private

◆ m_last_time_modified

timestamp_type diskCache::Cache::Directory::m_last_time_modified
private

◆ m_name

std::string diskCache::Cache::Directory::m_name
private

◆ m_root

std::string diskCache::Cache::Directory::m_root
private

◆ m_scan_baton

LDASTools::AL::MutexLock::baton_type diskCache::Cache::Directory::m_scan_baton
mutableprivate

Prevent being modified by multiple threads.

This variable is used to syncronize access to the scan method so multiple scanners can be used on the

◆ m_state

directory_state diskCache::Cache::Directory::m_state
private

◆ m_subdirs

children_type diskCache::Cache::Directory::m_subdirs
private

Collection of subdirectories.

This collection of subdirectories stores the fully qualified name of the directory.

Todo:
Optimization - The collection of subdirectory names should only contain the name relative to the current directory.

This collection of subdirectories stores the fully qualified name of the directory.

Todo:
Optimization - The collection of subdirectory names should only contain the name relative to the current directory.

This collection of subdirectories stores the fully qualified name of the directory.

Todo:
Optimization - The collection of subdirectory names should only contain the name relative to the current directory.

◆ m_subdirs_ignored

ignored_type diskCache::Cache::Directory::m_subdirs_ignored
private

◆ p_excluded_directories

static excluded_directories_type diskCache::Cache::Directory::p_excluded_directories
staticprivate

◆ p_excluded_directories_baton

static excluded_directories_rw_type::baton_type diskCache::Cache::Directory::p_excluded_directories_baton
staticprivate

◆ SDGTx_ID

static RegistrySingleton::id_type diskCache::Cache::Directory::SDGTx_ID
staticprivate
Initial value:

◆ SDGTX_ID_baton

static LDASTools::AL::MutexLock::baton_type diskCache::Cache::Directory::SDGTX_ID_baton
staticprivate

◆ SDGTx_ID_KEY

static RegistrySingleton::ascii_key_type diskCache::Cache::Directory::SDGTx_ID_KEY = "SDGTx"
staticprivate

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