6#ifndef __ATLSIMPCOLL_H__
7#define __ATLSIMPCOLL_H__
37template <
typename T,
typename TEqual = CSimpleArrayEqualHelper<T> >
65 T *pNewData = (
T *)
realloc(
static_cast<void *
>(
m_pData), nNewCapacity *
sizeof(
T));
84 for (
int nIndex = 0; nIndex <
m_nCount; ++nIndex)
86 if (TEqual::IsEqual(
m_pData[nIndex],
t))
120 for (
int nIndex = 0; nIndex < nCount; ++nIndex)
135 if (nIndex < 0 ||
m_nCount <= nIndex)
142 const int nRightCount =
m_nCount - (nIndex + 1);
143 const int nRightSize = nRightCount *
sizeof(
T);
155 if (nIndex < 0 ||
m_nCount <= nIndex)
185 int nNewCount =
src.GetSize();
189 if (pNewData ==
NULL)
199 for (
int nIndex = 0; nIndex <
m_nCount; ++nIndex)
206 for (
int nIndex = 0; nIndex <
src.GetSize(); ++nIndex)
251 static void operator delete(
void *
p,
void* )
260template <
typename TKey,
typename TVal>
276template <
typename TKey,
typename TVal>
293template <
typename TKey,
typename TVal,
294 typename TEqual = CSimpleMapEqualHelper<TKey, TVal> >
318 for (
int nIndex = 0; nIndex < nCount; ++nIndex)
331 for (
int nIndex = 0; nIndex < nCount; ++nIndex)
391 return m_Pairs.RemoveAt(nIndex);
415 if (nIndex < 0 ||
GetSize() <= nIndex)
static bool IsEqual(const T &, const T &)
static bool IsEqual(const T &t1, const T &t2)
T & operator[](int nIndex)
CSimpleArray(const CSimpleArray< T, TEqual > &src)
const T * GetData() const
const T & operator[](int nIndex) const
BOOL RemoveAt(int nIndex)
CSimpleArray< T, TEqual > & operator=(const CSimpleArray< T, TEqual > &src)
int Find(const T &t) const
BOOL SetAtIndex(int nIndex, const T &t)
void ConstructItemInPlace(int nIndex, const T &src)
void DestructItem(int nIndex)
static bool IsEqualKey(const TKey &k1, const TKey &k2)
static bool IsEqualValue(const TVal &v1, const TVal &v2)
static bool IsEqualKey(const TKey &k1, const TKey &k2)
static bool IsEqualValue(const TVal &v1, const TVal &v2)
TVal Lookup(const TKey &key) const
const TKey & GetKeyAt(int nIndex) const
TVal & GetValueAt(int nIndex)
TKey & GetKeyAt(int nIndex)
BOOL SetAt(const TKey &key, const TVal &val)
BOOL RemoveAt(int nIndex)
TKey ReverseLookup(const TVal &val) const
int FindKey(const TKey &key) const
BOOL SetAtIndex(int nIndex, const TKey &key, const TVal &val)
int FindVal(const TVal &val) const
CSimpleArray< Pair, CSimpleArrayEqualHelperFalse< Pair > > m_Pairs
BOOL Remove(const TKey &key)
BOOL Add(const TKey &key, const TVal &val)
const TVal & GetValueAt(int nIndex) const
GLfloat GLfloat GLfloat v2
#define memmove(s1, s2, n)
ConstructImpl(const T &obj)
Pair & operator=(const Pair &pair)
Pair(const TKey &k, const TVal &v)