BESContainerStorageFile Class Reference

implementation of BESContainerStorage that represents a way to read container information from a file. More...

#include <BESContainerStorageFile.h>

Inheritance diagram for BESContainerStorageFile:

Inheritance graph
[legend]
Collaboration diagram for BESContainerStorageFile:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BESContainerStorageFile (const string &n)
 pull container information from the specified file
virtual ~BESContainerStorageFile ()
virtual void look_for (BESContainer &d)
 looks for the specified container in the list of containers loaded from the file.
virtual void add_container (const string &s_name, const string &r_name, const string &type)
 adds a container with the provided information
virtual bool del_container (const string &s_name)
 removes a container with the given symbolic name
virtual bool del_containers ()
 removes all container
virtual void show_containers (BESInfo &info)
 show information for each container in this persistent store
virtual void dump (ostream &strm) const
 dumps information about this object
virtual const string & get_name () const
 retrieve the name of this persistent store

Protected Attributes

string _my_name

Classes

struct  _container

Detailed Description

implementation of BESContainerStorage that represents a way to read container information from a file.

This impelementation of BESContainerStorage load container information from a file. The name of the file is determined from the dods initiailization file. The key is:

BES.Container.Persistence.File.<name>

where <name> is the name of this persistent store.

The format of the file is:

<symbolic_name> <real_name> <data type>

where the <symbolic_name> is the symbolic name of the container, the <real_name> represents the physical location of the data, such as a file, and the <data type> is the type of data being represented, such as netcdf, cedar, etc...

One container per line, can not span multiple lines

See also:
BESContainerStorage

BESContainer

BESKeys

Definition at line 70 of file BESContainerStorageFile.h.


Constructor & Destructor Documentation

BESContainerStorageFile::BESContainerStorageFile ( const string &  n  ) 

pull container information from the specified file

Constructs a BESContainerStorageFile from a file specified by a key in the dods initialization file. The key is constructed using the name of this persistent store.

BES.Container.Persistence.File.<name>

where <name> is the name of this persistent store.

The containers are then read into memory. The format of the file is as follows.

<symbolic_name> <real_name> <data type>

where the symbolic name is the symbolic name of the container, the <real_name> represents the physical location of the data, such as a file, and the <data type> is the type of data being represented, such as netcdf, cedar, etc...

One container per line, can not span multiple lines

Parameters:
n name of this persistent store
Exceptions:
BESContainerStorageException if the file can not be opened or if there is an error in reading in the container information.
See also:
BESContainerStorage

BESContainer

BESContainerStorageException

Definition at line 75 of file BESContainerStorageFile.cc.

References BESKeys::get_key(), and TheBESKeys::TheKeys().

Here is the call graph for this function:

BESContainerStorageFile::~BESContainerStorageFile (  )  [virtual]

Definition at line 132 of file BESContainerStorageFile.cc.


Member Function Documentation

void BESContainerStorageFile::look_for ( BESContainer d  )  [virtual]

looks for the specified container in the list of containers loaded from the file.

If a match is made with the symbolic name found in the container then the information is stored in the passed container object and the is_valid flag is set to true. If not found, then is_valid is set to false.

Parameters:
d container to look for and, if found, store the information in.
See also:
BESContainer

Implements BESContainerStorage.

Definition at line 154 of file BESContainerStorageFile.cc.

References BESContainer::get_symbolic_name(), BESContainer::set_container_type(), BESContainer::set_real_name(), and BESContainer::set_valid_flag().

Referenced by pfileT::run().

Here is the call graph for this function:

void BESContainerStorageFile::add_container ( const string &  s_name,
const string &  r_name,
const string &  type 
) [virtual]

adds a container with the provided information

This method adds a container to the persistence store with the specified information. This functionality is not currently supported for file persistence.

Parameters:
s_name symbolic name for the container
r_name real name for the container
type type of data represented by this container

Implements BESContainerStorage.

Definition at line 179 of file BESContainerStorageFile.cc.

bool BESContainerStorageFile::del_container ( const string &  s_name  )  [virtual]

removes a container with the given symbolic name

This method removes a container to the persistence store with the given symbolic name. It deletes the container. The container is NOT removed from the file from which it was loaded, however.

Parameters:
s_name symbolic name for the container
Returns:
true if successfully removed and false otherwise

Implements BESContainerStorage.

Definition at line 196 of file BESContainerStorageFile.cc.

bool BESContainerStorageFile::del_containers (  )  [virtual]

removes all container

This method removes all containers from the persistent store. It does not delete the real data behind the container.

Returns:
true if successfully removed and false otherwise

Implements BESContainerStorage.

Definition at line 219 of file BESContainerStorageFile.cc.

void BESContainerStorageFile::show_containers ( BESInfo info  )  [virtual]

show information for each container in this persistent store

For each container in this persistent store, add infomation about each of those containers. The information added to the information object includes a line for each container within this persistent store which includes the symbolic name, the real name, and the data type, separated by commas.

In the case of this persistent store all of the containers loaded from the file specified by the key BES.Container.Persistence.File.<store_name> is added to the information object.

Parameters:
info object to store the container and persistent store information into
See also:
BESInfo

Implements BESContainerStorage.

Definition at line 251 of file BESContainerStorageFile.cc.

References BESInfo::add_tag(), BESInfo::begin_tag(), BESInfo::end_tag(), and BESContainerStorage::get_name().

Referenced by pfileT::run().

Here is the call graph for this function:

void BESContainerStorageFile::dump ( ostream &  strm  )  const [virtual]

dumps information about this object

Displays the pointer value of this instance along with information about the containers in this storage

Parameters:
strm C++ i/o stream to dump the information to

Implements BESContainerStorage.

Definition at line 278 of file BESContainerStorageFile.cc.

References BESContainerStorage::get_name(), BESIndent::Indent(), BESIndent::LMarg(), and BESIndent::UnIndent().

Here is the call graph for this function:

virtual const string& BESContainerStorage::get_name (  )  const [inline, virtual, inherited]

retrieve the name of this persistent store

Returns:
name of this persistent store.

Definition at line 86 of file BESContainerStorage.h.

References BESContainerStorage::_my_name.

Referenced by BESContainerStorageList::add_persistence(), BESContainerStorageVolatile::dump(), dump(), BESContainerStorageCatalog::dump(), BESContainerStorageVolatile::show_containers(), and show_containers().


Member Data Documentation

string BESContainerStorage::_my_name [protected, inherited]

Definition at line 69 of file BESContainerStorage.h.

Referenced by BESContainerStorage::get_name().


The documentation for this class was generated from the following files:
Generated on Wed Aug 29 03:28:25 2007 for OPeNDAP Back End Server (BES) by  doxygen 1.5.2