OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
JoinExistingDimensionCacheManager.h
Go to the documentation of this file.
1 // This file is part of the "NcML Module" project, a BES module designed
3 // to allow NcML files to be used to be used as a wrapper to add
4 // AIS to existing datasets of any format.
5 //
6 // Copyright (c) 2011 OPeNDAP, Inc.
7 // Author: Michael Johnson <m.johnson@opendap.org>
8 //
9 // For more information, please also see the main website: http://opendap.org/
10 //
11 // This library is free software; you can redistribute it and/or
12 // modify it under the terms of the GNU Lesser General Public
13 // License as published by the Free Software Foundation; either
14 // version 2.1 of the License, or (at your option) any later version.
15 //
16 // This library is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 // Lesser General Public License for more details.
20 //
21 // You should have received a copy of the GNU Lesser General Public
22 // License along with this library; if not, write to the Free Software
23 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 //
25 // Please see the files COPYING and COPYRIGHT for more information on the GLPL.
26 //
27 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
29 
30 #if 0 // THis is in progress, so commented out to avoid compilation bugs.
31 #ifndef __NCML_MODULE__JOIN_EXISTING_DIMENSION_CACHE_MANAGER_H__
32 #define __NCML_MODULE__JOIN_EXISTING_DIMENSION_CACHE_MANAGER_H__
33 
34 #include <memory>
35 #include <string>
36 
37 namespace agg_util
38 {
39  class AggMemberDataset;
40 };
41 
42 namespace ncml_module
43 {
44  class JoinExistingDimensionCacheManager
45  {
46  public:
47 
52  JoinExistingDimensionCacheManager(const std::string& cacheDir);
53  ~JoinExistingDimensionCacheManager();
54 
58  static std::auto_ptr<JoinExistingDimensionCache> makeCacheInstance(const std::string& sourceFile);
59 
60  }; // class JoinExistingDimensionCacheManager
61 
62 
63  class JoinExistingDimensionCache
64  {
65  friend class JoinExistingDimensionCacheManager;
66 
67  private:
68  // only the manager can make them
69  JoinExistingDimensionCache(const std::string sourcePath, const std::string& cacheDir);
70 
71  public:
72  ~JoinExistingDimensionCache();
73 
77  bool doesCacheFileExist() const;
78 
79 
84  bool isCacheFileFresh() const;
85 
86 
88  private: // data rep
89 
90  std::string _sourceFilename; // source to be cached, set in ctor
91  std::string _cacheFilename; // cache file associated with _sourceFilename
92  std::string _tempCacheFilename; // temp name for cache file for writing it before copy
93 
94  // @var Mod time for the source file
95  // @var Mod time for the cache file
96 
97  // Locks?
98 
99  }; // class JoinExistingDimensionCache
100 
101 }
102 
103 #endif /* __NCML_MODULE__JOIN_EXISTING_DIMENSION_CACHE_MANAGER_H__ */
104 #endif // 0
An abstract superclass for NCMLArray that handles the non-parameterized functionality and allows u...
Helper class for temporarily hijacking an existing dhi to load a DDX response for one particular file...