Pression  1.2.0
Compressor, decompressor, uploader and downloader plugins
decompressor.h
1 
2 /* Copyright (c) 2013-2014, Stefan.Eilemann@epfl.ch
3  *
4  * This file is part of Pression <https://github.com/Eyescale/Pression>
5  *
6  * This library is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License version 2.1 as published
8  * by the Free Software Foundation.
9  *
10  * This library is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this library; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef PRESSION_DECOMPRESSOR_H
21 #define PRESSION_DECOMPRESSOR_H
22 
23 #include <pression/api.h>
24 #include <pression/types.h>
25 #include <lunchbox/thread.h> // thread-safety macros
26 
27 namespace pression
28 {
29 namespace detail { class Decompressor; }
30 
37 {
38  typedef detail::Decompressor* const Decompressor::*bool_t;
39 
40 public:
42  PRESSION_API Decompressor();
43 
51  PRESSION_API Decompressor( PluginRegistry& from, const uint32_t name );
52 
54  PRESSION_API virtual ~Decompressor();
55 
57  PRESSION_API bool isGood() const;
58 
63  operator bool_t() const { return isGood() ? &Decompressor::impl_ : 0; }
64 
66  bool operator ! () const { return !isGood(); }
67 
72  PRESSION_API bool uses( const uint32_t name ) const;
73 
75  PRESSION_API const EqCompressorInfo& getInfo() const;
76 
85  PRESSION_API bool setup( PluginRegistry& from, const uint32_t name );
86 
88  PRESSION_API void clear();
89 
101  PRESSION_API void decompress( const void* const* in,
102  const uint64_t* const inSizes,
103  const unsigned numInputs, void* const out,
104  uint64_t outDim[2] );
118  PRESSION_API bool decompress( const CompressorResult& input,
119  void* const out, uint64_t pvpOut[4],
120  const uint64_t flags );
121  PRESSION_API void decompress( const void* const* in,
122  const uint64_t* const inSizes,
123  const unsigned numInputs, void* const out,
124  uint64_t pvpOut[4], const uint64_t flags )
125  LB_DEPRECATED;
126 
127 private:
128  Decompressor( const Decompressor& );
129  Decompressor operator=( const Decompressor& );
130  detail::Decompressor* const impl_;
131  LB_TS_VAR( _thread );
132 };
133 }
134 #endif // PRESSION_DECOMPRESSOR_H
Defines export visibility macros for library Pression.
A C++ class to handle one decompressor plugin instance.
Definition: decompressor.h:36
Information about one compressor.
A structure to hold the results from one compress operation.
A registry for loaded plugins.