bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
BESCatalog.h
1// BESCatalog.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) 2004-2009 University Corporation for Atmospheric Research
7// Author: Patrick West <pwest@ucar.edu> and Jose Garcia <jgarcia@ucar.edu>
8//
9// This library is free software; you can redistribute it and/or
10// modify it under the terms of the GNU Lesser General Public
11// License as published by the Free Software Foundation; either
12// version 2.1 of the License, or (at your option) any later version.
13//
14// This library is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17// Lesser General Public License for more details.
18//
19// You should have received a copy of the GNU Lesser General Public
20// License along with this library; if not, write to the Free Software
21// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22//
23// You can contact University Corporation for Atmospheric Research at
24// 3080 Center Green Drive, Boulder, CO 80301
25
26// (c) COPYRIGHT University Corporation for Atmospheric Research 2004-2005
27// Please read the full copyright statement in the file COPYRIGHT_UCAR.
28//
29// Authors:
30// pwest Patrick West <pwest@ucar.edu>
31// jgarcia Jose Garcia <jgarcia@ucar.edu>
32
33#ifndef I_BESCatalog_h
34#define I_BESCatalog_h 1
35
36#include <string>
37
38#include "BESObj.h"
39
40class BESCatalogEntry;
41class BESCatalogUtils;
42
43namespace bes {
44 class CatalogNode;
45 // TODO class CatalogUtils;
46}
47
51class BESCatalog: public BESObj {
52private:
53 std::string d_catalog_name;
54 unsigned int d_reference;
55
56 BESCatalogUtils *d_utils;
57
58public:
59 BESCatalog() = delete;
60 explicit BESCatalog(const std::string &catalog_name);
61
62 virtual ~BESCatalog();
63#if 0
64 {
65 // TODO delete d_utils when it's no longer a singleton.
66 // Or leave that class as the weird singleton it is and treat this
67 // as a weak pointer. jhrg 7/21/18
68 }
69#endif
70
80 virtual void reference_catalog()
81 {
82 d_reference++;
83 }
84
91 virtual unsigned int dereference_catalog()
92 {
93 if (!d_reference)
94 return d_reference;
95 return --d_reference;
96 }
97
102 virtual std::string get_catalog_name() const
103 {
104 return d_catalog_name;
105 }
106
112 virtual BESCatalogUtils *get_catalog_utils() const { return d_utils; }
113
117 virtual BESCatalogEntry *show_catalog(const std::string &container, BESCatalogEntry *entry) = 0;
118
127 virtual std::string get_root() const = 0;
128
129 // Based on other code (show_catalogs()), use BESCatalogUtils::exclude() on
130 // a directory, but BESCatalogUtils::include() on a file).
131 virtual bes::CatalogNode *get_node(const std::string &path) const = 0;
132
133 virtual void get_site_map(const std::string &prefix, const std::string &node_suffix, const std::string &leaf_suffix, std::ostream &out,
134 const std::string &path = "/") const = 0;
135
136 virtual void dump(std::ostream &strm) const = 0;
137};
138
139#endif // I_BESCatalog_h
virtual BESCatalogEntry * show_catalog(const std::string &container, BESCatalogEntry *entry)=0
virtual std::string get_root() const =0
virtual BESCatalogUtils * get_catalog_utils() const
Get a pointer to the utilities, customized for this catalog.
Definition BESCatalog.h:112
virtual unsigned int dereference_catalog()
Decrement the count of clients that reference this catalog.
Definition BESCatalog.h:91
virtual void dump(std::ostream &strm) const =0
dump the contents of this object to the specified ostream
virtual std::string get_catalog_name() const
Get the name for this catalog.
Definition BESCatalog.h:102
virtual void reference_catalog()
Increase the count of clients that reference this catalog.
Definition BESCatalog.h:80
top level BES object to house generic methods
Definition BESObj.h:54