Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
vtkCacheManager Class Reference

#include <Libs/MRML/Core/vtkCacheManager.h>

Inheritance diagram for vtkCacheManager:
Inheritance graph
Collaboration diagram for vtkCacheManager:
Collaboration graph

Public Types

enum  { NoCachedFile =0, OldCachedFile, CachedFile }
 in case we need these. More...
enum  {
  InsufficientFreeBufferEvent = 21000, CacheLimitExceededEvent, CacheDeleteEvent, CacheDirtyEvent,
 in case we need these. More...
typedef vtkObject Superclass

Public Member Functions

const char * AddCachePathToFilename (const char *filename)
virtual int CachedFileExists (const char *filename)
void CacheSizeCheck ()
int ClearCache ()
int ClearCacheCheck ()
float ComputeCacheSize (const char *dirname, unsigned long size)
void DeleteFromCache (const char *target)
 Remove a target directory or file from the cache. More...
void DeleteFromCachedFileList (const char *target)
Removes a target from the list of locally cached files and directories More...
const char * EncodeURI (const char *uri)
const char * FindCachedFile (const char *target, const char *dirname)
void FreeCacheBufferCheck ()
std::vector< std::string > GetCachedFiles () const
virtual const char * GetClassName ()
float GetCurrentCacheSize ()
virtual int GetEnableForceRedownload ()
const char * GetFileFromURIMap (const char *uri)
const char * GetFilenameFromURI (const char *uri)
float GetFreeCacheSpaceRemaining ()
virtual int GetInsufficientFreeBufferNotificationFlag ()
const char * GetRemoteCacheDirectory ()
Returns the name of the directory to use for local file caching More...
virtual int GetRemoteCacheFreeBufferSize ()
virtual int GetRemoteCacheLimit ()
virtual int IsA (const char *type)
virtual int IsLocalReference (const char *uri)
Looks for a 'file://' in the uri and if present, returns true. More...
virtual int IsRemoteReference (const char *uri)
virtual int LocalFileExists (const char *uri)
void MapFileToURI (const char *uri, const char *fname)
void MarkNode (std::string)
void MarkNodesBeforeDeletingDataFromCache (const char *)
void PrintSelf (ostream &os, vtkIndent indent) override
virtual void SetCurrentCacheSize (float)
virtual void SetEnableForceRedownload (int)
virtual void SetInsufficientFreeBufferNotificationFlag (int)
void SetMRMLScene (vtkMRMLScene *scene)
virtual void SetRemoteCacheDirectory (const char *dir)
virtual void SetRemoteCacheFreeBufferSize (int)
virtual void SetRemoteCacheLimit (int)
void UpdateCacheInformation ()
Called when a file is loaded or removed from the cache. More...

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkCacheManagerNew ()
 The Usual vtk class functions. More...
static vtkCacheManagerSafeDownCast (vtkObject *o)

Public Attributes

std::map< std::string, std::string > uriMap

Protected Member Functions

void operator= (const vtkCacheManager &)
 vtkCacheManager ()
 vtkCacheManager (const vtkCacheManager &)
 ~vtkCacheManager () override

Protected Attributes

vtkCallbackCommand * CallbackCommand
Holder for callback More...

Detailed Description

Definition at line 21 of file vtkCacheManager.h.

Member Typedef Documentation

◆ Superclass

typedef vtkObject vtkCacheManager::Superclass

Definition at line 27 of file vtkCacheManager.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

in case we need these.


Definition at line 137 of file vtkCacheManager.h.

◆ anonymous enum

anonymous enum

in case we need these.


Definition at line 145 of file vtkCacheManager.h.

Constructor & Destructor Documentation

◆ vtkCacheManager() [1/2]

vtkCacheManager::vtkCacheManager ( )

◆ ~vtkCacheManager()

vtkCacheManager::~vtkCacheManager ( )

◆ vtkCacheManager() [2/2]

vtkCacheManager::vtkCacheManager ( const vtkCacheManager )

Member Function Documentation

◆ AddCachePathToFilename()

const char* vtkCacheManager::AddCachePathToFilename ( const char *  filename)

◆ CachedFileExists()

virtual int vtkCacheManager::CachedFileExists ( const char *  filename)

Checks to see if the The uri provided exists on disk. If not, it appends the Remote Cache Directory path and checks again, in case no path was provided. If neither exists, returns 0. If one exists, returns 1.

◆ CacheSizeCheck()

void vtkCacheManager::CacheSizeCheck ( )

◆ ClearCache()

int vtkCacheManager::ClearCache ( )

Removes all files from the cachedir and removes all filenames from CachedFileList

◆ ClearCacheCheck()

int vtkCacheManager::ClearCacheCheck ( )

This method is called after ClearCache(), to see if that method actually cleaned the cache. If not, an event (CacheDirtyEvent) is invoked.

◆ ComputeCacheSize()

float vtkCacheManager::ComputeCacheSize ( const char *  dirname,
unsigned long  size 

◆ DeleteFromCache()

void vtkCacheManager::DeleteFromCache ( const char *  target)

Remove a target directory or file from the cache.

◆ DeleteFromCachedFileList()

void vtkCacheManager::DeleteFromCachedFileList ( const char *  target)

Removes a target from the list of locally cached files and directories

◆ EncodeURI()

const char* vtkCacheManager::EncodeURI ( const char *  uri)

◆ FindCachedFile()

const char* vtkCacheManager::FindCachedFile ( const char *  target,
const char *  dirname 

Takes a filename and a dirname (usually called with the RemoteCachedDirectory) and returns the full path of the filename if it exists under the dirname.

◆ FreeCacheBufferCheck()

void vtkCacheManager::FreeCacheBufferCheck ( )

◆ GetCachedFiles()

std::vector< std::string > vtkCacheManager::GetCachedFiles ( ) const

◆ GetClassName()

virtual const char* vtkCacheManager::GetClassName ( )

◆ GetCurrentCacheSize()

float vtkCacheManager::GetCurrentCacheSize ( )

◆ GetEnableForceRedownload()

virtual int vtkCacheManager::GetEnableForceRedownload ( )

◆ GetFileFromURIMap()

const char* vtkCacheManager::GetFileFromURIMap ( const char *  uri)

◆ GetFilenameFromURI()

const char* vtkCacheManager::GetFilenameFromURI ( const char *  uri)

Extracts the filename from the URI and prepends the Remote Cache Directory path to it. Returns the full path. NOTE: this method looks at a filename's extension and if appended version numbers have been added, it attempts to strip them out of the extension and add them to the filenamebase. So filename.nrrd_010 would become filename.nrrd. This will cause problems for any file type with an '_' in its extension.

◆ GetFreeCacheSpaceRemaining()

float vtkCacheManager::GetFreeCacheSpaceRemaining ( )

◆ GetInsufficientFreeBufferNotificationFlag()

virtual int vtkCacheManager::GetInsufficientFreeBufferNotificationFlag ( )

◆ GetRemoteCacheDirectory()

const char* vtkCacheManager::GetRemoteCacheDirectory ( )

Returns the name of the directory to use for local file caching

◆ GetRemoteCacheFreeBufferSize()

virtual int vtkCacheManager::GetRemoteCacheFreeBufferSize ( )

◆ GetRemoteCacheLimit()

virtual int vtkCacheManager::GetRemoteCacheLimit ( )

◆ IsA()

virtual int vtkCacheManager::IsA ( const char *  type)

◆ IsLocalReference()

virtual int vtkCacheManager::IsLocalReference ( const char *  uri)

Looks for a 'file://' in the uri and if present, returns true.

◆ IsRemoteReference()

virtual int vtkCacheManager::IsRemoteReference ( const char *  uri)

Checks to see if a uri appears to point to remote location and returns true if so. Looks for a '://' and if present, checks to see if the prefix is 'file'. If not 'file' but the thing:/// pattern exists, then returns true.

◆ IsTypeOf()

static int vtkCacheManager::IsTypeOf ( const char *  type)

◆ LocalFileExists()

virtual int vtkCacheManager::LocalFileExists ( const char *  uri)

Checks to see if a uri is a file on disk and returns true if so. Strips off a file:/// prefix if present, and expects an absolute path.

◆ MapFileToURI()

void vtkCacheManager::MapFileToURI ( const char *  uri,
const char *  fname 

◆ MarkNode()

void vtkCacheManager::MarkNode ( std::string  )

◆ MarkNodesBeforeDeletingDataFromCache()

void vtkCacheManager::MarkNodesBeforeDeletingDataFromCache ( const char *  )

Before a file or directory is deleted, Marks any nodes that hold the uri as a reference as modified since read.

◆ New()

static vtkCacheManager* vtkCacheManager::New ( )

The Usual vtk class functions.

◆ operator=()

void vtkCacheManager::operator= ( const vtkCacheManager )

◆ PrintSelf()

void vtkCacheManager::PrintSelf ( ostream &  os,
vtkIndent  indent 

◆ SafeDownCast()

static vtkCacheManager* vtkCacheManager::SafeDownCast ( vtkObject *  o)

◆ SetCurrentCacheSize()

virtual void vtkCacheManager::SetCurrentCacheSize ( float  )

◆ SetEnableForceRedownload()

virtual void vtkCacheManager::SetEnableForceRedownload ( int  )

◆ SetInsufficientFreeBufferNotificationFlag()

virtual void vtkCacheManager::SetInsufficientFreeBufferNotificationFlag ( int  )

◆ SetMRMLScene()

void vtkCacheManager::SetMRMLScene ( vtkMRMLScene scene)

Definition at line 129 of file vtkCacheManager.h.

◆ SetRemoteCacheDirectory()

virtual void vtkCacheManager::SetRemoteCacheDirectory ( const char *  dir)

Sets the name of the directory to use for local file caching Does some checking to make sure this is a valid directory on the local system. Makes sure there's NO "/" at the end of the string, or kwsys/SystemTools will not see as a valid dir.

◆ SetRemoteCacheFreeBufferSize()

virtual void vtkCacheManager::SetRemoteCacheFreeBufferSize ( int  )

◆ SetRemoteCacheLimit()

virtual void vtkCacheManager::SetRemoteCacheLimit ( int  )

◆ UpdateCacheInformation()

void vtkCacheManager::UpdateCacheInformation ( )

Called when a file is loaded or removed from the cache.

Member Data Documentation

◆ CallbackCommand

vtkCallbackCommand* vtkCacheManager::CallbackCommand

Holder for callback

Definition at line 183 of file vtkCacheManager.h.

◆ uriMap

std::map<std::string, std::string> vtkCacheManager::uriMap

Definition at line 154 of file vtkCacheManager.h.

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