OPeNDAP Hyrax Back End Server (BES)
Updated for version 3.8.3
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
ScopeStack.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) 2009 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
#ifndef __NCML_MODULE__SCOPE_STACK_H__
31
#define __NCML_MODULE__SCOPE_STACK_H__
32
33
#include <string>
34
#include <vector>
35
36
using namespace
std
;
37
38
54
namespace
ncml_module
55
{
56
class
ScopeStack
57
{
58
public
:
// Inner classes
63
enum
ScopeType
{ GLOBAL=0, VARIABLE_ATOMIC,
VARIABLE_CONSTRUCTOR
, ATTRIBUTE_ATOMIC, ATTRIBUTE_CONTAINER, NUM_SCOPE_TYPES};
64
71
struct
Entry
72
{
73
Entry
(
ScopeType
theType,
const
string
& theName);
74
Entry
() : type(GLOBAL) , name(
""
) {}
75
76
string
getTypedName
()
const
77
{
78
return
name + toString(type);
79
}
80
81
static
const
string
&
toString
(
ScopeType
theType)
82
{
83
return
sTypeStrings[theType];
84
}
85
86
ScopeType
type
;
87
string
name
;
88
static
const
string
sTypeStrings[NUM_SCOPE_TYPES];
89
};
90
92
public
:
93
94
ScopeStack
();
95
virtual
~
ScopeStack
();
96
97
void
clear();
98
void
push
(
const
string
& name,
ScopeType
type) {
push
(
Entry
(type, name)); }
99
void
pop();
100
const
Entry& top()
const
;
101
102
ScopeType
topType
()
const
{
return
top().type; }
103
const
string
&
topName
()
const
{
return
top().name; }
104
108
bool
empty()
const
;
109
115
int
size()
const
;
116
117
string
getFullyQualifiedName
()
const
{
return
getScopeString(); }
118
123
string
getScopeString()
const
;
124
132
string
getTypedScopeString()
const
;
133
138
bool
isCurrentScope(ScopeType type)
const
;
139
140
private
:
// Method
141
142
void
push(
const
Entry& entry);
143
145
private
:
146
vector<Entry> _scope;
147
};
148
}
149
150
#endif
/* __NCML_MODULE__SCOPE_STACK_H__ */
ncml_module::ScopeStack::topType
ScopeType topType() const
Definition:
ScopeStack.h:102
ncml_module::ScopeStack
Definition:
ScopeStack.h:56
ncml_module
An abstract superclass for NCMLArray
that handles the non-parameterized functionality and allows u...
Definition:
AggregationElement.cc:65
std
STL namespace.
ncml_module::ScopeStack::ScopeType
ScopeType
The current scope is either global attribute table, within a variable's attribute table...
Definition:
ScopeStack.h:63
ncml_module::ScopeStack::Entry
Entry used in Scope class to maintain where we are within the DDS AttrTable hierarchy.
Definition:
ScopeStack.h:71
ncml_module::ScopeStack::Entry::Entry
Entry()
Definition:
ScopeStack.h:74
ncml_module::ScopeStack::Entry::getTypedName
string getTypedName() const
Definition:
ScopeStack.h:76
ncml_module::ScopeStack::Entry::type
ScopeType type
Definition:
ScopeStack.h:86
ncml_module::ScopeStack::Entry::name
string name
Definition:
ScopeStack.h:87
ncml_module::ScopeStack::Entry::toString
static const string & toString(ScopeType theType)
Definition:
ScopeStack.h:81
ncml_module::ScopeStack::topName
const string & topName() const
Definition:
ScopeStack.h:103
ncml_module::ScopeStack::push
void push(const string &name, ScopeType type)
Definition:
ScopeStack.h:98
ncml_module::ScopeStack::getFullyQualifiedName
string getFullyQualifiedName() const
Definition:
ScopeStack.h:117
ncml_module::ScopeStack::VARIABLE_CONSTRUCTOR
Definition:
ScopeStack.h:63
modules
ncml_module
ScopeStack.h
Generated by
1.8.9.1