From aa12a97adf5b06cee251875da1e4d1479755a4ef Mon Sep 17 00:00:00 2001 From: anschrammh Date: Mon, 1 Apr 2019 23:54:34 +0200 Subject: [PATCH] Renamed addParameter method to add to be more generic --- src/app/Dictionary.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/Dictionary.h b/src/app/Dictionary.h index d75b696..d49e3b8 100644 --- a/src/app/Dictionary.h +++ b/src/app/Dictionary.h @@ -11,6 +11,7 @@ template class Dictionary { public: + Dictionary() :_parameter(NULL), _value(NULL), _next(NULL), _head(this){} ~Dictionary() { if(_head == this) @@ -21,17 +22,17 @@ public: //_value = NULL; //Useless, just my c habits } - boolean addParameter(const char *parameter, T *value) + boolean add(const char *parameter, T *value) { Dictionary *dictionaryNode = new Dictionary(parameter, value); return addNewNodeAtTheEnd(dictionaryNode); } - boolean addParameter(const char *parameter, T value) + boolean add(const char *parameter, T value) { Dictionary *dictionaryNode = new Dictionary(parameter, new T(value)); return addNewNodeAtTheEnd(dictionaryNode); } - boolean deleteParameter(const char *parameter) + boolean remove(const char *parameter) { if(_head->_next == NULL) return false; @@ -124,7 +125,6 @@ public: T* getValueRef(){return _value;} const char *getParameter() const{return _parameter == NULL ? "" : _parameter;} protected: - Dictionary() :_parameter(NULL), _value(NULL), _next(NULL), _head(this){} Dictionary(const char *parameter, T *value) : Dictionary() { //We copy the parameter and the value