bes
Updated for version 3.17.4
BESCatalogEntry.h
1
// BESCatalogEntry.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_BESCatalogEntry_h
34
#define I_BESCatalogEntry_h 1
35
36
#include <string>
37
#include <list>
38
#include <map>
39
#include <sys/types.h>
40
41
using
std::string;
42
using
std::list;
43
using
std::map;
44
45
#include "BESObj.h"
46
47
class
BESCatalogEntry
:
public
BESObj
{
48
private
:
49
string
_name;
50
string
_catalog;
51
string
_size;
52
string
_mod_date;
53
string
_mod_time;
54
list<string> _services;
55
map<string, BESCatalogEntry *> _entry_list;
56
map<string, string> _metadata;
57
58
BESCatalogEntry
()
59
{
60
}
61
62
public
:
63
BESCatalogEntry
(
const
string
&name,
const
string
&catalog);
64
virtual
~
BESCatalogEntry
(
void
);
65
66
virtual
void
add_entry(
BESCatalogEntry
*entry)
67
{
68
if
(entry) {
69
_entry_list[entry->get_name()] = entry;
70
}
71
}
72
73
virtual
string
get_name()
74
{
75
return
_name;
76
}
77
virtual
string
get_catalog()
78
{
79
return
_catalog;
80
}
81
virtual
bool
is_collection()
82
{
83
return
(get_count() > 0);
84
}
85
86
virtual
string
get_size()
87
{
88
return
_size;
89
}
90
virtual
void
set_size(off_t size);
91
92
virtual
string
get_mod_date()
93
{
94
return
_mod_date;
95
}
96
virtual
void
set_mod_date(
const
string
&mod_date)
97
{
98
_mod_date = mod_date;
99
}
100
101
virtual
string
get_mod_time()
102
{
103
return
_mod_time;
104
}
105
virtual
void
set_mod_time(
const
string
&mod_time)
106
{
107
_mod_time = mod_time;
108
}
109
110
virtual
list<string> get_service_list()
111
{
112
return
_services;
113
}
114
virtual
void
set_service_list(list<string> &slist)
115
{
116
_services = slist;
117
}
118
119
virtual
unsigned
int
get_count()
120
{
121
return
_entry_list.size();
122
}
123
124
virtual
map<string, string> get_info()
125
{
126
return
_metadata;
127
}
128
virtual
void
add_info(
const
string
&name,
const
string
&value)
129
{
130
_metadata[name] = value;
131
}
132
133
typedef
map<string, BESCatalogEntry *>::const_iterator catalog_citer;
134
virtual
catalog_citer get_beginning_entry()
135
{
136
return
_entry_list.begin();
137
}
138
virtual
catalog_citer get_ending_entry()
139
{
140
return
_entry_list.end();
141
}
142
143
virtual
void
dump
(ostream &strm)
const
;
144
};
145
146
#endif // I_BESCatalogEntry_h
BESCatalogEntry::dump
virtual void dump(ostream &strm) const
dumps information about this object
Definition:
BESCatalogEntry.cc:73
BESObj
Base object for bes objects.
Definition:
BESObj.h:52
BESCatalogEntry
Definition:
BESCatalogEntry.h:47
dispatch
BESCatalogEntry.h
Generated by
1.8.14