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_String.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  /// Destructor for cache options.
23 
24  /// Returns the name of the initial state file.
25  const UT_String &getInitialState() const;
26  /// Sets the initial state file name.
27  void setInitialState(const char *filename);
28  /// Returns whether or not caching is enabled.
29  bool getIsCacheEnabled() const;
30  /// Sets the enable state of the cache.
31  void setIsCacheEnabled(bool enabled);
32  /// Returns whether or not cache entries can be sent to disk.
33  bool getAllowSaveToDisk() const;
34  /// Sets whether or not cache entries can be saved to disk.
35  void setAllowSaveToDisk(bool allow);
36  /// Returns whether or not cache should save substep data.
37  bool getAllowSaveSubsteps() const;
38  /// Sets whether or not cache should save substep data.
39  void setAllowSaveSubsteps(bool allow);
40  /// Returns the maximum memory footprint for all cached data.
41  int64 getMaxCacheMemSize() const;
42  /// Sets the maximum allowed memory footprint of the cache (in bytes).
43  void setMaxCacheMemSize(int64 maxsize);
44 
45  /// Determines if we compress our .sim files. Compression can
46  /// be very slow.
47  void setCompressSims(UT_CompressionType type) { myCompressionType = type; }
48  UT_CompressionType getCompressSims() const { return myCompressionType; }
49 
50  /// Determines if we are overriding the cache files with an
51  /// explicit list of cache files. These will always be saved
52  /// when added and only deleted according to history and
53  /// checkpoint spacing
54  /// This is also used when we are a player. When we are a player
55  /// history is set to 0 and the cache files are never deleted.
56  void setExplicitCache(bool useexplicit,
57  const char *explicitfname,
58  int history,
59  int checkpointspacing);
60  bool getUseExplicit() const
61  {
62  return myUseExplicit && myExplicitName.isstring();
63  }
64  const UT_String &getExplicitFname() const { return myExplicitName; }
65  int getExplicitHistory() const { return myExplicitHistory; }
66  int getCheckpointSpacing() const { return myExplicitCheckpointSpacing; }
67 
68  /// Assignment operator copies options from one instance to another.
69  const SIM_CacheOptions &operator=(const SIM_CacheOptions &src);
70 
71 private:
72  UT_String myInitialState;
73  int64 myMaxCacheMemSize;
74  bool myIsCacheEnabled;
75  bool myAllowSaveToDisk;
76  bool myAllowSaveSubsteps;
77  bool myUseExplicit;
78  UT_String myExplicitName;
79  int myExplicitHistory;
80  int myExplicitCheckpointSpacing;
81  UT_CompressionType myCompressionType;
82 };
83 
84 #endif
85 
GT_API const UT_StringHolder filename
int getCheckpointSpacing() const
int getExplicitHistory() const
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glcorearb.h:2538
long long int64
Definition: SYS_Types.h:107
void setCompressSims(UT_CompressionType type)
UT_CompressionType
#define SIM_API
Definition: SIM_API.h:10
UT_CompressionType getCompressSims() const
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
This class stores all the caching options used by the SIM_Cache.
const UT_String & getExplicitFname() const
GLenum src
Definition: glcorearb.h:1792
bool getUseExplicit() const