From 683d7946798634c35df165bf40a97d78f947751c Mon Sep 17 00:00:00 2001 From: manzerbredes Date: Fri, 1 May 2015 15:50:10 +0200 Subject: Add template support to Cell class --- src/Model/Cell.hpp | 53 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 14 deletions(-) (limited to 'src/Model/Cell.hpp') 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 -#include -class Cell + +template 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(); + } }; -- cgit v1.2.3