diff options
author | Hugo Lima <hugo.lima@openbossa.org> | 2009-09-18 15:02:04 -0300 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2009-09-18 15:02:04 -0300 |
commit | 38283f8ae3a479dbc213ff16c8b727094028bb9a (patch) | |
tree | 48dbd447ab9e2f7d6702bcc78c0a386c30357cc7 /typesystem.h | |
parent | be5fb84cf7a20d7fe446ef8fdb3b03914fca8526 (diff) |
- Turn ctors of TypeDatabase private (It's a singleton!)
- Makes possible to reset the TypeDatabase, this is usefull in unit tests
when you need to make all unit tests independent of each other.
Diffstat (limited to 'typesystem.h')
-rw-r--r-- | typesystem.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/typesystem.h b/typesystem.h index 65dd28a01..945461a2d 100644 --- a/typesystem.h +++ b/typesystem.h @@ -1718,10 +1718,17 @@ struct TypeRejection class TypeDatabase { -public: TypeDatabase(); + TypeDatabase(const TypeDatabase&); + TypeDatabase& operator=(const TypeDatabase&); +public: - static TypeDatabase *instance(); + /** + * Return the type system instance. + * \param newInstance This parameter is usefull just for unit testing, because singletons causes + * too many side effects on unit testing. + */ + static TypeDatabase *instance(bool newInstance = false); QStringList requiredTargetImports() { |