4 * @file Compression.pidl
7 #ifndef _COMPRESSION_PIDL_
8 #define _COMPRESSION_PIDL_
10 #include "tao/OctetSeq.pidl"
14 typeprefix Compression "omg.org";
17 * Exception thrown when an error occurs during a compress or decompress
20 exception CompressionException
27 * Exception thrown if a CompressorFactory with the same CompressorId is
28 * already registered with the CompressionManager.
30 exception FactoryAlreadyRegistered
35 * Exception thrown if a CompressorId is not known.
37 exception UnknownCompressorId
44 typedef unsigned short CompressorId;
45 const CompressorId COMPRESSORID_NONE = 0;
46 const CompressorId COMPRESSORID_GZIP = 1;
47 const CompressorId COMPRESSORID_PKZIP = 2;
48 const CompressorId COMPRESSORID_BZIP2 = 3;
49 const CompressorId COMPRESSORID_ZLIB = 4;
50 const CompressorId COMPRESSORID_LZMA = 5;
51 const CompressorId COMPRESSORID_LZO = 6;
52 const CompressorId COMPRESSORID_RZIP = 7;
53 const CompressorId COMPRESSORID_7X = 8;
54 const CompressorId COMPRESSORID_XAR = 9;
55 const CompressorId COMPRESSORID_RLE = 10;
59 * CompressionLevel type.
61 typedef unsigned short CompressionLevel;
64 * CompressionRatio type.
66 typedef float CompressionRatio;
69 * CompressionLevelId struc.
71 struct CompressorIdLevel {
72 CompressorId compressor_id;
73 CompressionLevel compression_level;
75 typedef sequence <CompressorIdLevel> CompressorIdLevelList;
77 typedef CORBA::OctetSeq Buffer;
79 local interface CompressorFactory;
82 * Compressor - abstraction of a compressor and decompressor.
84 local interface Compressor
87 * Operation that compresses data contained in the source Buffer into
88 * the target Buffer. If an error occurs during the compression, it
89 * throws CompressionException
91 void compress(in Buffer source, inout Buffer target) raises (CompressionException);
93 * Operation that decompresses data contained in the source Buffer into
94 * the target Buffer. If an error occurs during the decompression, it
95 * throws CompressionException
97 void decompress(in Buffer source, inout Buffer target) raises(CompressionException);
99 * The CompressorFactory associated with this Compressor.
101 readonly attribute CompressorFactory compressor_factory;
103 * The (implementation and algorithm specific) compression level
104 * associated with this Compressor.
106 readonly attribute CompressionLevel compression_level;
108 * The total number of compressed bytes read and written by Compressors
109 * that were created by this CompressorFactory
110 * (i.e. the "target" side of Compressor::compress and
111 * the "source" side of Compressor::decompress operations).
113 readonly attribute unsigned long long compressed_bytes;
115 * The total number of uncompressed bytes read and written by
116 * Compressors that were created by this CompressorFactory
117 * (i.e. the "source" side of Compressor::compress and
118 * the "target" side of Compressor::decompress operations).
120 readonly attribute unsigned long long uncompressed_bytes;
122 * The average compression achieved by Compressors that were created by
123 * this CompressorFactory, usually a value between 0 and >=1.
124 * (i.e. compressed_bytes divided by uncompressed_bytes).
126 readonly attribute CompressionRatio compression_ratio;
129 local interface CompressorFactory
132 * The CompressorId associated with this CompressorFactory
134 readonly attribute CompressorId compressor_id;
136 * Create a Compressor instance with the given compression level.
138 Compressor get_compressor(in CompressionLevel compression_level);
141 typedef sequence<CompressorFactory> CompressorFactorySeq;
144 * Per-ORB interface to register and unregister CompressorFactories.
145 * Initial reference: "CompressionManager"
147 local interface CompressionManager
150 * Register a new CompressorFactory
152 void register_factory(in CompressorFactory compressor_factory) raises(FactoryAlreadyRegistered);
154 * Unregister a CompressorFactory with the given CompressorId from the
157 void unregister_factory(in CompressorId compressor_id) raises (UnknownCompressorId);
159 * Retrieve a CompressorFactory with the given CompressorId from the
162 CompressorFactory get_factory(in CompressorId compressor_id) raises(UnknownCompressorId);
164 * Create a Compressor with the given compression_level from the
165 * CompressorFactory with the given CompressorId
167 Compressor get_compressor(in CompressorId compressor_id, in CompressionLevel compression_level) raises(UnknownCompressorId);
169 * Create a Compressor with the given CompressorIdLevel
171 //Compressor get_compressor(in CompressorIdLevel compressor_id_level) raises(UnknownCompressorId);
173 * List all registered CompressorFactories
175 CompressorFactorySeq get_factories();