ldas-tools-diskcacheAPI  2.7.1
Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
diskCache::Cache::DirectoryManager Class Reference

#include <DirectoryManager.hh>

Inheritance diagram for diskCache::Cache::DirectoryManager:
Inheritance graph
[legend]

Classes

class  child_functor
 

Public Types

typedef Directory::ScanResults ScanResults
 
typedef boost::shared_ptr< Directorydirectory_ref_type
 
typedef Directory::ScanResults ScanResults
 
typedef boost::shared_ptr< Directorydirectory_ref_type
 
typedef Directory::ScanResults ScanResults
 
typedef boost::shared_ptr< Directorydirectory_ref_type
 

Public Member Functions

 DirectoryManager ()
 
bool AddDirectory (directory_ref_type Directory)
 Add a new directory to the collection. More...
 
void CreateDirectory (const std::string &Name, const std::string &Root)
 Create a new directory to be added to the collection. More...
 
void Find (const std::string &Root, QueryAnswer &Answer) const
 Locate files. More...
 
void OnUpdate (directory_ref_type Dir, ScanResults &Results)
 Update information concearning a single directory. More...
 
directory_ref_type ReferenceDirectory (const std::string &Name) const
 Locate a directory in the collection. More...
 
void RemoveDirectory (const std::string &Name)
 Remove a directory from the collection. More...
 
void RemoveDirectoryRecursively (const std::string &Name)
 Remove a directory from the collection. More...
 
template<typename StreamT >
StreamT & Read (StreamT &Stream)
 
void Scan (directory_ref_type Dir, ScanResults &Results)
 Scan the directory for changes. More...
 
void Scan (const std::string &Root, ScanResults &Results)
 Recursively scan the directory for changes. More...
 
template<typename StreamT >
StreamT & Write (StreamT &Stream)
 
template<class Op >
void Walk (Op Operation, const std::string &Root, bool IncludeOffline=false)
 Walk the tree performing the requested operation. More...
 
template<class Op >
void Walk (const Op Operation, const std::string &Root, bool IncludeOffline=false) const
 Walk the tree performing the requested operation. More...
 
template<class Op >
void WalkDepthFirst (Op Operation, const std::string &Root)
 Walk the tree depth first performing the requested operation. More...
 
 DirectoryManager ()
 
bool AddDirectory (directory_ref_type Directory)
 Add a new directory to the collection. More...
 
void CreateDirectory (const std::string &Name, const std::string &Root)
 Create a new directory to be added to the collection. More...
 
void Find (const std::string &Root, QueryAnswer &Answer) const
 Locate files. More...
 
void OnUpdate (directory_ref_type Dir, ScanResults &Results)
 Update information concearning a single directory. More...
 
directory_ref_type ReferenceDirectory (const std::string &Name) const
 Locate a directory in the collection. More...
 
void RemoveDirectory (const std::string &Name)
 Remove a directory from the collection. More...
 
void RemoveDirectoryRecursively (const std::string &Name)
 Remove a directory from the collection. More...
 
template<typename StreamT >
StreamT & Read (StreamT &Stream)
 
void Scan (directory_ref_type Dir, ScanResults &Results)
 Scan the directory for changes. More...
 
void Scan (const std::string &Root, ScanResults &Results)
 Recursively scan the directory for changes. More...
 
template<typename StreamT >
StreamT & Write (StreamT &Stream)
 
template<class Op >
void Walk (Op Operation, const std::string &Root, bool IncludeOffline=false)
 Walk the tree performing the requested operation. More...
 
template<class Op >
void Walk (const Op Operation, const std::string &Root, bool IncludeOffline=false) const
 Walk the tree performing the requested operation. More...
 
template<class Op >
void WalkDepthFirst (Op Operation, const std::string &Root)
 Walk the tree depth first performing the requested operation. More...
 
 DirectoryManager ()
 
bool AddDirectory (directory_ref_type Directory)
 Add a new directory to the collection. More...
 
void CreateDirectory (const std::string &Name, const std::string &Root)
 Create a new directory to be added to the collection. More...
 
