ParaView
vtkPVCacheKeeper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkPVCacheKeeper.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
29 #ifndef vtkPVCacheKeeper_h
30 #define vtkPVCacheKeeper_h
31 
32 #include "vtkDataObjectAlgorithm.h"
33 #include "vtkPVClientServerCoreRenderingModule.h" //needed for exports
34 
35 class vtkCacheSizeKeeper;
36 
37 class VTKPVCLIENTSERVERCORERENDERING_EXPORT vtkPVCacheKeeper : public vtkDataObjectAlgorithm
38 {
39 public:
40  static vtkPVCacheKeeper* New();
41  vtkTypeMacro(vtkPVCacheKeeper, vtkDataObjectAlgorithm);
42  void PrintSelf(ostream& os, vtkIndent indent);
43 
48  void RemoveAllCaches();
49 
51 
54  vtkSetMacro(CacheTime, double);
55  vtkGetMacro(CacheTime, double);
57 
62  bool IsCached(double cacheTime);
63  bool IsCached() { return this->IsCached(this->CacheTime); }
64 
66 
69  vtkSetMacro(CachingEnabled, bool);
70  vtkGetMacro(CachingEnabled, bool);
71  vtkBooleanMacro(CachingEnabled, bool);
73 
75 
80  static void ClearCacheStateFlags();
81  static int GetCacheHits();
82  static int GetCacheMisses();
83  static int GetCacheSkips();
85 
86 protected:
89 
91 
95  void SetCacheSizeKeeper(vtkCacheSizeKeeper*);
96  vtkGetObjectMacro(CacheSizeKeeper, vtkCacheSizeKeeper);
98 
99  int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
100  vtkInformationVector* outputVector);
101  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
102  vtkInformationVector* outputVector);
103  virtual vtkExecutive* CreateDefaultExecutive();
104 
109  bool SaveData(vtkDataObject*);
110 
112  double CacheTime;
114 
115 private:
116  vtkPVCacheKeeper(const vtkPVCacheKeeper&) VTK_DELETE_FUNCTION;
117  void operator=(const vtkPVCacheKeeper&) VTK_DELETE_FUNCTION;
118 
119  class vtkCacheMap;
120  vtkCacheMap* Cache;
121 
122  static int CacheHit;
123  static int CacheMiss;
124  static int CacheSkips;
125 };
126 
127 #endif
keeps track of amount of memory consumed by caches in vtkPVUpateSupressor objects.
vtkCacheSizeKeeper * CacheSizeKeeper
manages data cache for flip book animations.