Last change
on this file since dd43a7 was 4fc41a, checked in by Tillmann Crueger <crueger@…>, 15 years ago |
Made the UIFactory an instance of the Singleton Pattern
|
-
Property mode
set to
100644
|
File size:
648 bytes
|
Line | |
---|
1 | /*
|
---|
2 | * UIFactory.cpp
|
---|
3 | *
|
---|
4 | * Created on: Jan 5, 2010
|
---|
5 | * Author: crueger
|
---|
6 | */
|
---|
7 |
|
---|
8 |
|
---|
9 | #include <cassert>
|
---|
10 | #include "Patterns/Singleton_impl.hpp"
|
---|
11 | #include "UIElements/UIFactory.hpp"
|
---|
12 |
|
---|
13 | // all factories that can be used:
|
---|
14 | #include "UIElements/TextUIFactory.hpp"
|
---|
15 |
|
---|
16 | UIFactory::UIFactory()
|
---|
17 | {
|
---|
18 | // TODO Auto-generated constructor stub
|
---|
19 |
|
---|
20 | }
|
---|
21 |
|
---|
22 | UIFactory::~UIFactory()
|
---|
23 | {
|
---|
24 | // TODO Auto-generated destructor stub
|
---|
25 | }
|
---|
26 |
|
---|
27 | void UIFactory::makeUserInterface(InterfaceTypes type) {
|
---|
28 | switch(type) {
|
---|
29 | case Text :
|
---|
30 | setInstance(new TextUIFactory());
|
---|
31 | break;
|
---|
32 |
|
---|
33 | default:
|
---|
34 | assert(0 && "No such Factory in stock");
|
---|
35 | break;
|
---|
36 | }
|
---|
37 | }
|
---|
38 |
|
---|
39 | CONSTRUCT_SINGLETON(UIFactory)
|
---|
Note:
See
TracBrowser
for help on using the repository browser.