void Find (const std::string &Root, QueryAnswer &Answer) const
 Locate files. More...
 
void OnUpdate (directory_ref_type Dir, ScanResults &Results)
 Update information concearning a single directory. More...
 
directory_ref_type ReferenceDirectory (const std::string &Name) const
 Locate a directory in the collection. More...
 
void RemoveDirectory (const std::string &Name)
 Remove a directory from the collection. More...
 
void RemoveDirectoryRecursively (const std::string &Name)
 Remove a directory from the collection. More...
 
template<typename StreamT >
StreamT & Read (StreamT &Stream)
 
void Scan (directory_ref_type Dir, ScanResults &Results)
 Scan the directory for changes. More...
 
void Scan (const std::string &Root, ScanResults &Results)
 Recursively scan the directory for changes. More...
 
template<typename StreamT >
StreamT & Write (StreamT &Stream)
 
template<class Op >
void Walk (Op Operation, const std::string &Root, bool IncludeOffline=false)
 Walk the tree performing the requested operation. More...
 
template<class Op >
void Walk (const Op Operation, const std::string &Root, bool IncludeOffline=false) const
 Walk the tree performing the requested operation. More...
 
template<class Op >
void WalkDepthFirst (Op Operation, const std::string &Root)
 Walk the tree depth first performing the requested operation. More...
 
template<>
OStreamWrite (OStream &Stream)
 
template<>
IBinaryRead (IBinary &Stream)
 
template<>
OBinaryWrite (OBinary &Stream)
 

Private Types

typedef LDASTools::AL::unordered_map< std::string, directory_ref_typedirectory_container_type
 Collection of directories. More...
 
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::READ, directory_container_typedirectory_container_ro_type
 Thread safe read access of the collection of directories. More...
 
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::WRITE, directory_container_typedirectory_container_rw_type
 Thread safe write access of the collection of directories. More...
 
typedef LDASTools::AL::unordered_map< std::string, directory_ref_typedirectory_container_type
 Collection of directories. More...
 
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::READ, directory_container_typedirectory_container_ro_type
 Thread safe read access of the collection of directories. More...
 
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::WRITE, directory_container_typedirectory_container_rw_type
 Thread safe write access of the collection of directories. More...
 
typedef LDASTools::AL::unordered_map< std::string, directory_ref_typedirectory_container_type
 Collection of directories. More...
 
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::READ, directory_container_typedirectory_container_ro_type
 Thread safe read access of the collection of directories. More...
 
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::WRITE, directory_container_typedirectory_container_rw_type
 Thread safe write access of the collection of directories. More...
 

Private Member Functions

const directory_container_ro_type directory_container_ro () const
 Read access to the collection of directories. More...
 
directory_container_rw_type directory_container_rw ()
 Write access for the collection of directories. More...
 
const directory_container_ro_type directory_container_ro () const
 Read access to the collection of directories. More...
 
directory_container_rw_type directory_container_rw ()
 Write access for the collection of directories. More...
 
const directory_container_ro_type directory_container_ro () const
 Read access to the collection of directories. More...
 
directory_container_rw_type directory_container_rw ()
 Write access for the collection of directories. More...
 

Private Attributes

directory_container_rw_type::baton_type p_directory_container_baton
 Lock for the collection of directories. More...
 
directory_container_type p_directory_container
 Container to hold the collection of directories. More...
 

Member Typedef Documentation

◆ directory_container_ro_type [1/3]

typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::READ, directory_container_type > diskCache::Cache::DirectoryManager::directory_container_ro_type
private

Thread safe read access of the collection of directories.

◆ directory_container_ro_type [2/3]

typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::READ, directory_container_type > diskCache::Cache::DirectoryManager::directory_container_ro_type
private

Thread safe read access of the collection of directories.

◆ directory_container_ro_type [3/3]

typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::READ, directory_container_type > diskCache::Cache::DirectoryManager::directory_container_ro_type
private

Thread safe read access of the collection of directories.

◆ directory_container_rw_type [1/3]

typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::WRITE, directory_container_type > diskCache::Cache::DirectoryManager::directory_container_rw_type
private

Thread safe write access of the collection of directories.

