project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/cpp/epoc/engine/preprocessor/DefaultTranslationUnitProvider.java
equal
deleted
inserted
replaced
34 import com.nokia.carbide.internal.cpp.epoc.engine.parser.IDocumentParser; |
34 import com.nokia.carbide.internal.cpp.epoc.engine.parser.IDocumentParser; |
35 import com.nokia.carbide.internal.cpp.epoc.engine.parser.ParserFactory; |
35 import com.nokia.carbide.internal.cpp.epoc.engine.parser.ParserFactory; |
36 import com.nokia.cpp.internal.api.utils.core.*; |
36 import com.nokia.cpp.internal.api.utils.core.*; |
37 public class DefaultTranslationUnitProvider implements ITranslationUnitProvider { |
37 public class DefaultTranslationUnitProvider implements ITranslationUnitProvider { |
38 |
38 |
39 private static DefaultTranslationUnitProvider instance; |
39 private static DefaultTranslationUnitProvider instance = new DefaultTranslationUnitProvider(); |
40 |
40 |
41 // not final or static for debugging |
41 // not final or static for debugging |
42 private boolean DUMP = false; |
42 private boolean DUMP = false; |
43 |
43 |
44 /** count of entries allowed */ |
44 /** count of entries allowed */ |
60 * Get the singleton instanceof the translation unit provider. |
60 * Get the singleton instanceof the translation unit provider. |
61 * The provider owns the cache of TUs. |
61 * The provider owns the cache of TUs. |
62 * @return instance, never null |
62 * @return instance, never null |
63 */ |
63 */ |
64 public static DefaultTranslationUnitProvider getInstance() { |
64 public static DefaultTranslationUnitProvider getInstance() { |
65 if (instance == null) { |
|
66 instance = new DefaultTranslationUnitProvider(); |
|
67 } |
|
68 return instance; |
65 return instance; |
69 } |
66 } |
70 |
67 |
71 private DefaultTranslationUnitProvider() { |
68 private DefaultTranslationUnitProvider() { |
72 maxCacheSize = DEFAULT_MAX_CACHE_SIZE; |
69 maxCacheSize = DEFAULT_MAX_CACHE_SIZE; |