Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

base::Cache Class Reference

Inheritance diagram for base::Cache:

Inheritance graph
[legend]
Collaboration diagram for base::Cache:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Cache (ref< VFileSystem > fs, const PathName &resourceDirectory, const PathName &cacheDirectory)
virtual ~Cache ()
virtual String className () const
virtual base::Objectclone () const
virtual ref< VFilegetFile (const PathName &name) throw (path_not_found, io_error)
virtual ref< VFilefindFile (const PathName &name, const PathName &additionalPath=PathName()) throw (path_not_found, io_error)
 obtain a file (looks in the resource tree, current directory & the optional path provided)

virtual bool isCached (const PathName &name) throw (path_not_found, io_error)
 is there a resource cache directory associated with this file

virtual ref< VDirectorygetCache (const PathName &name) throw (path_not_found, io_error)
 obtain resource cache directory associated with a file (possibly empty)

virtual PathName resourceDirectory () const
virtual PathName cacheDirectory () const
virtual bool isSameKindAs (const ReferencedObject &) const
virtual bool isSameKindAs (const Object &) const
void reference () const
bool unreference () const
const int referenceCount () const
void enableOnUnreferenceCall (bool enabled)
virtual void onUnreference () const

Protected Attributes

PathName _resourceDirectory
PathName _cacheDirectory
ref< VFileSystemfilesystem
int _refCount
bool onUnreferenceEnabled

Constructor & Destructor Documentation

base::Cache::Cache ref< VFileSystem fs,
const PathName resourceDirectory,
const PathName cacheDirectory
 

Referenced by clone().

virtual base::Cache::~Cache  )  [virtual]
 


Member Function Documentation

virtual PathName base::ResourceCache::cacheDirectory  )  const [inline, virtual, inherited]
 

Definition at line 44 of file ResourceCache.

References base::ResourceCache::_cacheDirectory.

virtual String base::Cache::className  )  const [inline, virtual]
 

return the name of the object's class type. Must be defined by derived classes.

Implements base::Object.

Definition at line 41 of file Cache.

References base::String.

Referenced by clone().

virtual base::Object& base::Cache::clone  )  const [inline, virtual]
 

Definition at line 42 of file Cache.

References Cache(), className(), and NewNamedObj.

void base::Referenced::enableOnUnreferenceCall bool  enabled  )  [inline, inherited]
 

If enabled, each call to unreference() will also call virtual method onUnreference()

Definition at line 115 of file Referenced.

References base::Referenced::onUnreferenceEnabled.

virtual ref<VFile> base::Cache::findFile const PathName name,
const PathName additionalPath = PathName()
throw (path_not_found, io_error) [virtual]
 

obtain a file (looks in the resource tree, current directory & the optional path provided)

Implements base::ResourceCache.

virtual ref<VDirectory> base::Cache::getCache const PathName name  )  throw (path_not_found, io_error) [virtual]
 

obtain resource cache directory associated with a file (possibly empty)

Implements base::ResourceCache.

virtual ref<VFile> base::Cache::getFile const PathName name  )  throw (path_not_found, io_error) [virtual]
 

obtain a file (relative paths are w.r.t. the current directory)

Implements base::ResourceCache.

virtual bool base::Cache::isCached const PathName name  )  throw (path_not_found, io_error) [virtual]
 

is there a resource cache directory associated with this file

Implements base::ResourceCache.

virtual bool base::Object::isSameKindAs const Object  )  const [inline, virtual, inherited]
 

Definition at line 47 of file Object.

virtual bool base::ReferencedObject::isSameKindAs const ReferencedObject  )  const [inline, virtual, inherited]
 

Definition at line 52 of file ReferencedObject.

virtual void base::Referenced::onUnreference  )  const [inline, virtual, inherited]
 

Called by unreference() if enabled via enableOnUnreferenceCall(true). Typically overridden in subclasses that wish to know about unreference() calls - for example to handle manually breaking cyclic references

Reimplemented in robot::control::ControllableAdaptor::AdaptorControlInterface, and robot::control::ControllableAdaptor.

Definition at line 121 of file Referenced.

Referenced by base::Referenced::unreference().

void base::Referenced::reference  )  const [inline, inherited]
 

Increment the reference count by one, indicating that this object has another pointer which is referencing it.

Definition at line 65 of file Referenced.

References base::Referenced::_refCount.

const int base::Referenced::referenceCount  )  const [inline, inherited]
 

Return the number pointers currently referencing this object.

Definition at line 112 of file Referenced.

References base::Referenced::_refCount.

Referenced by robot::control::ControllableAdaptor::AdaptorControlInterface::onUnreference().

virtual PathName base::ResourceCache::resourceDirectory  )  const [inline, virtual, inherited]
 

Definition at line 43 of file ResourceCache.

References base::ResourceCache::_resourceDirectory.

bool base::Referenced::unreference  )  const [inline, inherited]
 

Decrement the reference count by one, indicating that a pointer to this object is referencing it. If the refence count goes to zero, it is assumed that this object is nolonger referenced and is automatically deleted.

Definition at line 81 of file Referenced.

References base::Referenced::_refCount, Exception, base::Referenced::onUnreference(), and base::Referenced::onUnreferenceEnabled.


Member Data Documentation

PathName base::ResourceCache::_cacheDirectory [protected, inherited]
 

Definition at line 54 of file ResourceCache.

Referenced by base::ResourceCache::cacheDirectory().

int base::Referenced::_refCount [mutable, protected, inherited]
 

Definition at line 136 of file Referenced.

Referenced by base::Referenced::reference(), base::Referenced::referenceCount(), base::Referenced::Referenced(), base::Referenced::unreference(), and base::Referenced::~Referenced().

PathName base::ResourceCache::_resourceDirectory [protected, inherited]
 

Definition at line 53 of file ResourceCache.

Referenced by base::ResourceCache::resourceDirectory().

ref<VFileSystem> base::ResourceCache::filesystem [protected, inherited]
 

Definition at line 55 of file ResourceCache.

bool base::Referenced::onUnreferenceEnabled [protected, inherited]
 

Definition at line 137 of file Referenced.

Referenced by base::Referenced::enableOnUnreferenceCall(), base::Referenced::Referenced(), and base::Referenced::unreference().


The documentation for this class was generated from the following file:
Generated on Thu Jul 29 16:38:27 2004 for OpenSim by doxygen 1.3.6