1 #ifndef __vtkCacheManager_h 2 #define __vtkCacheManager_h 6 class vtkCallbackCommand;
10 #include <vtkObject.h> 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 );
38 virtual void SetRemoteCacheDirectory (
const char *dir );
42 const char *GetRemoteCacheDirectory ();
46 void UpdateCacheInformation ( );
49 void DeleteFromCachedFileList (
const char * target );
53 void DeleteFromCache(
const char *target );
62 int ClearCacheCheck ( );
68 void MarkNodesBeforeDeletingDataFromCache (
const char *);
75 virtual int IsRemoteReference (
const char *uri );
78 virtual int IsLocalReference (
const char *uri );
84 virtual int LocalFileExists (
const char *uri );
90 const char* FindCachedFile (
const char * target,
const char *dirname );
97 virtual int CachedFileExists (
const char *filename );
107 const char* GetFilenameFromURI (
const char *uri );
108 const char* AddCachePathToFilename (
const char *filename );
109 const char* EncodeURI (
const char *uri );
111 void CacheSizeCheck();
112 void FreeCacheBufferCheck();
113 float ComputeCacheSize(
const char *dirname,
unsigned long size );
114 float GetCurrentCacheSize();
115 float GetFreeCacheSpaceRemaining();
117 std::vector< std::string > GetCachedFiles()
const;
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;
133 void MapFileToURI (
const char *uri,
const char *fname );
135 void MarkNode ( std::string );
147 InsufficientFreeBufferEvent = 21000,
154 std::map<std::string, std::string>
uriMap;
155 const char *GetFileFromURIMap (
const char *uri );
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 SetMRMLScene(vtkMRMLScene *scene)
std::map< std::string, std::string > uriMap
A set of MRML Nodes that supports serialization and undo/redo.
vtkCallbackCommand * CallbackCommand
Holder for callback