◆ directory_container_rw_type [2/3]

typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::WRITE, directory_container_type > diskCache::Cache::DirectoryManager::directory_container_rw_type
private

Thread safe write access of the collection of directories.

◆ directory_container_rw_type [3/3]

typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::WRITE, directory_container_type > diskCache::Cache::DirectoryManager::directory_container_rw_type
private

Thread safe write access of the collection of directories.

◆ directory_container_type [1/3]

typedef LDASTools::AL::unordered_map< std::string, directory_ref_type > diskCache::Cache::DirectoryManager::directory_container_type
private

Collection of directories.

◆ directory_container_type [2/3]

typedef LDASTools::AL::unordered_map< std::string, directory_ref_type > diskCache::Cache::DirectoryManager::directory_container_type
private

Collection of directories.

◆ directory_container_type [3/3]

typedef LDASTools::AL::unordered_map< std::string, directory_ref_type > diskCache::Cache::DirectoryManager::directory_container_type
private

Collection of directories.

◆ directory_ref_type [1/3]

◆ directory_ref_type [2/3]

◆ directory_ref_type [3/3]

◆ ScanResults [1/3]

◆ ScanResults [2/3]

◆ ScanResults [3/3]

Constructor & Destructor Documentation

◆ DirectoryManager() [1/3]

diskCache::Cache::DirectoryManager::DirectoryManager ( )

◆ DirectoryManager() [2/3]

diskCache::Cache::DirectoryManager::DirectoryManager ( )

◆ DirectoryManager() [3/3]

diskCache::Cache::DirectoryManager::DirectoryManager ( )

Member Function Documentation

◆ AddDirectory() [1/3]

bool diskCache::Cache::DirectoryManager::AddDirectory ( directory_ref_type  Directory)
inline

Add a new directory to the collection.

◆ AddDirectory() [2/3]

bool diskCache::Cache::DirectoryManager::AddDirectory ( directory_ref_type  Directory)

Add a new directory to the collection.

◆ AddDirectory() [3/3]

bool diskCache::Cache::DirectoryManager::AddDirectory ( directory_ref_type  Directory)

Add a new directory to the collection.

◆ CreateDirectory() [1/3]

void diskCache::Cache::DirectoryManager::CreateDirectory ( const std::string &  Name,
const std::string &  Root 
)
inline

Create a new directory to be added to the collection.

Parameters
[in]NameThe name of the directory.
[in]RootThe root of the above directory.

◆ CreateDirectory() [2/3]

void diskCache::Cache::DirectoryManager::CreateDirectory ( const std::string &  Name,
const std::string &  Root 
)

Create a new directory to be added to the collection.

Parameters
[in]NameThe name of the directory.
[in]RootThe root of the above directory.

◆ CreateDirectory() [3/3]

void diskCache::Cache::DirectoryManager::CreateDirectory ( const std::string &  Name,
const std::string &  Root 
)

Create a new directory to be added to the collection.

Parameters
[in]NameThe name of the directory.
[in]RootThe root of the above directory.

◆ directory_container_ro() [1/3]

const DirectoryManager::directory_container_ro_type diskCache::Cache::DirectoryManager::directory_container_ro ( ) const
inlineprivate

Read access to the collection of directories.

◆ directory_container_ro() [2/3]

const directory_container_ro_type diskCache::Cache::DirectoryManager::directory_container_ro ( ) const
private

Read access to the collection of directories.

◆ directory_container_ro() [3/3]

const directory_container_ro_type diskCache::Cache::DirectoryManager::directory_container_ro ( ) const
private

Read access to the collection of directories.

◆ directory_container_rw() [1/3]

DirectoryManager::directory_container_rw_type diskCache::Cache::DirectoryManager::directory_container_rw ( )
inlineprivate

Write access for the collection of directories.

◆ directory_container_rw() [2/3]

directory_container_rw_type diskCache::Cache::DirectoryManager::directory_container_rw ( )
private

Write access for the collection of directories.

◆ directory_container_rw() [3/3]

directory_container_rw_type diskCache::Cache::DirectoryManager::directory_container_rw ( )
private

