bes  Updated for version 3.20.5
BESContainerStorageVolatile.h
1 
2 // BESContainerStorageVolatile.h
3 
4 // This file is part of bes, A C++ back-end server implementation framework
5 // for the OPeNDAP Data Access Protocol.
6 
7 // Copyright (c) 2004-2009 University Corporation for Atmospheric Research
8 // Author: 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 // (c) COPYRIGHT University Corporation for Atmospheric Research 2004-2005
28 // Please read the full copyright statement in the file COPYRIGHT_UCAR.
29 //
30 // Authors:
31 // pwest Patrick West <pwest@ucar.edu>
32 // jgarcia Jose Garcia <jgarcia@ucar.edu>
33 
34 #ifndef BESContainerStorageVolatile_h_
35 #define BESContainerStorageVolatile_h_ 1
36 
37 #include <map>
38 #include <list>
39 #include <string>
40 #include <ostream>
41 
42 #if 0
43 using std::map;
44 using std::string;
45 #endif
46 
47 #include "BESContainerStorage.h"
48 
63 private:
64  std::map<std::string, BESContainer *> _container_list;
65 
66 protected:
67  std::string _root_dir;
68  bool _follow_sym_links;
69 
70  virtual void add_container(BESContainer *c);
71 public:
72  BESContainerStorageVolatile(const std::string &n);
73  virtual ~BESContainerStorageVolatile();
74 
75  typedef std::map<std::string, BESContainer *>::const_iterator Container_citer;
76  typedef std::map<std::string, BESContainer *>::iterator Container_iter;
77 
78  virtual BESContainer * look_for(const std::string &sym_name);
79  virtual void add_container(const std::string &sym_name, const std::string &real_name, const std::string &type);
80  virtual bool del_container(const std::string &s_name);
81  virtual bool del_containers();
82 
83  virtual bool isData(const std::string &inQuestion, std::list<std::string> &provides);
84 
85  virtual void show_containers(BESInfo &info);
86 
87  virtual void dump(std::ostream &strm) const;
88 };
89 
90 #endif // BESContainerStorageVolatile_h_
BESContainerStorageVolatile::isData
virtual bool isData(const std::string &inQuestion, std::list< std::string > &provides)
determine if the given container is data and what servies are available for it
Definition: BESContainerStorageVolatile.cc:244
BESContainerStorage
provides persistent storage for data storage information represented by a container.
Definition: BESContainerStorage.h:72
BESContainerStorageVolatile::dump
virtual void dump(std::ostream &strm) const
dumps information about this object
Definition: BESContainerStorageVolatile.cc:297
BESContainerStorageVolatile::add_container
virtual void add_container(BESContainer *c)
add the passed container to the list of containers in volatile storage
Definition: BESContainerStorageVolatile.cc:177
BESInfo
informational response object
Definition: BESInfo.h:68
BESContainerStorageVolatile::look_for
virtual BESContainer * look_for(const std::string &sym_name)
looks for the specified container using the symbolic name passed
Definition: BESContainerStorageVolatile.cc:93
BESContainerStorageVolatile::del_containers
virtual bool del_containers()
removes all container
Definition: BESContainerStorageVolatile.cc:224
BESContainerStorageVolatile
implementation of BESContainerStorage that stores containers in memory for the duration of this proce...
Definition: BESContainerStorageVolatile.h:62
BESContainerStorageVolatile::BESContainerStorageVolatile
BESContainerStorageVolatile(const std::string &n)
create an instance of this persistent store with the given name.
Definition: BESContainerStorageVolatile.cc:57
BESContainerStorageVolatile::show_containers
virtual void show_containers(BESInfo &info)
show information for each container in this persistent store
Definition: BESContainerStorageVolatile.cc:270
BESContainer
A container is something that holds data. E.G., a netcdf file or a database entry.
Definition: BESContainer.h:68
BESContainerStorageVolatile::del_container
virtual bool del_container(const std::string &s_name)
removes a container with the given symbolic name from the list and deletes it.
Definition: BESContainerStorageVolatile.cc:202