client/compressor.h

Go to the documentation of this file.
00001 
00002 /* Copyright (c) 2009, Cedric Stalder <cedric.stalder@gmail.com> 
00003  *               2009, Stefan Eilemann <eile@equalizergraphics.com>
00004  *
00005  * This library is free software; you can redistribute it and/or modify it under
00006  * the terms of the GNU Lesser General Public License version 2.1 as published
00007  * by the Free Software Foundation.
00008  *  
00009  * This library is distributed in the hope that it will be useful, but WITHOUT
00010  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00011  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00012  * details.
00013  * 
00014  * You should have received a copy of the GNU Lesser General Public License
00015  * along with this library; if not, write to the Free Software Foundation, Inc.,
00016  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00017  */
00018 
00019 #ifndef EQ_COMPRESSOR_H
00020 #define EQ_COMPRESSOR_H
00021 
00022 #include <eq/plugins/compressor.h> // member
00023 #include <eq/client/types.h>
00024 #include <eq/base/dso.h>           // member
00025 
00031 namespace eq
00032 {
00036     class Compressor
00037     {
00038     public:
00039         typedef size_t ( *GetNumCompressors_t ) ();
00040         typedef void   ( *GetInfo_t ) ( const size_t, EqCompressorInfo* const );
00041         typedef void*  ( *NewCompressor_t ) ( const unsigned );
00042         typedef void   ( *DeleteCompressor_t ) ( void* const );
00043         typedef void*  ( *NewDecompressor_t ) ( const unsigned );
00044         typedef void   ( *DeleteDecompressor_t ) ( void* const );
00045         typedef void   ( *Compress_t ) ( void* const, const unsigned, 
00046                                          void* const, const uint64_t*,
00047                                          const uint64_t );
00048         typedef size_t ( *GetNumResults_t ) ( void* const, const unsigned );
00049         typedef void   ( *GetResult_t ) ( void* const, const unsigned, 
00050                                           const unsigned, void** const, 
00051                                           uint64_t* const );
00052         typedef void   ( *Decompress_t ) ( void* const, const unsigned,
00053                                            const void* const*,
00054                                            const uint64_t* const,
00055                                            const unsigned, void* const, 
00056                                            uint64_t* const, 
00057                                            const uint64_t );
00058 
00059         Compressor(){}
00060 
00062         bool init( const std::string& libraryName );
00063       
00065         void exit();
00066 
00068         NewCompressor_t newCompressor;
00069         
00071         NewDecompressor_t    newDecompressor;
00072        
00074         DeleteCompressor_t   deleteCompressor;
00075         
00077         DeleteDecompressor_t deleteDecompressor;
00078       
00080         Compress_t       compress;
00081 
00083         Decompress_t     decompress;
00084       
00086         GetNumResults_t  getNumResults;
00087 
00089         GetNumCompressors_t  getNumCompressors;
00090 
00092         GetResult_t   getResult;
00093       
00095         bool implementsType( const uint32_t name );
00096 
00098         const CompressorInfoVector& getInfos() const { return _infos; }
00099 
00100     private:
00101         CompressorInfoVector _infos;
00102         base::DSO _dso;   
00103     };
00104 
00105     EQ_EXPORT std::ostream& operator << ( std::ostream&, 
00106                                           const EqCompressorInfo& );
00107 }
00108 
00109 #endif //EQ_COMPRESSOR_H
Generated on Mon Aug 10 18:58:32 2009 for Equalizer 0.9 by  doxygen 1.5.8