68 lines
2.1 KiB
C++
68 lines
2.1 KiB
C++
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// NoesisGUI - http://www.noesisengine.com
|
|
// Copyright (c) 2013 Noesis Technologies S.L. All Rights Reserved.
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
namespace Noesis
|
|
{
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
template<class T>
|
|
T* UICollection<T>::Get(uint32_t index) const
|
|
{
|
|
return (T*)BaseCollection::mItems[index].GetPtr();
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
template<class T>
|
|
void UICollection<T>::Set(uint32_t index, T* item)
|
|
{
|
|
BaseCollection::Set(index, item);
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
template<class T>
|
|
int UICollection<T>::Add(T* item)
|
|
{
|
|
return BaseCollection::Add(item);
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
template<class T>
|
|
void UICollection<T>::Insert(uint32_t index, T* item)
|
|
{
|
|
BaseCollection::Insert(index, item);
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
template<class T>
|
|
bool UICollection<T>::Contains(const T* item) const
|
|
{
|
|
return BaseCollection::IndexOfComponent(item) >= 0;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
template<class T>
|
|
int UICollection<T>::IndexOf(const T* item) const
|
|
{
|
|
return BaseCollection::IndexOfComponent(item);
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
template<class T>
|
|
bool UICollection<T>::Remove(const T* item)
|
|
{
|
|
return BaseCollection::Remove(item);
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
template<class T>
|
|
const TypeClass* UICollection<T>::GetItemType() const
|
|
{
|
|
static_assert(IsDerived<T, BaseComponent>::Result, "T must inherit from BaseComponent");
|
|
return TypeOf<T>();
|
|
}
|
|
|
|
}
|