* Moved KeyMap.h to libsupport.
* Added missing Singleton.cpp. * Fixed List.
This commit is contained in:
parent
fb1d2910a2
commit
b1388d17e8
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2009, Andrea Anzani. All rights reserved.
|
||||
* Copyright 2009-2010, Andrea Anzani. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _KEY_MAP_H
|
|
@ -18,7 +18,7 @@ public:
|
|||
|
||||
void RemoveItemAt(uint32 position);
|
||||
|
||||
TYPE ItemAt(uint32 position);
|
||||
T ItemAt(uint32 position);
|
||||
|
||||
private:
|
||||
std::list<T> fList;
|
||||
|
@ -36,7 +36,7 @@ uint32 List<T>::CountItems() const
|
|||
template<class T>
|
||||
void List<T>::AddItem(T type)
|
||||
{
|
||||
fList.push(type);
|
||||
fList.push_back(type);
|
||||
}
|
||||
|
||||
|
||||
|
@ -54,9 +54,7 @@ T List<T>::ItemAt(uint32 position)
|
|||
{
|
||||
fIter i = fList.begin();
|
||||
std::advance(i, position);
|
||||
if (i == fList.end())
|
||||
return NULL;
|
||||
return i;
|
||||
return *i;
|
||||
}
|
||||
|
||||
#endif // _LIST_H
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* Copyright 2009-2010, Andrea Anzani. All rights reserved.
|
||||
* Copyright 2009-2010, Pier Luigi Fiorini. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Andrea Anzani, andrea.anzani@gmail.com
|
||||
* Pier Luigi Fiorini, pierluigi.fiorini@gmail.com
|
||||
*/
|
||||
|
||||
#include "Singleton.h"
|
||||
|
||||
|
||||
template<typename T> T* Singleton<T>::fInstance = 0;
|
Ŝarĝante…
Reference in New Issue