1#ifndef __vtkCacheManager_h
2#define __vtkCacheManager_h
6class vtkCallbackCommand;
17#ifndef vtkObjectPointer
18# define vtkObjectPointer(xx) (reinterpret_cast<vtkObject**>((xx)))
27 void PrintSelf(ostream& os, vtkIndent indent)
override;
29 vtkGetMacro(InsufficientFreeBufferNotificationFlag,
int);
30 vtkSetMacro(InsufficientFreeBufferNotificationFlag,
int);
119 vtkGetMacro(RemoteCacheLimit,
int);
120 vtkSetMacro(RemoteCacheLimit,
int);
121 vtkSetMacro(CurrentCacheSize,
float);
122 vtkGetMacro(RemoteCacheFreeBufferSize,
int);
123 vtkSetMacro(RemoteCacheFreeBufferSize,
int);
124 vtkGetMacro(EnableForceRedownload,
int);
125 vtkSetMacro(EnableForceRedownload,
int);
150 std::map<std::string, std::string>
uriMap;
154 int InsufficientFreeBufferNotificationFlag;
155 int RemoteCacheLimit;
156 float CurrentCacheSize;
157 int RemoteCacheFreeBufferSize;
158 int EnableForceRedownload;
162 std::string RemoteCacheDirectory;
163 int GetCachedFileList(
const char* dirname);
164 std::vector<std::string> GetAllCachedFiles();
169 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.