diff options
| author | manuel <manuel@nc8430.lan> | 2009-05-26 23:10:13 +0200 |
|---|---|---|
| committer | manuel <manuel@nc8430.lan> | 2009-05-26 23:10:13 +0200 |
| commit | 26a97259f5a7b066cff2927e88c867fac2aaad87 (patch) | |
| tree | 40250b999ce0ca02d0ebcde55640c56be975e555 /ue4/mycpu/displays.h | |
| parent | 1a60d0c2a8eeef3b39ef276f0f3552552a1519b1 (diff) | |
| download | ooprog-26a97259f5a7b066cff2927e88c867fac2aaad87.tar.gz ooprog-26a97259f5a7b066cff2927e88c867fac2aaad87.tar.bz2 ooprog-26a97259f5a7b066cff2927e88c867fac2aaad87.zip | |
template FTW!!!!!11
Diffstat (limited to 'ue4/mycpu/displays.h')
| -rw-r--r-- | ue4/mycpu/displays.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/ue4/mycpu/displays.h b/ue4/mycpu/displays.h index d4f3f36..33d81bb 100644 --- a/ue4/mycpu/displays.h +++ b/ue4/mycpu/displays.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * @module displays | 2 | * @module displays |
| 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) | 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) |
| 4 | * @brief Implementations of CDisplay | 4 | * @brief Implementations of CDisplay |
| 5 | * @date 10.05.2009 | 5 | * @date 26.05.2009 |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #ifndef DISPLAYS_H | 8 | #ifndef DISPLAYS_H |
| @@ -15,14 +15,15 @@ | |||
| 15 | * @class CDisplayWDEZ | 15 | * @class CDisplayWDEZ |
| 16 | * | 16 | * |
| 17 | * Implementation of CDisplay | 17 | * Implementation of CDisplay |
| 18 | * Prints CDat to stdout as decimal | 18 | * Prints T to stdout as decimal |
| 19 | */ | 19 | */ |
| 20 | template <class T> | ||
| 20 | class CDisplayWDEZ | 21 | class CDisplayWDEZ |
| 21 | : public CDisplay | 22 | : public CDisplay<T> |
| 22 | { | 23 | { |
| 23 | public: | 24 | public: |
| 24 | CDisplayWDEZ() | 25 | CDisplayWDEZ() |
| 25 | : CDisplay("wdez") | 26 | : CDisplay<T>("wdez") |
| 26 | {} | 27 | {} |
| 27 | 28 | ||
| 28 | /** | 29 | /** |
| @@ -34,7 +35,7 @@ class CDisplayWDEZ | |||
| 34 | * @exception none | 35 | * @exception none |
| 35 | * @conditions none | 36 | * @conditions none |
| 36 | */ | 37 | */ |
| 37 | void display(const CDat &value) | 38 | void display(const T &value) |
| 38 | { | 39 | { |
| 39 | std::cout << std::dec << value << std::endl; | 40 | std::cout << std::dec << value << std::endl; |
| 40 | } | 41 | } |
| @@ -46,14 +47,15 @@ class CDisplayWDEZ | |||
| 46 | * @class CDisplayWHEX | 47 | * @class CDisplayWHEX |
| 47 | * | 48 | * |
| 48 | * Implementation of CDisplay | 49 | * Implementation of CDisplay |
| 49 | * Prints CDat to stdout as decimal | 50 | * Prints T to stdout as decimal |
| 50 | */ | 51 | */ |
| 52 | template <class T> | ||
| 51 | class CDisplayWHEX | 53 | class CDisplayWHEX |
| 52 | : public CDisplay | 54 | : public CDisplay<T> |
| 53 | { | 55 | { |
| 54 | public: | 56 | public: |
| 55 | CDisplayWHEX() | 57 | CDisplayWHEX() |
| 56 | : CDisplay("whex") | 58 | : CDisplay<T>("whex") |
| 57 | {} | 59 | {} |
| 58 | 60 | ||
| 59 | /** | 61 | /** |
| @@ -65,7 +67,7 @@ class CDisplayWHEX | |||
| 65 | * @exception none | 67 | * @exception none |
| 66 | * @conditions none | 68 | * @conditions none |
| 67 | */ | 69 | */ |
| 68 | void display(const CDat &value) | 70 | void display(const T &value) |
| 69 | { | 71 | { |
| 70 | std::cout << std::hex << value << std::endl; | 72 | std::cout << std::hex << value << std::endl; |
| 71 | } | 73 | } |
