BESContainerStorageVolatile Class Reference

implementation of BESContainerStorage that stores containers in memory for the duration of this process. More...

#include <BESContainerStorageVolatile.h>

Inheritance diagram for BESContainerStorageVolatile:

Inheritance graph
[legend]
Collaboration diagram for BESContainerStorageVolatile:

Collaboration graph
[legend]
List of all members.

Public Types

typedef map< string, BESContainer
* >::const_iterator 
Container_citer
typedef map< string, BESContainer
* >::iterator 
Container_iter

Public Member Functions

virtual void add_container (const string &sym_name, const string &real_name, const string &type)
 add a file container to the volatile list.
 BESContainerStorageVolatile (const string &n)
 create an instance of this persistent store with the given name.
virtual bool del_container (const string &s_name)
 removes a container with the given symbolic name from the list and deletes it.
virtual bool del_containers ()
 removes all container
virtual void dump (ostream &strm) const
 dumps information about this object
virtual const string & get_name () const
 retrieve the name of this persistent store
virtual BESContainerlook_for (const string &sym_name)
 looks for the specified container using the symbolic name passed
virtual void show_containers (BESInfo &info)
 show information for each container in this persistent store
virtual ~BESContainerStorageVolatile ()

Protected Member Functions

virtual void add_container (BESContainer *c)
 add the passed container to the list of containers in volatile storage
virtual void show_container (const string &sym_name, const string &real_name, const string &type, BESInfo &info)
 add information for a container to the informational response object

Protected Attributes

bool _follow_sym_links
string _my_name
string _root_dir

Detailed Description

implementation of BESContainerStorage that stores containers in memory for the duration of this process.

This implementation of BESContainerStorage stores volatile containers in memory for the duration of this process. A list of containers is stored in the object. The look_for method simply looks for the specified symbolic name in the list of containers and returns if a match is found. Containers can be added to this instance as long as the symbolic name doesn't already exist.

See also:
BESContainerStorage

BESContainer

Definition at line 57 of file BESContainerStorageVolatile.h.


Member Typedef Documentation

typedef map< string, BESContainer * >::const_iterator BESContainerStorageVolatile::Container_citer

Definition at line 70 of file BESContainerStorageVolatile.h.

typedef map< string, BESContainer * >::iterator BESContainerStorageVolatile::Container_iter

Definition at line 71 of file BESContainerStorageVolatile.h.


Constructor & Destructor Documentation

BESContainerStorageVolatile::BESContainerStorageVolatile ( const string &  n  ) 

create an instance of this persistent store with the given name.

Creates an instances of BESContainerStorageVolatile with the given name.

Parameters:
n name of this persistent store
See also:
BESContainer

Definition at line 48 of file BESContainerStorageVolatile.cc.

References _follow_sym_links, _root_dir, BESKeys::get_value(), BESUtil::lowercase(), and TheBESKeys::TheKeys().

Here is the call graph for this function:

BESContainerStorageVolatile::~BESContainerStorageVolatile (  )  [virtual]

Definition at line 71 of file BESContainerStorageVolatile.cc.

References del_containers().

Here is the call graph for this function:


Member Function Documentation

void BESContainerStorageVolatile::add_container ( const string &  sym_name,
const string &  real_name,
const string &  type 
) [virtual]

add a file container to the volatile list.

The container's realname represents the path to a data file in the file system.

If a container other than a BESFileContainer is to be added to the list then a derived class of BESContainerStorageVolatile should call the protected add_container method that takes an already built container. This method adds a container represented by a data file.

Parameters:
sym_name symbolic name of the container being created
real_name real name of the container
type type of data represented by this container
Exceptions:
BESInternalError if no type is specified
BESInternalError if a container with the passed symbolic name already exists.

Implements BESContainerStorage.

Reimplemented in BESContainerStorageCatalog.

Definition at line 117 of file BESContainerStorageVolatile.cc.

