Carbide.c++

com.nokia.carbide.cpp.epoc.engine.preprocessor
Class DefaultModelDocumentProvider

java.lang.Object
  extended by com.nokia.carbide.cpp.epoc.engine.preprocessor.DefaultModelDocumentProvider
All Implemented Interfaces:
IModelDocumentProvider

public class DefaultModelDocumentProvider
extends java.lang.Object
implements IModelDocumentProvider

A default implementation of IModelDocumentProvider which caches documents. It keeps a maximum number of documents in memory at a time. It refreshes a document when the underlying file's timestamp changes.

See Also:
IModelDocumentProvider

Method Summary
 IDocument getDocument(java.io.File file)
          Locate an existing document or load it.
static DefaultModelDocumentProvider getInstance()
          Get the singleton instanceof the translation unit provider.
 void setDebugFlag(boolean flag)
          Configure the debugging flag.
 void setMaxCacheCount(int count)
          Set the maximum number of TU's to keep.
 void setMinimumHitsToKeep(int minHits)
          Set the minimum number of hits setting, which controls the lower limit at which a TU will be kept in the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DefaultModelDocumentProvider getInstance()
Get the singleton instanceof the translation unit provider. The provider owns the cache of TUs.

Returns:
instance, never null

getDocument

public IDocument getDocument(java.io.File file)
Description copied from interface: IModelDocumentProvider
Locate an existing document or load it. Listen for future changes to the document and to the file.

Specified by:
getDocument in interface IModelDocumentProvider
Parameters:
file - full pathed file
Returns:
IDocument instance; return null only if the file does not exist.

setDebugFlag

public void setDebugFlag(boolean flag)
Configure the debugging flag. Results are sent to System.out.

Parameters:
flag -

setMaxCacheCount

public void setMaxCacheCount(int count)
Set the maximum number of TU's to keep.

This attempts to reduces the cache.

Parameters:
count - number of TUs, must be nonnegative

setMinimumHitsToKeep

public void setMinimumHitsToKeep(int minHits)
Set the minimum number of hits setting, which controls the lower limit at which a TU will be kept in the cache.

This attempts to reduces the cache.

Parameters:
minHits - minimum hits, must be nonnegative

Carbide.c++