bes  Updated for version 3.20.6
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 #include "BESObj.h"
34 
36 
37 typedef void (*p_bes_uncompress)(const std::string &src, int fd);
38 
56 private:
57  static BESUncompressManager3 * _instance;
58  std::map<std::string, p_bes_uncompress> _uncompress_list;
59  typedef std::map<std::string, p_bes_uncompress>::const_iterator UCIter;
60 
62 
63 public:
64  virtual ~BESUncompressManager3(void)
65  {
66  }
67 
68  virtual bool add_method(const std::string &name, p_bes_uncompress method);
69  virtual p_bes_uncompress find_method(const std::string &name);
70 
71  virtual bool uncompress(const std::string &src, std::string &target, BESFileLockingCache *cache);
72 
73  virtual void dump(std::ostream &strm) const ;
74 
75  static BESUncompressManager3 * TheManager();
76 };
77 
78 #endif // I_BESUncompressManager3_h
BESUncompressManager3::uncompress
virtual bool uncompress(const std::string &src, std::string &target, BESFileLockingCache *cache)
If the file 'src' should be uncompressed, do so and return a new file name on the value-result param ...
Definition: BESUncompressManager3.cc:135
BESUncompressManager3::add_method
virtual bool add_method(const std::string &name, p_bes_uncompress method)
create_and_lock a uncompress method to the list
Definition: BESUncompressManager3.cc:74
BESUncompressManager3::find_method
virtual p_bes_uncompress find_method(const std::string &name)
returns the uncompression method specified
Definition: BESUncompressManager3.cc:93
BESObj
top level BES object to house generic methods
Definition: BESObj.h:49
BESUncompressManager3
List of all registered decompression methods.
Definition: BESUncompressManager3.h:55
BESFileLockingCache
Implementation of a caching mechanism for compressed data.
Definition: BESFileLockingCache.h:85
BESUncompressManager3::dump
virtual void dump(std::ostream &strm) const
dumps information about this object
Definition: BESUncompressManager3.cc:234