BESUncompressManager Class Reference

List of all registered uncompress methods. More...

#include <BESUncompressManager.h>

Inheritance diagram for BESUncompressManager:

Inheritance graph
[legend]
Collaboration diagram for BESUncompressManager:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~BESUncompressManager (void)
virtual bool add_method (const string &name, p_bes_uncompress method)
 add a uncompress method to the list
virtual bool remove_method (const string &name)
 removes a uncompress method from the list
virtual p_bes_uncompress find_method (const string &name)
 returns the uncompression method specified
virtual string get_method_names ()
 returns the comma separated list of all uncompression methods currently registered.
virtual string uncompress (const string &src, BESCache &cache)
 find the method that can uncompress the specified src and pass control to that method.
virtual void dump (ostream &strm) const
 dumps information about this object

Static Public Member Functions

static BESUncompressManagerTheManager ()

Protected Member Functions

 BESUncompressManager (void)
 constructs an uncompression manager adding gz and bz2 uncompression methods by default.

Detailed Description

List of all registered uncompress methods.

The BESUncompressManager allows the developer to add or remove named uncompression methods from the list for this server. By default a gz and bz2 method is provided.

What is actually added to the list are static uncompression functions

See also:
BESUncompressGZ

BESUncompressBZ2

BESCache

Definition at line 60 of file BESUncompressManager.h.


Constructor & Destructor Documentation

BESUncompressManager::BESUncompressManager ( void   )  [protected]

constructs an uncompression manager adding gz and bz2 uncompression methods by default.

Definition at line 51 of file BESUncompressManager.cc.

References add_method(), BESKeys::get_key(), TheBESKeys::TheKeys(), BESUncompressBZ2::uncompress(), and BESUncompressGZ::uncompress().

Here is the call graph for this function:

virtual BESUncompressManager::~BESUncompressManager ( void   )  [inline, virtual]

Definition at line 73 of file BESUncompressManager.h.


Member Function Documentation

bool BESUncompressManager::add_method ( const string &  name,
p_bes_uncompress  method 
) [virtual]

add a uncompress method to the list

This method actually adds to the list a static method that knows how to uncompress a particular type of file. For example, a .gz or .bz2 file.

Parameters:
name name of the method to add to the list
method the static function that uncompress the particular type of file
Returns:
true if successfully added, false if it already exists

Definition at line 94 of file BESUncompressManager.cc.

Referenced by BESUncompressManager().

bool BESUncompressManager::remove_method ( const string &  name  )  [virtual]

removes a uncompress method from the list

The static method that knows how to uncompress the specified type of file is removed from the list.

Parameters:
name name of the method to remove
Returns:
true if successfully removed, false if it doesn't exist in the list

Definition at line 116 of file BESUncompressManager.cc.

p_bes_uncompress BESUncompressManager::find_method ( const string &  name  )  [virtual]

returns the uncompression method specified

This method looks up the uncompression method with the given name and returns that method.

Parameters:
name name of the uncompression method to find
Returns:
the function of type p_bes_uncompress

Definition at line 137 of file BESUncompressManager.cc.

Referenced by uncompress().

string BESUncompressManager::get_method_names (  )  [virtual]

returns the comma separated list of all uncompression methods currently registered.

Returns:
comma separated list of uncompression method names

Definition at line 154 of file BESUncompressManager.cc.

string BESUncompressManager::uncompress ( const string &  src,
BESCache cache 
) [virtual]

find the method that can uncompress the specified src and pass control to that method.

Parameters:
src file to be uncompressed
cache BESCache object to uncompress the src file in
Returns:
full path to the uncompressed file

Definition at line 177 of file BESUncompressManager.cc.

References BESDEBUG, BESCache::cache_dir(), find_method(), BESCache::is_cached(), BESCache::lock(), BESCache::purge(), and BESCache::unlock().

Referenced by BESContainer::access(), and uncompressT::run().

Here is the call graph for this function:

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

dumps information about this object

Displays the pointer value of this instance along with the names of the registered uncompression methods.

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

Implements BESObj.

Definition at line 286 of file BESUncompressManager.cc.

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

Here is the call graph for this function:

BESUncompressManager * BESUncompressManager::TheManager (  )  [static]

Definition at line 311 of file BESUncompressManager.cc.

Referenced by BESContainer::access(), and uncompressT::run().


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