11 18 ¶
11 19 ¶
11 20 ¶
11 24 ¶
template'<'class TYPE, class ARG_TYPE'>' class CArray : public CObject { public: // Construction CArray(); // Attributes int GetSize() const; int GetUpperBound() const; void SetSize(int nNewSize, int nGrowBy = -1); // Operations // Clean up void FreeExtra(); void RemoveAll(); // Accessing elements TYPE GetAt(int nIndex) const; void SetAt(int nIndex, ARG_TYPE newElement); TYPE& ElementAt(int nIndex); // Direct Access to the element data (may return NULL) const TYPE* GetData() const; TYPE* GetData(); // Potentially growing the array void SetAtGrow(int nIndex, ARG_TYPE newElement); int Add(ARG_TYPE newElement); int Append(const CArray& src); void Copy(const CArray& src); // overloaded operator helpers TYPE operator[](int nIndex) const; TYPE& operator[](int nIndex); // Operations that move elements around void InsertAt(int nIndex, ARG_TYPE newElement, int nCount = 1); void RemoveAt(int nIndex, int nCount = 1); void InsertAt(int nStartIndex, CArray* pNewArray); // Implementation protected: TYPE* m_pData; // the actual array of data int m_nSize; // # of elements (upperBound - 1) int m_nMaxSize; // max allocated int m_nGrowBy; // grow amount public: ~CArray(); void Serialize(CArchive&); #ifdef _DEBUG void Dump(CDumpContext&) const; void AssertValid() const; #endif };
template'<'class TYPE, class ARG_TYPE'>' void CArray<TYPE, ARG_TYPE>::Serialize(CArchive& ar) { ASSERT_VALID(this); CObject::Serialize(ar); if (ar.IsStoring()) { ar.WriteCount(m_nSize); } else { DWORD nOldSize = ar.ReadCount(); SetSize(nOldSize, -1); } SerializeElements<TYPE>(ar, m_pData, m_nSize); }------
-_-
거 걸;;
깨 ;
Load 겠-_-
-----
CVS -_-
-_-
ㄱ ㅐ -_-