diff options
| author | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2015-05-01 15:50:10 +0200 |
|---|---|---|
| committer | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2015-05-01 15:50:10 +0200 |
| commit | 683d7946798634c35df165bf40a97d78f947751c (patch) | |
| tree | 6dd80b60ed63ec92d7b6e7f291079493f64f219b /src/Model/Cell.hpp | |
| parent | 048f1e17b752d2af53db82c1861002283fc300fa (diff) | |
Add template support to Cell class
Diffstat (limited to 'src/Model/Cell.hpp')
| -rw-r--r-- | src/Model/Cell.hpp | 53 |
1 files changed, 39 insertions, 14 deletions
diff --git a/src/Model/Cell.hpp b/src/Model/Cell.hpp index badd070..7638c4e 100644 --- a/src/Model/Cell.hpp +++ b/src/Model/Cell.hpp @@ -8,24 +8,49 @@ * Date : 29/04/2015 */ #include <iostream> -#include <string> -class Cell + +template<class T> class Cell { private: - std::string m_value; - + T* m_Element; + public: - Cell(); - Cell(std::string value); - ~Cell(); - - bool isEmpty(); - bool equals(Cell * otherCell); - std::string getValue(); - - // Describes the cell in a terminal - std::string description(); + + //Constructor + Cell(std::string value) + { + m_Element=new T(); + m_Element->setValue(value); + } + + //Destructor + ~Cell() + { + delete m_Element; + } + + + bool isEmpty() + { + return true; + } + + std::string getElementValue() + { + return m_Element->getValue(); + } + + bool equals(Cell *otherCell) + { + return true; + } + + // Description + std::string description() + { + return m_Element->description(); + } }; |
