OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
ncml_module::ScopeStack Class Reference

#include <ScopeStack.h>

Collaboration diagram for ncml_module::ScopeStack:
Collaboration graph

Classes

struct  Entry
 Entry used in Scope class to maintain where we are within the DDS AttrTable hierarchy. More...
 

Public Types

enum  ScopeType {
  GLOBAL =0, VARIABLE_ATOMIC, VARIABLE_CONSTRUCTOR, ATTRIBUTE_ATOMIC,
  ATTRIBUTE_CONTAINER, NUM_SCOPE_TYPES
}
 The current scope is either global attribute table, within a variable's attribute table, or within an attribute container. More...
 

Public Member Functions

void clear ()
 
bool empty () const
 If there are no entries pushed. More...
 
string getFullyQualifiedName () const
 
string getScopeString () const
 Return a fully qualifed name for the scope, such as "" for global scope or "MetaData.Info.Name" for an attribute container, etc. More...
 
string getTypedScopeString () const
 Similar to getScopeString(), but appends the type of the scope to the name in the form "Name<TYPE>" for better debugging. More...
 
bool isCurrentScope (ScopeType type) const
 Is the current scope of the given type? Note that isCurrentScope(GLOBAL) == empty(). More...
 
void pop ()
 
void push (const string &name, ScopeType type)
 
 ScopeStack ()
 
int size () const
 How many things are on the stack. More...
 
const Entrytop () const
 
const string & topName () const
 
ScopeType topType () const
 
virtual ~ScopeStack ()
 

Detailed Description

Definition at line 56 of file ScopeStack.h.

Member Enumeration Documentation

The current scope is either global attribute table, within a variable's attribute table, or within an attribute container.

Additionally, we can be "within" an atomic attribute if the <attribute>values here</attribute> form is used.

Enumerator
GLOBAL 
VARIABLE_ATOMIC 
VARIABLE_CONSTRUCTOR 
ATTRIBUTE_ATOMIC 
ATTRIBUTE_CONTAINER 
NUM_SCOPE_TYPES 

Definition at line 63 of file ScopeStack.h.

Constructor & Destructor Documentation

ncml_module::ScopeStack::ScopeStack ( )

Definition at line 61 of file ScopeStack.cc.

ncml_module::ScopeStack::~ScopeStack ( )
virtual

Definition at line 66 of file ScopeStack.cc.

Member Function Documentation

void ncml_module::ScopeStack::clear ( )

Definition at line 73 of file ScopeStack.cc.

bool ncml_module::ScopeStack::empty ( ) const

If there are no entries pushed.

If empty(), we assume isCurrentScope(GLOBAL) is true.

Definition at line 91 of file ScopeStack.cc.

string ncml_module::ScopeStack::getFullyQualifiedName ( ) const
inline

Definition at line 117 of file ScopeStack.h.

string ncml_module::ScopeStack::getScopeString ( ) const

Return a fully qualifed name for the scope, such as "" for global scope or "MetaData.Info.Name" for an attribute container, etc.

Definition at line 103 of file ScopeStack.cc.

Referenced by ncml_module::NCMLParser::checkDataIsValidForCanonicalTypeOrThrow().

string ncml_module::ScopeStack::getTypedScopeString ( ) const

Similar to getScopeString(), but appends the type of the scope to the name in the form "Name<TYPE>" for better debugging.

For example, "MetaData<Attribute_Container>.Info<Attribute_Container>.Name<Attribute_Atomic>" gives more information about the context.

Returns

Definition at line 119 of file ScopeStack.cc.

bool ncml_module::ScopeStack::isCurrentScope ( ScopeType  type) const

Is the current scope of the given type? Note that isCurrentScope(GLOBAL) == empty().

In other words, an empty stack implicitly means global scope.

Definition at line 135 of file ScopeStack.cc.

References GLOBAL.

void ncml_module::ScopeStack::pop ( )

Definition at line 79 of file ScopeStack.cc.

void ncml_module::ScopeStack::push ( const string &  name,
ScopeType  type 
)
inline

Definition at line 98 of file ScopeStack.h.

References push().

Referenced by push().

Here is the call graph for this function:

int ncml_module::ScopeStack::size ( void  ) const

How many things are on the stack.

This is useful for knowing if an atomic attribute is being added at the top level of the DAS/DDS (which DAP2 does not allow, but DAP4 will).

Returns
The number of items on the stack.

Definition at line 97 of file ScopeStack.cc.

const ScopeStack::Entry & ncml_module::ScopeStack::top ( ) const

Definition at line 85 of file ScopeStack.cc.

const string& ncml_module::ScopeStack::topName ( ) const
inline

Definition at line 103 of file ScopeStack.h.

ScopeType ncml_module::ScopeStack::topType ( ) const
inline

Definition at line 102 of file ScopeStack.h.


The documentation for this class was generated from the following files: