35#include "BESFileContainer.h"
36#include "TheBESKeys.h"
39#include "BESUncompressManager3.h"
40#include "BESUncompressCache.h"
42#include "BESForbiddenError.h"
50#define MODULE "cache2"
51#define prolog std::string("BESFileContainer::").append(__func__).append("() - ")
62BESFileContainer::BESFileContainer(
const string &sym_name,
const string &real_name,
const string &type) :
63 BESContainer(sym_name, real_name, type), _cached(false), _target(
"")
65 string::size_type dotdot = real_name.find(
"..");
66 if (dotdot != string::npos) {
67 string s = prolog +
"'../' not allowed in container real name " + real_name;
76BESFileContainer::BESFileContainer(
const BESFileContainer ©_from) :
77 BESContainer(copy_from), _cached(copy_from._cached), _target(copy_from._target)
92 BESContainer *container =
new BESFileContainer;
104 BESDEBUG(MODULE, prolog <<
"BEGIN real_name: " <<
get_real_name() << endl);
115 _cached = BESUncompressManager3::TheManager()->uncompress(
get_real_name(), _target, cache);
117 BESDEBUG(MODULE, prolog <<
"END Cached as: " << _target << endl);
121 BESDEBUG(MODULE, prolog <<
"END Not cached" << endl);
136 BESDEBUG(MODULE, prolog <<
"_cached: " << _cached <<
", _target: " << _target << endl);
152 strm << BESIndent::LMarg << prolog <<
"(" << (
void *)
this <<
")" << endl;
155 BESIndent::UnIndent();
A container is something that holds data. E.G., a netcdf file or a database entry.
void dump(std::ostream &strm) const override
dumps information about this object
void _duplicate(BESContainer ©_to)
duplicate this instance into the passed container
std::string get_real_name() const
retrieve the real name for this container, such as a file name.
virtual bool release()
release the file
virtual std::string access()
returns the name of a file to access for this container, uncompressing if necessary.
virtual BESContainer * ptr_duplicate()
duplicate this instances of BESFileContainer
virtual void dump(std::ostream &strm) const
Displays debug information about this object.
virtual void unlock_and_close(const std::string &target)
error thrown if the BES is not allowed to access the resource requested
static BESUncompressCache * get_instance()