HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_CacheOptions.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  */
7 
8 #ifndef __SIM_CacheOptions_h__
9 #define __SIM_CacheOptions_h__
10 
11 #include "SIM_API.h"
12 #include "SIM_Utils.h"
13 #include <UT/UT_StringHolder.h>
14 
15 /// This class stores all the caching options used by the SIM_Cache.
17 {
18 public:
19  /// Constructor sets up default caching options.
21 
22  /// Returns the name of the initial state file.
23  const UT_StringHolder &getInitialState() const;
24  /// Sets the initial state file name.
25  void setInitialState(const char *filename);
26  /// Returns whether or not caching is enabled.
27  bool getIsCacheEnabled() const;
28  /// Sets the enable state of the cache.
29  void setIsCacheEnabled(bool enabled);
30  /// Returns whether or not cache entries can be sent to disk.
31  bool getAllowSaveToDisk() const;
32  /// Sets whether or not cache entries can be saved to disk.
33  void setAllowSaveToDisk(bool allow);
34  /// Returns whether or not cache should save substep data.
35  bool getAllowSaveSubsteps() const;
36  /// Sets whether or not cache should save substep data.
37  void setAllowSaveSubsteps(bool allow);
38  /// Returns the maximum memory footprint for all cached data.
39  int64 getMaxCacheMemSize() const;
40  /// Sets the maximum allowed memory footprint of the cache (in bytes).
41  void setMaxCacheMemSize(int64 maxsize);
42 
43  /// Determines if we compress our .sim files. Compression can
44  /// be very slow.
45  void setCompressSims(UT_CompressionType type) { myCompressionType = type; }
46  UT_CompressionType getCompressSims() const { return myCompressionType; }
47 
48  /// Determines if we are overriding the cache files with an
49  /// explicit list of cache files. These will always be saved
50  /// when added and only deleted according to history and
51  /// checkpoint spacing
52  /// This is also used when we are a player. When we are a player
53  /// history is set to 0 and the cache files are never deleted.
54  void setExplicitCache(bool useexplicit,
55  const char *explicitfname,
56  int history,
57  int checkpointspacing);
58  bool getUseExplicit() const
59  {
60  return myUseExplicit && myExplicitName.isstring();
61  }
62  const UT_StringHolder &getExplicitFname() const { return myExplicitName; }
63  int getExplicitHistory() const { return myExplicitHistory; }
64  int getCheckpointSpacing() const { return myExplicitCheckpointSpacing; }
65 
66 private:
67  UT_StringHolder myInitialState;
68  int64 myMaxCacheMemSize;
69  bool myIsCacheEnabled;
70  bool myAllowSaveToDisk;
71  bool myAllowSaveSubsteps;
72  bool myUseExplicit;
73  UT_StringHolder myExplicitName;
74  int myExplicitHistory;
75  int myExplicitCheckpointSpacing;
76  UT_CompressionType myCompressionType;
77 };
78 
79 #endif
80 
GT_API const UT_StringHolder filename
int getCheckpointSpacing() const
int getExplicitHistory() const
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glcorearb.h:2539
void setCompressSims(UT_CompressionType type)
long long int64
Definition: SYS_Types.h:116
const UT_StringHolder & getExplicitFname() const
UT_CompressionType
#define SIM_API
Definition: SIM_API.h:12
UT_CompressionType getCompressSims() const
This class stores all the caching options used by the SIM_Cache.
type
Definition: core.h:1059
bool getUseExplicit() const