|
Last change
on this file since 536ce2 was 83afe0, checked in by Frederik Heber <heber@…>, 16 years ago |
|
Extended UIFactory to a CommandLine derivate.
Signed-off-by: Frederik Heber <heber@…>
|
-
Property mode
set to
100644
|
|
File size:
777 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 | #include "UIElements/CommandLineUIFactory.hpp"
|
|---|
| 16 |
|
|---|
| 17 | UIFactory::UIFactory()
|
|---|
| 18 | {
|
|---|
| 19 | // TODO Auto-generated constructor stub
|
|---|
| 20 |
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | UIFactory::~UIFactory()
|
|---|
| 24 | {
|
|---|
| 25 | // TODO Auto-generated destructor stub
|
|---|
| 26 | }
|
|---|
| 27 |
|
|---|
| 28 | void UIFactory::makeUserInterface(InterfaceTypes type) {
|
|---|
| 29 | switch(type) {
|
|---|
| 30 | case Text :
|
|---|
| 31 | setInstance(new TextUIFactory());
|
|---|
| 32 | break;
|
|---|
| 33 | case CommandLine:
|
|---|
| 34 | setInstance(new CommandLineUIFactory());
|
|---|
| 35 | break;
|
|---|
| 36 |
|
|---|
| 37 | default:
|
|---|
| 38 | assert(0 && "No such Factory in stock");
|
|---|
| 39 | break;
|
|---|
| 40 | }
|
|---|
| 41 | }
|
|---|
| 42 |
|
|---|
| 43 | CONSTRUCT_SINGLETON(UIFactory)
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.