References _follow_sym_links, _root_dir, and BESUtil::check_path().

Here is the call graph for this function:

void BESContainerStorageVolatile::add_container ( BESContainer c  )  [protected, virtual]

add the passed container to the list of containers in volatile storage

This method adds the passed container to the list of volatile containers. The passed container is owned by the list if added and should not be deleted by the caller.

If a container with the symbolic name of the passed container is already in the list then an exception is thrown.

Parameters:
c container to add to the list
Exceptions:
BESContainerStorageExcpetion if the passed container is null
BESContainerStorageExcpetion if no type is specified in the passed container
BESContainerStorageExcpetion if a container with the passed symbolic name already exists.

Definition at line 173 of file BESContainerStorageVolatile.cc.

References BESContainer::get_container_type(), and BESContainer::get_symbolic_name().

Referenced by BESContainerStorageCatalog::add_container().

Here is the call graph for this function:

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

removes a container with the given symbolic name from the list and deletes it.

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

Implements BESContainerStorage.

Definition at line 205 of file BESContainerStorageVolatile.cc.

bool BESContainerStorageVolatile::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 228 of file BESContainerStorageVolatile.cc.

Referenced by ~BESContainerStorageVolatile().

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

dumps information about this object

Displays the pointer value of this instance along with information about the containers stored in this volatile list.

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

Implements BESContainerStorage.

Reimplemented in BESContainerStorageCatalog.

Definition at line 289 of file BESContainerStorageVolatile.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 91 of file BESContainerStorage.h.

References BESContainerStorage::_my_name.

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

BESContainer * BESContainerStorageVolatile::look_for ( const string &  sym_name  )  [virtual]

looks for the specified container using the symbolic name passed

If a match is made with the symbolic name then the stored container is duplicated and returned to the user. If not, 0 is returned.

Parameters:
sym_name symbolic name of the container to look for
Returns:
a new BESContainer instance using the ptr_duplicate method on BESContainer

Implements BESContainerStorage.

Definition at line 86 of file BESContainerStorageVolatile.cc.

References BESContainer::ptr_duplicate().

Here is the call graph for this function:

void BESContainerStorage::show_container ( const string &  sym_name,
const string &  real_name,
const string &  type,
BESInfo info 
) [protected, virtual, inherited]

add information for a container to the informational response object

Parameters:
sym_name symbolic name of the container to add
real_name real name, e.g. file name, of the container to add
type data type of the container
info The BES information object to add container information to
See also:
BESInfo

Definition at line 45 of file BESContainerStorage.cc.

References BESInfo::add_tag().

Referenced by show_containers(), and BESContainerStorageFile::show_containers().

Here is the call graph for this function:

void BESContainerStorageVolatile::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 information from each container added to the volatile list is added to the information object.

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

Implements BESContainerStorage.

Definition at line 258 of file BESContainerStorageVolatile.cc.

References _root_dir, BESInfo::add_tag(), BESContainerStorage::get_name(), and BESContainerStorage::show_container().

Here is the call graph for this function:


Member Data Documentation

bool BESContainerStorageVolatile::_follow_sym_links [protected]

Definition at line 63 of file BESContainerStorageVolatile.h.

Referenced by add_container(), BESContainerStorageCatalog::BESContainerStorageCatalog(), and BESContainerStorageVolatile().

string BESContainerStorage::_my_name [protected, inherited]

Definition at line 70 of file BESContainerStorage.h.

Referenced by BESContainerStorage::get_name().

string BESContainerStorageVolatile::_root_dir [protected]

Definition at line 62 of file BESContainerStorageVolatile.h.

Referenced by add_container(), BESContainerStorageCatalog::BESContainerStorageCatalog(), BESContainerStorageVolatile(), and show_containers().


The documentation for this class was generated from the following files:
Generated on Wed May 12 09:54:51 2010 for OPeNDAP Hyrax Back End Server (BES) by  doxygen 1.4.7