bes  Updated for version 3.19.1
BESUncompressManager3.h
1 // BESUncompressManager3.h
2 
3 // This file is part of bes, A C++ back-end server implementation framework
4 // for the OPeNDAP Data Access Protocol.
5 
6 // Copyright (c) 2012 OPeNDAP, Inc
7 // Author: James Gallagher <jgallagher@opendap.org>
8 // Based in code by Patrick West <pwest@ucar.edu> and Jose Garcia <jgarcia@ucar.edu>
9 //
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Lesser General Public
12 // License as published by the Free Software Foundation; either
13 // version 2.1 of the License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 //
24 // You can contact University Corporation for Atmospheric Research at
25 // 3080 Center Green Drive, Boulder, CO 80301
26 
27 #ifndef I_BESUncompressManager3_h
28 #define I_BESUncompressManager3_h 1
29 
30 #include <map>
31 #include <string>
32 
33 using std::map;
34 using std::string;
35 
36 #include "BESObj.h"
37 
39 
40 typedef void (*p_bes_uncompress)(const string &src, int fd);
41 
59 private:
60  static BESUncompressManager3 * _instance;
61  map<string, p_bes_uncompress> _uncompress_list;
62  typedef map<string, p_bes_uncompress>::const_iterator UCIter;
63 
65 
66 public:
67  virtual ~BESUncompressManager3(void)
68  {
69  }
70 
71  virtual bool add_method(const string &name, p_bes_uncompress method);
72  virtual p_bes_uncompress find_method(const string &name);
73 
74  virtual bool uncompress(const string &src, string &target, BESFileLockingCache *cache);
75 
76  virtual void dump(ostream &strm) const ;
77 
78  static BESUncompressManager3 * TheManager();
79 };
80 
81 #endif // I_BESUncompressManager3_h
virtual void dump(ostream &strm) const
dumps information about this object
virtual bool uncompress(const string &src, string &target, BESFileLockingCache *cache)
If the file 'src' should be uncompressed, do so and return a new file name on the value-result param ...
Implementation of a caching mechanism for compressed data.
Base object for bes objects.
Definition: BESObj.h:52
List of all registered decompression methods.
virtual p_bes_uncompress find_method(const string &name)
returns the uncompression method specified
virtual bool add_method(const string &name, p_bes_uncompress method)
create_and_lock a uncompress method to the list