Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / TAO / tao / Compression / Base_Compressor.h
blob9a5b1498f7568e610a9b02b3a31e727bd40f8743
1 // -*- C++ -*-
3 // ===================================================================
4 /**
5 * @file Base_Compressor.h
7 * @author Johnny Willemsen <jwillemsen@remedy.nl>
8 */
9 // ===================================================================
11 #ifndef TAO_BASE_COMPRESSOR_H
12 #define TAO_BASE_COMPRESSOR_H
14 #include /**/ "ace/pre.h"
16 #include "tao/Compression/compression_export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/Compression/Compression.h"
23 #include "tao/LocalObject.h"
25 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
27 namespace TAO
29 /**
30 * This class is a helper to implement real compressors
32 class TAO_Compression_Export BaseCompressor :
33 public virtual ::Compression::Compressor,
34 public virtual ::CORBA::LocalObject
36 public:
37 BaseCompressor (::Compression::CompressorFactory_ptr compressor_factory,
38 ::Compression::CompressionLevel compression_level);
40 virtual void compress (const ::Compression::Buffer &source,
41 ::Compression::Buffer &target) = 0;
43 virtual void decompress (const ::Compression::Buffer &source,
44 ::Compression::Buffer &target) = 0;
46 virtual ::Compression::CompressorFactory_ptr compressor_factory ();
48 virtual ::Compression::CompressionLevel compression_level ();
50 virtual ::CORBA::ULongLong compressed_bytes ();
52 virtual ::CORBA::ULongLong uncompressed_bytes ();
54 virtual ::Compression::CompressionRatio compression_ratio ();
56 protected:
57 void update_stats (::CORBA::ULongLong uncompressed_bytes,
58 ::CORBA::ULongLong compressed_bytes);
60 TAO_SYNCH_MUTEX mutex_;
61 ::Compression::CompressionLevel compression_level_;
62 ::Compression::CompressorFactory *compressor_factory_;
63 ::CORBA::ULongLong compressed_bytes_;
64 ::CORBA::ULongLong uncompressed_bytes_;
68 TAO_END_VERSIONED_NAMESPACE_DECL
70 #include /**/ "ace/post.h"
72 #endif /* TAO_BASE_COMPRESSOR_H */