bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
FONcMap Class Reference

A map of a DAP Grid with file out netcdf information included. More...

#include <FONcMap.h>

Inheritance diagram for FONcMap:
Inheritance graph
Collaboration diagram for FONcMap:
Collaboration graph

Public Member Functions

virtual void add_grid (const std::string &name)
 Add the name of the grid as a grid that uses this map.
 
virtual void clear_embedded ()
 clear the embedded names for the FONcArray kept by this instance
 
virtual bool compare (libdap::Array *arr)
 a method to compare two grid maps, or possible grid maps.
 
virtual void decref ()
 decrements the reference count for this map
 
virtual void define (int ncid)
 define the map in the netcdf file by calling define on the FONcArray
 
virtual void dump (std::ostream &strm) const
 dumps information about this object for debugging purposes
 
 FONcMap (FONcArray *a, bool ingrid=false)
 Constructor for FONcMap that takes an array as the map.
 
virtual void incref ()
 
virtual void write (int ncid)
 writes out the vallues of the map to the netcdf file by calling write on the FONcArray
 
virtual ~FONcMap ()
 Destructor that cleans up the map.
 

Detailed Description

A map of a DAP Grid with file out netcdf information included.

This class represents a map of a DAP Grid with additional information needed to write it out to a netcdf file. This map can be shared amongst many grids, so it includes reference counting for reference by the different FONcGrid instances.

Definition at line 52 of file FONcMap.h.

Constructor & Destructor Documentation

◆ FONcMap()

FONcMap::FONcMap ( FONcArray * a,
bool ingrid = false )

Constructor for FONcMap that takes an array as the map.

This constructor takes a FONCArray that could be or is a map for a DAP Grid.

If ingrid is true, then the map was created within the context of a DAP Grid. Otherwise, it's an array that could be a map defined outside of a DAP Grid.

Parameters
aA FONcArray representing the grid map
ingridtrue if the FONcArray was created in the context of a grid, false otherwise

Definition at line 57 of file FONcMap.cc.

◆ ~FONcMap()

FONcMap::~FONcMap ( )
virtual

Destructor that cleans up the map.

If the FONcArray was created within the context of the grid, then the FONcArray is owned by the map and can be deleted. Otherwise, it was created outside the context of a grid and will be cleaned up elsewhere.

Definition at line 69 of file FONcMap.cc.

Member Function Documentation

◆ add_grid()

void FONcMap::add_grid ( const std::string & name)
virtual

Add the name of the grid as a grid that uses this map.

Definition at line 170 of file FONcMap.cc.

◆ clear_embedded()

void FONcMap::clear_embedded ( )
virtual

clear the embedded names for the FONcArray kept by this instance

Definition at line 179 of file FONcMap.cc.

◆ compare()

bool FONcMap::compare ( libdap::Array * tomap)
virtual

a method to compare two grid maps, or possible grid maps.

All arrays are saved as a FONcMap if the array has only one dimension and the name of the array and the name of the dimension are the same. The maps are the same if their names are the same, they have the same number of dimensions (arrays of strings written out have 2 dimensions, one for the max length of the string), the type of the maps are the same, the dimension size is the same, the dimension names are the same, and the values of the maps are the same.

Parameters
tomapcompare the saved map to this provided map
Returns
true if they are the same (shared) or false otherwise

Definition at line 104 of file FONcMap.cc.

◆ decref()

void FONcMap::decref ( )
virtual

decrements the reference count for this map

Since a map can be shared by different grids, reference counting is used to keep track of any object that has a reference to this instance. When the reference count goes to zero, then this instance is deleted.

Definition at line 85 of file FONcMap.cc.

◆ define()

void FONcMap::define ( int ncid)
virtual

define the map in the netcdf file by calling define on the FONcArray

Parameters
ncidThe id of the netcdf file

Definition at line 190 of file FONcMap.cc.

◆ dump()

void FONcMap::dump ( std::ostream & strm) const
virtual

dumps information about this object for debugging purposes

Displays the pointer value of this instance plus instance data, including the FONcArray instance kept by this map.

Parameters
strmC++ i/o stream to dump the information to

Implements BESObj.

Definition at line 217 of file FONcMap.cc.

◆ incref()

virtual void FONcMap::incref ( )
inlinevirtual

Definition at line 64 of file FONcMap.h.

◆ write()

void FONcMap::write ( int ncid)
virtual

writes out the vallues of the map to the netcdf file by calling write on the FONcArray

Parameters
ncidThe id of the netcdf file

Definition at line 204 of file FONcMap.cc.


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