Write access for the collection of directories.

◆ Find() [1/3]

void diskCache::Cache::DirectoryManager::Find ( const std::string &  Root,
QueryAnswer Answer 
) const

Locate files.

◆ Find() [2/3]

void diskCache::Cache::DirectoryManager::Find ( const std::string &  Root,
QueryAnswer Answer 
) const

Locate files.

◆ Find() [3/3]

void diskCache::Cache::DirectoryManager::Find ( const std::string &  Root,
QueryAnswer Answer 
) const

Locate files.

◆ OnUpdate() [1/3]

void diskCache::Cache::DirectoryManager::OnUpdate ( directory_ref_type  Dir,
ScanResults Results 
)

Update information concearning a single directory.

Parameters
[in]DirThe updated directory information.
[out]ResultsStorage for logging the results.

◆ OnUpdate() [2/3]

void diskCache::Cache::DirectoryManager::OnUpdate ( directory_ref_type  Dir,
ScanResults Results 
)

Update information concearning a single directory.

Parameters
[in]DirThe updated directory information.
[out]ResultsStorage for logging the results.

◆ OnUpdate() [3/3]

void diskCache::Cache::DirectoryManager::OnUpdate ( directory_ref_type  Dir,
ScanResults Results 
)

Update information concearning a single directory.

Parameters
[in]DirThe updated directory information.
[out]ResultsStorage for logging the results.

◆ Read() [1/4]

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

◆ Read() [2/4]

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

◆ Read() [3/4]

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

◆ Read() [4/4]

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

◆ ReferenceDirectory() [1/3]

DirectoryManager::directory_ref_type diskCache::Cache::DirectoryManager::ReferenceDirectory ( const std::string &  Name) const
inline

Locate a directory in the collection.

◆ ReferenceDirectory() [2/3]

directory_ref_type diskCache::Cache::DirectoryManager::ReferenceDirectory ( const std::string &  Name) const

Locate a directory in the collection.

◆ ReferenceDirectory() [3/3]

directory_ref_type diskCache::Cache::DirectoryManager::ReferenceDirectory ( const std::string &  Name) const

Locate a directory in the collection.

◆ RemoveDirectory() [1/3]

void diskCache::Cache::DirectoryManager::RemoveDirectory ( const std::string &  Name)
inline

Remove a directory from the collection.

◆ RemoveDirectory() [2/3]

void diskCache::Cache::DirectoryManager::RemoveDirectory ( const std::string &  Name)

Remove a directory from the collection.

◆ RemoveDirectory() [3/3]

void diskCache::Cache::DirectoryManager::RemoveDirectory ( const std::string &  Name)

Remove a directory from the collection.

◆ RemoveDirectoryRecursively() [1/3]

void diskCache::Cache::DirectoryManager::RemoveDirectoryRecursively ( const std::string &  Name)

Remove a directory from the collection.

◆ RemoveDirectoryRecursively() [2/3]

void diskCache::Cache::DirectoryManager::RemoveDirectoryRecursively ( const std::string &  Name)

Remove a directory from the collection.

◆ RemoveDirectoryRecursively() [3/3]

void diskCache::Cache::DirectoryManager::RemoveDirectoryRecursively ( const std::string &  Name)

Remove a directory from the collection.

◆ Scan() [1/6]

void diskCache::Cache::DirectoryManager::Scan ( const std::string &  Root,
ScanResults Results 
)

Recursively scan the directory for changes.

◆ Scan() [2/6]

void diskCache::Cache::DirectoryManager::Scan ( const std::string &  Root,
ScanResults Results 
)

Recursively scan the directory for changes.

◆ Scan() [3/6]

void diskCache::Cache::DirectoryManager::Scan ( const std::string &  Root,
ScanResults Results 
)

Recursively scan the directory for changes.

◆ Scan() [4/6]

void diskCache::Cache::DirectoryManager::Scan ( directory_ref_type  Dir,
ScanResults Results 
)

Scan the directory for changes.

◆ Scan() [5/6]

void diskCache::Cache::DirectoryManager::Scan ( directory_ref_type  Dir,
ScanResults Results 
)

