1#ifndef __vtkCacheManager_h
2#define __vtkCacheManager_h
6class vtkCallbackCommand;
17#ifndef vtkObjectPointer
18#define vtkObjectPointer(xx) (reinterpret_cast <vtkObject **>( (xx) ))
28 void PrintSelf(ostream& os, vtkIndent indent)
override;
30 vtkGetMacro (InsufficientFreeBufferNotificationFlag,
int );
31 vtkSetMacro (InsufficientFreeBufferNotificationFlag,
int );
120 vtkGetMacro ( RemoteCacheLimit,
int );
121 vtkSetMacro ( RemoteCacheLimit,
int );
122 vtkSetMacro ( CurrentCacheSize,
float );
123 vtkGetMacro ( RemoteCacheFreeBufferSize,
int );
124 vtkSetMacro ( RemoteCacheFreeBufferSize,
int );
125 vtkGetMacro ( EnableForceRedownload,
int );
126 vtkSetMacro ( EnableForceRedownload,
int );
131 this->MRMLScene = scene;
154 std::map<std::string, std::string>
uriMap;
158 int InsufficientFreeBufferNotificationFlag;
159 int RemoteCacheLimit;
160 float CurrentCacheSize;
161 int RemoteCacheFreeBufferSize;
162 int EnableForceRedownload;
166 std::string RemoteCacheDirectory;
167 int GetCachedFileList(
const char *dirname);
168 std::vector< std::string > GetAllCachedFiles();
173 std::vector< std::string > CachedFileList;
void DeleteFromCachedFileList(const char *target)
Removes a target from the list of locally cached files and directories.
void UpdateCacheInformation()
Called when a file is loaded or removed from the cache.
virtual int IsLocalReference(const char *uri)
Looks for a 'file://' in the URI and if present, returns true.
~vtkCacheManager() override
vtkCallbackCommand * CallbackCommand
Holder for callback.
const char * GetFilenameFromURI(const char *uri)
virtual int CachedFileExists(const char *filename)
const char * EncodeURI(const char *uri)
float GetFreeCacheSpaceRemaining()
void FreeCacheBufferCheck()
void DeleteFromCache(const char *target)
Remove a target directory or file from the cache.
void operator=(const vtkCacheManager &)
void MarkNodesBeforeDeletingDataFromCache(const char *)
const char * GetFileFromURIMap(const char *uri)
float ComputeCacheSize(const char *dirname, unsigned long size)
void MapFileToURI(const char *uri, const char *fname)
const char * GetRemoteCacheDirectory()
Returns the name of the directory to use for local file caching.
virtual void SetRemoteCacheDirectory(const char *dir)
std::vector< std::string > GetCachedFiles() const
static vtkCacheManager * New()
The Usual vtk class functions.
const char * AddCachePathToFilename(const char *filename)
@ CacheLimitExceededEvent
@ InsufficientFreeBufferEvent
virtual int LocalFileExists(const char *uri)
std::map< std::string, std::string > uriMap
vtkCacheManager(const vtkCacheManager &)
void PrintSelf(ostream &os, vtkIndent indent) override
float GetCurrentCacheSize()
void SetMRMLScene(vtkMRMLScene *scene)
const char * FindCachedFile(const char *target, const char *dirname)
void MarkNode(std::string)
virtual int IsRemoteReference(const char *uri)
A set of MRML Nodes that supports serialization and undo/redo.