ldas-tools-diskcacheAPI
2.7.2
|
#include <DirectoryManager.hh>
Classes | |
class | child_functor |
Public Types | |
typedef Directory::ScanResults | ScanResults |
typedef boost::shared_ptr< Directory > | directory_ref_type |
typedef Directory::ScanResults | ScanResults |
typedef boost::shared_ptr< Directory > | directory_ref_type |
typedef Directory::ScanResults | ScanResults |
typedef boost::shared_ptr< Directory > | directory_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<> | |
OStream & | Write (OStream &Stream) |
template<> | |
IBinary & | Read (IBinary &Stream) |
template<> | |
OBinary & | Write (OBinary &Stream) |
Private Types | |
typedef LDASTools::AL::unordered_map< std::string, directory_ref_type > | directory_container_type |
Collection of directories. More... | |
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::READ, directory_container_type > | directory_container_ro_type |
Thread safe read access of the collection of directories. More... | |
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::WRITE, directory_container_type > | directory_container_rw_type |
Thread safe write access of the collection of directories. More... | |
typedef LDASTools::AL::unordered_map< std::string, directory_ref_type > | directory_container_type |
Collection of directories. More... | |
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::READ, directory_container_type > | directory_container_ro_type |
Thread safe read access of the collection of directories. More... | |
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::WRITE, directory_container_type > | directory_container_rw_type |
Thread safe write access of the collection of directories. More... | |
typedef LDASTools::AL::unordered_map< std::string, directory_ref_type > | directory_container_type |
Collection of directories. More... | |
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::READ, directory_container_type > | directory_container_ro_type |
Thread safe read access of the collection of directories. More... | |
typedef LDASTools::AL::ReadWriteLockVariable< LDASTools::AL::ReadWriteLock::WRITE, directory_container_type > | directory_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... | |
|
private |
Thread safe read access of the collection of directories.
|
private |
Thread safe read access of the collection of directories.
|
private |
Thread safe read access of the collection of directories.
|
private |
Thread safe write access of the collection of directories.
|
private |
Thread safe write access of the collection of directories.
|
private |
Thread safe write access of the collection of directories.
|
private |
Collection of directories.
|
private |
Collection of directories.
|
private |
Collection of directories.
typedef boost::shared_ptr< Directory > diskCache::Cache::DirectoryManager::directory_ref_type |
typedef boost::shared_ptr< Directory > diskCache::Cache::DirectoryManager::directory_ref_type |
typedef boost::shared_ptr< Directory > diskCache::Cache::DirectoryManager::directory_ref_type |
diskCache::Cache::DirectoryManager::DirectoryManager | ( | ) |
diskCache::Cache::DirectoryManager::DirectoryManager | ( | ) |
diskCache::Cache::DirectoryManager::DirectoryManager | ( | ) |
|
inline |
Add a new directory to the collection.
bool diskCache::Cache::DirectoryManager::AddDirectory | ( | directory_ref_type | Directory | ) |
Add a new directory to the collection.
bool diskCache::Cache::DirectoryManager::AddDirectory | ( | directory_ref_type | Directory | ) |
Add a new directory to the collection.
|
inline |
Create a new directory to be added to the collection.
[in] | Name | The name of the directory. |
[in] | Root | The root of the above directory. |
void diskCache::Cache::DirectoryManager::CreateDirectory | ( | const std::string & | Name, |
const std::string & | Root | ||
) |
Create a new directory to be added to the collection.
[in] | Name | The name of the directory. |
[in] | Root | The root of the above directory. |
void diskCache::Cache::DirectoryManager::CreateDirectory | ( | const std::string & | Name, |
const std::string & | Root | ||
) |
Create a new directory to be added to the collection.
[in] | Name | The name of the directory. |
[in] | Root | The root of the above directory. |
|
inlineprivate |
Read access to the collection of directories.
|
private |
Read access to the collection of directories.
|
private |
Read access to the collection of directories.
|
inlineprivate |
Write access for the collection of directories.
|
private |
Write access for the collection of directories.
|
private |
Write access for the collection of directories.
void diskCache::Cache::DirectoryManager::Find | ( | const std::string & | Root, |
QueryAnswer & | Answer | ||
) | const |
Locate files.
void diskCache::Cache::DirectoryManager::Find | ( | const std::string & | Root, |
QueryAnswer & | Answer | ||
) | const |
Locate files.
void diskCache::Cache::DirectoryManager::Find | ( | const std::string & | Root, |
QueryAnswer & | Answer | ||
) | const |
Locate files.
void diskCache::Cache::DirectoryManager::OnUpdate | ( | directory_ref_type | Dir, |
ScanResults & | Results | ||
) |
Update information concearning a single directory.
[in] | Dir | The updated directory information. |
[out] | Results | Storage for logging the results. |
void diskCache::Cache::DirectoryManager::OnUpdate | ( | directory_ref_type | Dir, |
ScanResults & | Results | ||
) |
Update information concearning a single directory.
[in] | Dir | The updated directory information. |
[out] | Results | Storage for logging the results. |
void diskCache::Cache::DirectoryManager::OnUpdate | ( | directory_ref_type | Dir, |
ScanResults & | Results | ||
) |
Update information concearning a single directory.
[in] | Dir | The updated directory information. |
[out] | Results | Storage for logging the results. |
StreamT& diskCache::Cache::DirectoryManager::Read | ( | StreamT & | Stream | ) |
StreamT& diskCache::Cache::DirectoryManager::Read | ( | StreamT & | Stream | ) |
StreamT& diskCache::Cache::DirectoryManager::Read | ( | StreamT & | Stream | ) |
|
inline |
Locate a directory in the collection.
directory_ref_type diskCache::Cache::DirectoryManager::ReferenceDirectory | ( | const std::string & | Name | ) | const |
Locate a directory in the collection.
directory_ref_type diskCache::Cache::DirectoryManager::ReferenceDirectory | ( | const std::string & | Name | ) | const |
Locate a directory in the collection.
|
inline |
Remove a directory from the collection.
void diskCache::Cache::DirectoryManager::RemoveDirectory | ( | const std::string & | Name | ) |
Remove a directory from the collection.
void diskCache::Cache::DirectoryManager::RemoveDirectory | ( | const std::string & | Name | ) |
Remove a directory from the collection.
void diskCache::Cache::DirectoryManager::RemoveDirectoryRecursively | ( | const std::string & | Name | ) |
Remove a directory from the collection.
void diskCache::Cache::DirectoryManager::RemoveDirectoryRecursively | ( | const std::string & | Name | ) |
Remove a directory from the collection.
void diskCache::Cache::DirectoryManager::RemoveDirectoryRecursively | ( | const std::string & | Name | ) |
Remove a directory from the collection.
void diskCache::Cache::DirectoryManager::Scan | ( | const std::string & | Root, |
ScanResults & | Results | ||
) |
Recursively scan the directory for changes.
void diskCache::Cache::DirectoryManager::Scan | ( | const std::string & | Root, |
ScanResults & | Results | ||
) |
Recursively scan the directory for changes.
void diskCache::Cache::DirectoryManager::Scan | ( | const std::string & | Root, |
ScanResults & | Results | ||
) |
Recursively scan the directory for changes.
void diskCache::Cache::DirectoryManager::Scan | ( | directory_ref_type | Dir, |
ScanResults & | Results | ||
) |
Scan the directory for changes.
void diskCache::Cache::DirectoryManager::Scan | ( | directory_ref_type | Dir, |
ScanResults & | Results | ||
) |
Scan the directory for changes.
void diskCache::Cache::DirectoryManager::Scan | ( | directory_ref_type | Dir, |
ScanResults & | Results | ||
) |
Scan the directory for changes.
void diskCache::Cache::DirectoryManager::Walk | ( | const Op | Operation, |
const std::string & | Root, | ||
bool | IncludeOffline = false |
||
) | const |
Walk the tree performing the requested operation.
[in] | Operation | A function which is to be performed on each node found while walking the tree. |
[in] | Root | Directory from where to start. |
void diskCache::Cache::DirectoryManager::Walk | ( | const Op | Operation, |
const std::string & | Root, | ||
bool | IncludeOffline = false |
||
) | const |
Walk the tree performing the requested operation.
[in] | Operation | A function which is to be performed on each node found while walking the tree. |
[in] | Root | Directory from where to start. |
void diskCache::Cache::DirectoryManager::Walk | ( | const Op | Operation, |
const std::string & | Root, | ||
bool | IncludeOffline = false |
||
) | const |
Walk the tree performing the requested operation.
[in] | Operation | A function which is to be performed on each node found while walking the tree. |
[in] | Root | Directory from where to start. |
void diskCache::Cache::DirectoryManager::Walk | ( | Op | Operation, |
const std::string & | Root, | ||
bool | IncludeOffline = false |
||
) |
Walk the tree performing the requested operation.
[in] | Operation | A function which is to be performed on each node found while walking the tree. |
[in] | Root | Directory from where to start. |
void diskCache::Cache::DirectoryManager::Walk | ( | Op | Operation, |
const std::string & | Root, | ||
bool | IncludeOffline = false |
||
) |
Walk the tree performing the requested operation.
[in] | Operation | A function which is to be performed on each node found while walking the tree. |
[in] | Root | Directory from where to start. |
void diskCache::Cache::DirectoryManager::Walk | ( | Op | Operation, |
const std::string & | Root, | ||
bool | IncludeOffline = false |
||
) |
Walk the tree performing the requested operation.
[in] | Operation | A function which is to be performed on each node found while walking the tree. |
[in] | Root | Directory from where to start. |
void diskCache::Cache::DirectoryManager::WalkDepthFirst | ( | Op | Operation, |
const std::string & | Root | ||
) |
Walk the tree depth first performing the requested operation.
[in] | Operation | A function which is to be performed on each node found while walking the tree. |
[in] | Root | Directory from where to start. |
void diskCache::Cache::DirectoryManager::WalkDepthFirst | ( | Op | Operation, |
const std::string & | Root | ||
) |
Walk the tree depth first performing the requested operation.
[in] | Operation | A function which is to be performed on each node found while walking the tree. |
[in] | Root | Directory from where to start. |
void diskCache::Cache::DirectoryManager::WalkDepthFirst | ( | Op | Operation, |
const std::string & | Root | ||
) |
Walk the tree depth first performing the requested operation.
[in] | Operation | A function which is to be performed on each node found while walking the tree. |
[in] | Root | Directory from where to start. |
StreamT& diskCache::Cache::DirectoryManager::Write | ( | StreamT & | Stream | ) |
StreamT& diskCache::Cache::DirectoryManager::Write | ( | StreamT & | Stream | ) |
StreamT& diskCache::Cache::DirectoryManager::Write | ( | StreamT & | Stream | ) |
|
mutableprivate |
Container to hold the collection of directories.
|
mutableprivate |
Lock for the collection of directories.