Scan the directory for changes.

◆ Scan() [6/6]

void diskCache::Cache::DirectoryManager::Scan ( directory_ref_type  Dir,
ScanResults Results 
)

Scan the directory for changes.

◆ Walk() [1/6]

template<class Op >
void diskCache::Cache::DirectoryManager::Walk ( const Op  Operation,
const std::string &  Root,
bool  IncludeOffline = false 
) const

Walk the tree performing the requested operation.

Parameters
[in]OperationA function which is to be performed on each node found while walking the tree.
[in]RootDirectory from where to start.

◆ Walk() [2/6]

template<class Op >
void diskCache::Cache::DirectoryManager::Walk ( const Op  Operation,
const std::string &  Root,
bool  IncludeOffline = false 
) const

Walk the tree performing the requested operation.

Parameters
[in]OperationA function which is to be performed on each node found while walking the tree.
[in]RootDirectory from where to start.

◆ Walk() [3/6]

template<class Op >
void diskCache::Cache::DirectoryManager::Walk ( const Op  Operation,
const std::string &  Root,
bool  IncludeOffline = false 
) const

Walk the tree performing the requested operation.

Parameters
[in]OperationA function which is to be performed on each node found while walking the tree.
[in]RootDirectory from where to start.

◆ Walk() [4/6]

template<class Op >
void diskCache::Cache::DirectoryManager::Walk ( Op  Operation,
const std::string &  Root,
bool  IncludeOffline = false 
)

Walk the tree performing the requested operation.

Parameters
[in]OperationA function which is to be performed on each node found while walking the tree.
[in]RootDirectory from where to start.

◆ Walk() [5/6]

template<class Op >
void diskCache::Cache::DirectoryManager::Walk ( Op  Operation,
const std::string &  Root,
bool  IncludeOffline = false 
)

Walk the tree performing the requested operation.

Parameters
[in]OperationA function which is to be performed on each node found while walking the tree.
[in]RootDirectory from where to start.

◆ Walk() [6/6]

template<class Op >
void diskCache::Cache::DirectoryManager::Walk ( Op  Operation,
const std::string &  Root,
bool  IncludeOffline = false 
)

Walk the tree performing the requested operation.

Parameters
[in]OperationA function which is to be performed on each node found while walking the tree.
[in]RootDirectory from where to start.

◆ WalkDepthFirst() [1/3]

template<class Op >
void diskCache::Cache::DirectoryManager::WalkDepthFirst ( Op  Operation,
const std::string &  Root 
)

Walk the tree depth first performing the requested operation.

Parameters
[in]OperationA function which is to be performed on each node found while walking the tree.
[in]RootDirectory from where to start.

◆ WalkDepthFirst() [2/3]

template<class Op >
void diskCache::Cache::DirectoryManager::WalkDepthFirst ( Op  Operation,
const std::string &  Root 
)

Walk the tree depth first performing the requested operation.

Parameters
[in]OperationA function which is to be performed on each node found while walking the tree.
[in]RootDirectory from where to start.

◆ WalkDepthFirst() [3/3]

template<class Op >
void diskCache::Cache::DirectoryManager::WalkDepthFirst ( Op  Operation,
const std::string &  Root 
)

Walk the tree depth first performing the requested operation.

Parameters
[in]OperationA function which is to be performed on each node found while walking the tree.
[in]RootDirectory from where to start.

◆ Write() [1/5]

template<>
OBinary& diskCache::Cache::DirectoryManager::Write ( OBinary Stream)

◆ Write() [2/5]

template<>
OStream& diskCache::Cache::DirectoryManager::Write ( OStream Stream)

◆ Write() [3/5]

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

◆ Write() [4/5]

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

◆ Write() [5/5]

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

Member Data Documentation

◆ p_directory_container

directory_container_type diskCache::Cache::DirectoryManager::p_directory_container
mutableprivate

Container to hold the collection of directories.

◆ p_directory_container_baton

directory_container_rw_type::baton_type diskCache::Cache::DirectoryManager::p_directory_container_baton
mutableprivate

Lock for the collection of directories.


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