Logo ROOT   6.19/01
Reference Guide
Compression.h
Go to the documentation of this file.
1 // @(#)root/zip:$Id$
2 // Author: David Dagenhart May 2011
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2011, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_Compression
13 #define ROOT_Compression
14 
15 #include "Rtypes.h"
16 
17 namespace ROOT {
18 
19 /// The global settings depend on a global variable named R__ZipMode which can be
20 /// modified by a global function named R__SetZipMode. Both are defined in Bits.h.
21 ///
22 /// - The default is to use the global setting and the default of the global
23 /// setting is to use the ZLIB compression algorithm.
24 /// - The LZMA algorithm (from the XZ package) is also available. The LZMA
25 /// compression usually results in greater compression factors, but takes
26 /// more CPU time and memory when compressing. LZMA memory usage is particularly
27 /// high for compression levels 8 and 9.
28 /// - Finally, the LZ4 package results in worse compression ratios
29 /// than ZLIB but achieves much faster decompression rates.
30 ///
31 /// The current algorithms support level 1 to 9. The higher the level the greater
32 /// the compression and more CPU time and memory resources used during compression.
33 /// Level 0 means no compression.
34 ///
35 /// Recommendation for the compression algorithm's levels:
36 /// - ZLIB is recommended to be used with compression level 1 [101]
37 /// - LZMA is recommended to be used with compression level 7-8 (higher is better,
38 /// since in the case of LZMA we don't care about compression/decompression speed)
39 /// [207 - 208]
40 /// - LZ4 is recommended to be used with compression level 4 [404]
41 
43  struct EDefaults { /// Note: this is only temporarily a struct and will become a enum class hence the name convention
44  /// used.
45  enum EValues {
46  /// Use the global compression setting for this process; may be affected by rootrc.
48  /// Use the compile-time default setting
50  /// Use the default analysis setting; fast reading but poor compression ratio
51  kUseAnalysis = 404,
52  /// Use the recommended general-purpose setting; moderate read / write speed and compression ratio
54  /// Use the setting that results in the smallest files; very slow read and write
56  };
57  };
58  struct ELevel { /// Note: this is only temporarily a struct and will become a enum class hence the name convention
59  /// used.
60  enum EValues {
61  /// Some objects use this value to denote that the compression algorithm
62  /// should be inherited from the parent object
63  kInherit = -1,
64  // Compression level reserved for "uncompressed state"
66  // Compression level reserved when we are not sure what to use (1 is for the fastest compression)
67  kUseMin = 1,
72  };
73  };
74  struct EAlgorithm { /// Note: this is only temporarily a struct and will become a enum class hence the name
75  /// convention used.
76  enum EValues {
77  /// Some objects use this value to denote that the compression algorithm
78  /// should be inherited from the parent object (e.g., TBranch should get the algorithm from the TTree)
79  kInherit = -1,
80  /// Use the global compression algorithm
82  /// Use ZLIB compression
84  /// Use LZMA compression
86  /// Use the old compression algorithm
88  /// Use LZ4 compression
90  /// Undefined compression algorithm (must be kept the last of the list in case a new algorithm is added).
92  };
93  };
94 };
95 
97  /// Deprecated name, do *not* use:
99  /// Deprecated name, do *not* use:
101  /// Deprecated name, do *not* use:
103  /// Deprecated name, do *not* use:
105  /// Deprecated name, do *not* use:
107  /// Deprecated name, do *not* use:
109  /// Deprecated name, do *not* use:
111 };
112 
113 int CompressionSettings(RCompressionSetting::EAlgorithm algorithm, int compressionLevel);
114 /// Deprecated name, do *not* use:
115 int CompressionSettings(ROOT::ECompressionAlgorithm algorithm, int compressionLevel);
116 } // namespace ROOT
117 
118 #endif
EValues
Note: this is only temporarily a struct and will become a enum class hence the name convention used...
Definition: Compression.h:60
The global settings depend on a global variable named R__ZipMode which can be modified by a global fu...
Definition: Compression.h:42
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
Use the setting that results in the smallest files; very slow read and write.
Definition: Compression.h:55
ECompressionAlgorithm
Definition: Compression.h:96
Use the global compression algorithm.
Definition: Compression.h:81
EValues
Note: this is only temporarily a struct and will become a enum class hence the name convention used...
Definition: Compression.h:45
Deprecated name, do not use:
Definition: Compression.h:100
Deprecated name, do not use:
Definition: Compression.h:98
Use the compile-time default setting.
Definition: Compression.h:49
EValues
Note: this is only temporarily a struct and will become a enum class hence the name.
Definition: Compression.h:76
Deprecated name, do not use:
Definition: Compression.h:108
int CompressionSettings(RCompressionSetting::EAlgorithm algorithm, int compressionLevel)
Some objects use this value to denote that the compression algorithm should be inherited from the par...
Definition: Compression.h:79
Deprecated name, do not use:
Definition: Compression.h:106
Use the default analysis setting; fast reading but poor compression ratio.
Definition: Compression.h:51
Deprecated name, do not use:
Definition: Compression.h:104
Use the global compression setting for this process; may be affected by rootrc.
Definition: Compression.h:47
Some objects use this value to denote that the compression algorithm should be inherited from the par...
Definition: Compression.h:63
Use the recommended general-purpose setting; moderate read / write speed and compression ratio...
Definition: Compression.h:53
Deprecated name, do not use:
Definition: Compression.h:110
Undefined compression algorithm (must be kept the last of the list in case a new algorithm is added)...
Definition: Compression.h:91
Deprecated name, do not use:
Definition: Compression.h:102