Renamed addParameter method to add to be more generic
This commit is contained in:
parent
7717fa94e3
commit
aa12a97adf
@ -11,6 +11,7 @@ template <typename T>
|
|||||||
class Dictionary
|
class Dictionary
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Dictionary() :_parameter(NULL), _value(NULL), _next(NULL), _head(this){}
|
||||||
~Dictionary()
|
~Dictionary()
|
||||||
{
|
{
|
||||||
if(_head == this)
|
if(_head == this)
|
||||||
@ -21,17 +22,17 @@ public:
|
|||||||
//_value = NULL; //Useless, just my c habits
|
//_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);
|
Dictionary *dictionaryNode = new Dictionary(parameter, value);
|
||||||
return addNewNodeAtTheEnd(dictionaryNode);
|
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));
|
Dictionary *dictionaryNode = new Dictionary(parameter, new T(value));
|
||||||
return addNewNodeAtTheEnd(dictionaryNode);
|
return addNewNodeAtTheEnd(dictionaryNode);
|
||||||
}
|
}
|
||||||
boolean deleteParameter(const char *parameter)
|
boolean remove(const char *parameter)
|
||||||
{
|
{
|
||||||
if(_head->_next == NULL) return false;
|
if(_head->_next == NULL) return false;
|
||||||
|
|
||||||
@ -124,7 +125,6 @@ public:
|
|||||||
T* getValueRef(){return _value;}
|
T* getValueRef(){return _value;}
|
||||||
const char *getParameter() const{return _parameter == NULL ? "" : _parameter;}
|
const char *getParameter() const{return _parameter == NULL ? "" : _parameter;}
|
||||||
protected:
|
protected:
|
||||||
Dictionary() :_parameter(NULL), _value(NULL), _next(NULL), _head(this){}
|
|
||||||
Dictionary(const char *parameter, T *value) : Dictionary()
|
Dictionary(const char *parameter, T *value) : Dictionary()
|
||||||
{
|
{
|
||||||
//We copy the parameter and the value
|
//We copy the parameter and the value
|
||||||
|
Loading…
Reference in New Issue
Block a user