Slicer  5.1
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
[legend]
Collaboration diagram for vtkCacheManager:
Collaboration graph
[legend]

Public Types

enum  { NoCachedFile =0, OldCachedFile, CachedFile }
 in case we need these. More...
 
enum  {
  InsufficientFreeBufferEvent = 21000, CacheLimitExceededEvent, CacheDeleteEvent, CacheDirtyEvent,
  CacheClearEvent
}
 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.

Enumerator
NoCachedFile 
OldCachedFile 
CachedFile 

Definition at line 137 of file vtkCacheManager.h.

◆ anonymous enum

anonymous enum

in case we need these.

Enumerator
InsufficientFreeBufferEvent 
CacheLimitExceededEvent 
CacheDeleteEvent 
CacheDirtyEvent 
CacheClearEvent 

Definition at line 145 of file vtkCacheManager.h.

Constructor & Destructor Documentation

◆ vtkCacheManager() [1/2]

vtkCacheManager::vtkCacheManager ( )
protected

◆ ~vtkCacheManager()

vtkCacheManager::~vtkCacheManager ( )
overrideprotected

◆ vtkCacheManager() [2/2]

vtkCacheManager::vtkCacheManager ( const vtkCacheManager )
protected

Member Function Documentation

◆ AddCachePathToFilename()

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

◆ CachedFileExists()

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

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

◆ GetCurrentCacheSize()

float vtkCacheManager::GetCurrentCacheSize ( )

◆ GetEnableForceRedownload()

virtual int vtkCacheManager::GetEnableForceRedownload ( )
virtual

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

◆ GetRemoteCacheDirectory()

const char* vtkCacheManager::GetRemoteCacheDirectory ( )


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

◆ GetRemoteCacheFreeBufferSize()

virtual int vtkCacheManager::GetRemoteCacheFreeBufferSize ( )
virtual

◆ GetRemoteCacheLimit()

virtual int vtkCacheManager::GetRemoteCacheLimit ( )
virtual

◆ IsA()

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

◆ IsLocalReference()

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


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

◆ IsRemoteReference()

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

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

◆ LocalFileExists()

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

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

The Usual vtk class functions.

◆ operator=()

void vtkCacheManager::operator= ( const vtkCacheManager )
protected

◆ PrintSelf()

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

◆ SafeDownCast()

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

◆ SetCurrentCacheSize()

virtual void vtkCacheManager::SetCurrentCacheSize ( float  )
virtual

◆ SetEnableForceRedownload()

virtual void vtkCacheManager::SetEnableForceRedownload ( int  )
virtual

◆ SetInsufficientFreeBufferNotificationFlag()

virtual void vtkCacheManager::SetInsufficientFreeBufferNotificationFlag ( int  )
virtual

◆ SetMRMLScene()

void vtkCacheManager::SetMRMLScene ( vtkMRMLScene scene)
inline

Definition at line 129 of file vtkCacheManager.h.

◆ SetRemoteCacheDirectory()

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

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

◆ SetRemoteCacheLimit()

virtual void vtkCacheManager::SetRemoteCacheLimit ( int  )
virtual

◆ UpdateCacheInformation()

void vtkCacheManager::UpdateCacheInformation ( )


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

Member Data Documentation

◆ CallbackCommand

vtkCallbackCommand* vtkCacheManager::CallbackCommand
protected


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: