home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / mfc / include / afxcoll.inl < prev    next >
Text File  |  1998-06-16  |  21KB  |  528 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10.  
  11. // Inlines for AFXCOLL.H
  12.  
  13. #ifdef _AFXCOLL_INLINE
  14.  
  15. ////////////////////////////////////////////////////////////////////////////
  16.  
  17. _AFXCOLL_INLINE int CByteArray::GetSize() const
  18.     { return m_nSize; }
  19. _AFXCOLL_INLINE int CByteArray::GetUpperBound() const
  20.     { return m_nSize-1; }
  21. _AFXCOLL_INLINE void CByteArray::RemoveAll()
  22.     { SetSize(0); }
  23. _AFXCOLL_INLINE BYTE CByteArray::GetAt(int nIndex) const
  24.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  25.         return m_pData[nIndex]; }
  26. _AFXCOLL_INLINE void CByteArray::SetAt(int nIndex, BYTE newElement)
  27.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  28.         m_pData[nIndex] = newElement; }
  29.  
  30. _AFXCOLL_INLINE BYTE& CByteArray::ElementAt(int nIndex)
  31.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  32.         return m_pData[nIndex]; }
  33. _AFXCOLL_INLINE const BYTE* CByteArray::GetData() const
  34.     { return (const BYTE*)m_pData; }
  35. _AFXCOLL_INLINE BYTE* CByteArray::GetData()
  36.     { return (BYTE*)m_pData; }
  37. _AFXCOLL_INLINE int CByteArray::Add(BYTE newElement)
  38.     { int nIndex = m_nSize;
  39.         SetAtGrow(nIndex, newElement);
  40.         return nIndex; }
  41.  
  42. _AFXCOLL_INLINE BYTE CByteArray::operator[](int nIndex) const
  43.     { return GetAt(nIndex); }
  44. _AFXCOLL_INLINE BYTE& CByteArray::operator[](int nIndex)
  45.     { return ElementAt(nIndex); }
  46.  
  47.  
  48. ////////////////////////////////////////////////////////////////////////////
  49.  
  50. _AFXCOLL_INLINE int CWordArray::GetSize() const
  51.     { return m_nSize; }
  52. _AFXCOLL_INLINE int CWordArray::GetUpperBound() const
  53.     { return m_nSize-1; }
  54. _AFXCOLL_INLINE void CWordArray::RemoveAll()
  55.     { SetSize(0); }
  56. _AFXCOLL_INLINE WORD CWordArray::GetAt(int nIndex) const
  57.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  58.         return m_pData[nIndex]; }
  59. _AFXCOLL_INLINE void CWordArray::SetAt(int nIndex, WORD newElement)
  60.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  61.         m_pData[nIndex] = newElement; }
  62.  
  63. _AFXCOLL_INLINE WORD& CWordArray::ElementAt(int nIndex)
  64.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  65.         return m_pData[nIndex]; }
  66. _AFXCOLL_INLINE const WORD* CWordArray::GetData() const
  67.     { return (const WORD*)m_pData; }
  68. _AFXCOLL_INLINE WORD* CWordArray::GetData()
  69.     { return (WORD*)m_pData; }
  70. _AFXCOLL_INLINE int CWordArray::Add(WORD newElement)
  71.     { int nIndex = m_nSize;
  72.         SetAtGrow(nIndex, newElement);
  73.         return nIndex; }
  74.  
  75. _AFXCOLL_INLINE WORD CWordArray::operator[](int nIndex) const
  76.     { return GetAt(nIndex); }
  77. _AFXCOLL_INLINE WORD& CWordArray::operator[](int nIndex)
  78.     { return ElementAt(nIndex); }
  79.  
  80.  
  81. ////////////////////////////////////////////////////////////////////////////
  82.  
  83. _AFXCOLL_INLINE int CDWordArray::GetSize() const
  84.     { return m_nSize; }
  85. _AFXCOLL_INLINE int CDWordArray::GetUpperBound() const
  86.     { return m_nSize-1; }
  87. _AFXCOLL_INLINE void CDWordArray::RemoveAll()
  88.     { SetSize(0); }
  89. _AFXCOLL_INLINE DWORD CDWordArray::GetAt(int nIndex) const
  90.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  91.         return m_pData[nIndex]; }
  92. _AFXCOLL_INLINE void CDWordArray::SetAt(int nIndex, DWORD newElement)
  93.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  94.         m_pData[nIndex] = newElement; }
  95.  
  96. _AFXCOLL_INLINE DWORD& CDWordArray::ElementAt(int nIndex)
  97.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  98.         return m_pData[nIndex]; }
  99. _AFXCOLL_INLINE const DWORD* CDWordArray::GetData() const
  100.     { return (const DWORD*)m_pData; }
  101. _AFXCOLL_INLINE DWORD* CDWordArray::GetData()
  102.     { return (DWORD*)m_pData; }
  103. _AFXCOLL_INLINE int CDWordArray::Add(DWORD newElement)
  104.     { int nIndex = m_nSize;
  105.         SetAtGrow(nIndex, newElement);
  106.         return nIndex; }
  107.  
  108. _AFXCOLL_INLINE DWORD CDWordArray::operator[](int nIndex) const
  109.     { return GetAt(nIndex); }
  110. _AFXCOLL_INLINE DWORD& CDWordArray::operator[](int nIndex)
  111.     { return ElementAt(nIndex); }
  112.  
  113.  
  114. ////////////////////////////////////////////////////////////////////////////
  115.  
  116. _AFXCOLL_INLINE int CUIntArray::GetSize() const
  117.     { return m_nSize; }
  118. _AFXCOLL_INLINE int CUIntArray::GetUpperBound() const
  119.     { return m_nSize-1; }
  120. _AFXCOLL_INLINE void CUIntArray::RemoveAll()
  121.     { SetSize(0); }
  122. _AFXCOLL_INLINE UINT CUIntArray::GetAt(int nIndex) const
  123.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  124.         return m_pData[nIndex]; }
  125. _AFXCOLL_INLINE void CUIntArray::SetAt(int nIndex, UINT newElement)
  126.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  127.         m_pData[nIndex] = newElement; }
  128.  
  129. _AFXCOLL_INLINE UINT& CUIntArray::ElementAt(int nIndex)
  130.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  131.         return m_pData[nIndex]; }
  132. _AFXCOLL_INLINE const UINT* CUIntArray::GetData() const
  133.     { return (const UINT*)m_pData; }
  134. _AFXCOLL_INLINE UINT* CUIntArray::GetData()
  135.     { return (UINT*)m_pData; }
  136. _AFXCOLL_INLINE int CUIntArray::Add(UINT newElement)
  137.     { int nIndex = m_nSize;
  138.         SetAtGrow(nIndex, newElement);
  139.         return nIndex; }
  140.  
  141. _AFXCOLL_INLINE UINT CUIntArray::operator[](int nIndex) const
  142.     { return GetAt(nIndex); }
  143. _AFXCOLL_INLINE UINT& CUIntArray::operator[](int nIndex)
  144.     { return ElementAt(nIndex); }
  145.  
  146.  
  147. ////////////////////////////////////////////////////////////////////////////
  148.  
  149. _AFXCOLL_INLINE int CPtrArray::GetSize() const
  150.     { return m_nSize; }
  151. _AFXCOLL_INLINE int CPtrArray::GetUpperBound() const
  152.     { return m_nSize-1; }
  153. _AFXCOLL_INLINE void CPtrArray::RemoveAll()
  154.     { SetSize(0); }
  155. _AFXCOLL_INLINE void* CPtrArray::GetAt(int nIndex) const
  156.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  157.         return m_pData[nIndex]; }
  158. _AFXCOLL_INLINE void CPtrArray::SetAt(int nIndex, void* newElement)
  159.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  160.         m_pData[nIndex] = newElement; }
  161.  
  162. _AFXCOLL_INLINE void*& CPtrArray::ElementAt(int nIndex)
  163.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  164.         return m_pData[nIndex]; }
  165. _AFXCOLL_INLINE const void** CPtrArray::GetData() const
  166.     { return (const void**)m_pData; }
  167. _AFXCOLL_INLINE void** CPtrArray::GetData()
  168.     { return (void**)m_pData; }
  169. _AFXCOLL_INLINE int CPtrArray::Add(void* newElement)
  170.     { int nIndex = m_nSize;
  171.         SetAtGrow(nIndex, newElement);
  172.         return nIndex; }
  173.  
  174. _AFXCOLL_INLINE void* CPtrArray::operator[](int nIndex) const
  175.     { return GetAt(nIndex); }
  176. _AFXCOLL_INLINE void*& CPtrArray::operator[](int nIndex)
  177.     { return ElementAt(nIndex); }
  178.  
  179.  
  180. ////////////////////////////////////////////////////////////////////////////
  181.  
  182. _AFXCOLL_INLINE int CObArray::GetSize() const
  183.     { return m_nSize; }
  184. _AFXCOLL_INLINE int CObArray::GetUpperBound() const
  185.     { return m_nSize-1; }
  186. _AFXCOLL_INLINE void CObArray::RemoveAll()
  187.     { SetSize(0); }
  188. _AFXCOLL_INLINE CObject* CObArray::GetAt(int nIndex) const
  189.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  190.         return m_pData[nIndex]; }
  191. _AFXCOLL_INLINE void CObArray::SetAt(int nIndex, CObject* newElement)
  192.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  193.         m_pData[nIndex] = newElement; }
  194.  
  195. _AFXCOLL_INLINE CObject*& CObArray::ElementAt(int nIndex)
  196.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  197.         return m_pData[nIndex]; }
  198. _AFXCOLL_INLINE const CObject** CObArray::GetData() const
  199.     { return (const CObject**)m_pData; }
  200. _AFXCOLL_INLINE CObject** CObArray::GetData()
  201.     { return (CObject**)m_pData; }
  202. _AFXCOLL_INLINE int CObArray::Add(CObject* newElement)
  203.     { int nIndex = m_nSize;
  204.         SetAtGrow(nIndex, newElement);
  205.         return nIndex; }
  206.  
  207. _AFXCOLL_INLINE CObject* CObArray::operator[](int nIndex) const
  208.     { return GetAt(nIndex); }
  209. _AFXCOLL_INLINE CObject*& CObArray::operator[](int nIndex)
  210.     { return ElementAt(nIndex); }
  211.  
  212.  
  213. ////////////////////////////////////////////////////////////////////////////
  214.  
  215. _AFXCOLL_INLINE int CStringArray::GetSize() const
  216.     { return m_nSize; }
  217. _AFXCOLL_INLINE int CStringArray::GetUpperBound() const
  218.     { return m_nSize-1; }
  219. _AFXCOLL_INLINE void CStringArray::RemoveAll()
  220.     { SetSize(0); }
  221. _AFXCOLL_INLINE CString CStringArray::GetAt(int nIndex) const
  222.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  223.         return m_pData[nIndex]; }
  224. _AFXCOLL_INLINE void CStringArray::SetAt(int nIndex, LPCTSTR newElement)
  225.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  226.         m_pData[nIndex] = newElement; }
  227.  
  228. _AFXCOLL_INLINE void CStringArray::SetAt(int nIndex, const CString& newElement)
  229.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  230.         m_pData[nIndex] = newElement; }
  231.  
  232. _AFXCOLL_INLINE CString& CStringArray::ElementAt(int nIndex)
  233.     { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  234.         return m_pData[nIndex]; }
  235. _AFXCOLL_INLINE const CString* CStringArray::GetData() const
  236.     { return (const CString*)m_pData; }
  237. _AFXCOLL_INLINE CString* CStringArray::GetData()
  238.     { return (CString*)m_pData; }
  239. _AFXCOLL_INLINE int CStringArray::Add(LPCTSTR newElement)
  240.     { int nIndex = m_nSize;
  241.         SetAtGrow(nIndex, newElement);
  242.         return nIndex; }
  243.  
  244. _AFXCOLL_INLINE int CStringArray::Add(const CString& newElement)
  245.     { int nIndex = m_nSize;
  246.         SetAtGrow(nIndex, newElement);
  247.         return nIndex; }
  248.  
  249. _AFXCOLL_INLINE CString CStringArray::operator[](int nIndex) const
  250.     { return GetAt(nIndex); }
  251. _AFXCOLL_INLINE CString& CStringArray::operator[](int nIndex)
  252.     { return ElementAt(nIndex); }
  253.  
  254.  
  255. ////////////////////////////////////////////////////////////////////////////
  256.  
  257. _AFXCOLL_INLINE int CPtrList::GetCount() const
  258.     { return m_nCount; }
  259. _AFXCOLL_INLINE BOOL CPtrList::IsEmpty() const
  260.     { return m_nCount == 0; }
  261. _AFXCOLL_INLINE void*& CPtrList::GetHead()
  262.     { ASSERT(m_pNodeHead != NULL);
  263.         return m_pNodeHead->data; }
  264. _AFXCOLL_INLINE void* CPtrList::GetHead() const
  265.     { ASSERT(m_pNodeHead != NULL);
  266.         return m_pNodeHead->data; }
  267. _AFXCOLL_INLINE void*& CPtrList::GetTail()
  268.     { ASSERT(m_pNodeTail != NULL);
  269.         return m_pNodeTail->data; }
  270. _AFXCOLL_INLINE void* CPtrList::GetTail() const
  271.     { ASSERT(m_pNodeTail != NULL);
  272.         return m_pNodeTail->data; }
  273. _AFXCOLL_INLINE POSITION CPtrList::GetHeadPosition() const
  274.     { return (POSITION) m_pNodeHead; }
  275. _AFXCOLL_INLINE POSITION CPtrList::GetTailPosition() const
  276.     { return (POSITION) m_pNodeTail; }
  277. _AFXCOLL_INLINE void*& CPtrList::GetNext(POSITION& rPosition) // return *Position++
  278.     { CNode* pNode = (CNode*) rPosition;
  279.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  280.         rPosition = (POSITION) pNode->pNext;
  281.         return pNode->data; }
  282. _AFXCOLL_INLINE void* CPtrList::GetNext(POSITION& rPosition) const // return *Position++
  283.     { CNode* pNode = (CNode*) rPosition;
  284.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  285.         rPosition = (POSITION) pNode->pNext;
  286.         return pNode->data; }
  287. _AFXCOLL_INLINE void*& CPtrList::GetPrev(POSITION& rPosition) // return *Position--
  288.     { CNode* pNode = (CNode*) rPosition;
  289.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  290.         rPosition = (POSITION) pNode->pPrev;
  291.         return pNode->data; }
  292. _AFXCOLL_INLINE void* CPtrList::GetPrev(POSITION& rPosition) const // return *Position--
  293.     { CNode* pNode = (CNode*) rPosition;
  294.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  295.         rPosition = (POSITION) pNode->pPrev;
  296.         return pNode->data; }
  297. _AFXCOLL_INLINE void*& CPtrList::GetAt(POSITION position)
  298.     { CNode* pNode = (CNode*) position;
  299.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  300.         return pNode->data; }
  301. _AFXCOLL_INLINE void* CPtrList::GetAt(POSITION position) const
  302.     { CNode* pNode = (CNode*) position;
  303.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  304.         return pNode->data; }
  305. _AFXCOLL_INLINE void CPtrList::SetAt(POSITION pos, void* newElement)
  306.     { CNode* pNode = (CNode*) pos;
  307.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  308.         pNode->data = newElement; }
  309.  
  310.  
  311.  
  312. ////////////////////////////////////////////////////////////////////////////
  313.  
  314. _AFXCOLL_INLINE int CObList::GetCount() const
  315.     { return m_nCount; }
  316. _AFXCOLL_INLINE BOOL CObList::IsEmpty() const
  317.     { return m_nCount == 0; }
  318. _AFXCOLL_INLINE CObject*& CObList::GetHead()
  319.     { ASSERT(m_pNodeHead != NULL);
  320.         return m_pNodeHead->data; }
  321. _AFXCOLL_INLINE CObject* CObList::GetHead() const
  322.     { ASSERT(m_pNodeHead != NULL);
  323.         return m_pNodeHead->data; }
  324. _AFXCOLL_INLINE CObject*& CObList::GetTail()
  325.     { ASSERT(m_pNodeTail != NULL);
  326.         return m_pNodeTail->data; }
  327. _AFXCOLL_INLINE CObject* CObList::GetTail() const
  328.     { ASSERT(m_pNodeTail != NULL);
  329.         return m_pNodeTail->data; }
  330. _AFXCOLL_INLINE POSITION CObList::GetHeadPosition() const
  331.     { return (POSITION) m_pNodeHead; }
  332. _AFXCOLL_INLINE POSITION CObList::GetTailPosition() const
  333.     { return (POSITION) m_pNodeTail; }
  334. _AFXCOLL_INLINE CObject*& CObList::GetNext(POSITION& rPosition) // return *Position++
  335.     { CNode* pNode = (CNode*) rPosition;
  336.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  337.         rPosition = (POSITION) pNode->pNext;
  338.         return pNode->data; }
  339. _AFXCOLL_INLINE CObject* CObList::GetNext(POSITION& rPosition) const // return *Position++
  340.     { CNode* pNode = (CNode*) rPosition;
  341.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  342.         rPosition = (POSITION) pNode->pNext;
  343.         return pNode->data; }
  344. _AFXCOLL_INLINE CObject*& CObList::GetPrev(POSITION& rPosition) // return *Position--
  345.     { CNode* pNode = (CNode*) rPosition;
  346.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  347.         rPosition = (POSITION) pNode->pPrev;
  348.         return pNode->data; }
  349. _AFXCOLL_INLINE CObject* CObList::GetPrev(POSITION& rPosition) const // return *Position--
  350.     { CNode* pNode = (CNode*) rPosition;
  351.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  352.         rPosition = (POSITION) pNode->pPrev;
  353.         return pNode->data; }
  354. _AFXCOLL_INLINE CObject*& CObList::GetAt(POSITION position)
  355.     { CNode* pNode = (CNode*) position;
  356.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  357.         return pNode->data; }
  358. _AFXCOLL_INLINE CObject* CObList::GetAt(POSITION position) const
  359.     { CNode* pNode = (CNode*) position;
  360.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  361.         return pNode->data; }
  362. _AFXCOLL_INLINE void CObList::SetAt(POSITION pos, CObject* newElement)
  363.     { CNode* pNode = (CNode*) pos;
  364.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  365.         pNode->data = newElement; }
  366.  
  367.  
  368.  
  369. ////////////////////////////////////////////////////////////////////////////
  370.  
  371. _AFXCOLL_INLINE int CStringList::GetCount() const
  372.     { return m_nCount; }
  373. _AFXCOLL_INLINE BOOL CStringList::IsEmpty() const
  374.     { return m_nCount == 0; }
  375. _AFXCOLL_INLINE CString& CStringList::GetHead()
  376.     { ASSERT(m_pNodeHead != NULL);
  377.         return m_pNodeHead->data; }
  378. _AFXCOLL_INLINE CString CStringList::GetHead() const
  379.     { ASSERT(m_pNodeHead != NULL);
  380.         return m_pNodeHead->data; }
  381. _AFXCOLL_INLINE CString& CStringList::GetTail()
  382.     { ASSERT(m_pNodeTail != NULL);
  383.         return m_pNodeTail->data; }
  384. _AFXCOLL_INLINE CString CStringList::GetTail() const
  385.     { ASSERT(m_pNodeTail != NULL);
  386.         return m_pNodeTail->data; }
  387. _AFXCOLL_INLINE POSITION CStringList::GetHeadPosition() const
  388.     { return (POSITION) m_pNodeHead; }
  389. _AFXCOLL_INLINE POSITION CStringList::GetTailPosition() const
  390.     { return (POSITION) m_pNodeTail; }
  391. _AFXCOLL_INLINE CString& CStringList::GetNext(POSITION& rPosition) // return *Position++
  392.     { CNode* pNode = (CNode*) rPosition;
  393.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  394.         rPosition = (POSITION) pNode->pNext;
  395.         return pNode->data; }
  396. _AFXCOLL_INLINE CString CStringList::GetNext(POSITION& rPosition) const // return *Position++
  397.     { CNode* pNode = (CNode*) rPosition;
  398.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  399.         rPosition = (POSITION) pNode->pNext;
  400.         return pNode->data; }
  401. _AFXCOLL_INLINE CString& CStringList::GetPrev(POSITION& rPosition) // return *Position--
  402.     { CNode* pNode = (CNode*) rPosition;
  403.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  404.         rPosition = (POSITION) pNode->pPrev;
  405.         return pNode->data; }
  406. _AFXCOLL_INLINE CString CStringList::GetPrev(POSITION& rPosition) const // return *Position--
  407.     { CNode* pNode = (CNode*) rPosition;
  408.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  409.         rPosition = (POSITION) pNode->pPrev;
  410.         return pNode->data; }
  411. _AFXCOLL_INLINE CString& CStringList::GetAt(POSITION position)
  412.     { CNode* pNode = (CNode*) position;
  413.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  414.         return pNode->data; }
  415. _AFXCOLL_INLINE CString CStringList::GetAt(POSITION position) const
  416.     { CNode* pNode = (CNode*) position;
  417.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  418.         return pNode->data; }
  419. _AFXCOLL_INLINE void CStringList::SetAt(POSITION pos, LPCTSTR newElement)
  420.     { CNode* pNode = (CNode*) pos;
  421.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  422.         pNode->data = newElement; }
  423.  
  424. _AFXCOLL_INLINE void CStringList::SetAt(POSITION pos, const CString& newElement)
  425.     { CNode* pNode = (CNode*) pos;
  426.         ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  427.         pNode->data = newElement; }
  428.  
  429.  
  430.  
  431. ////////////////////////////////////////////////////////////////////////////
  432.  
  433. _AFXCOLL_INLINE int CMapWordToPtr::GetCount() const
  434.     { return m_nCount; }
  435. _AFXCOLL_INLINE BOOL CMapWordToPtr::IsEmpty() const
  436.     { return m_nCount == 0; }
  437. _AFXCOLL_INLINE void CMapWordToPtr::SetAt(WORD key, void* newValue)
  438.     { (*this)[key] = newValue; }
  439. _AFXCOLL_INLINE POSITION CMapWordToPtr::GetStartPosition() const
  440.     { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; }
  441. _AFXCOLL_INLINE UINT CMapWordToPtr::GetHashTableSize() const
  442.     { return m_nHashTableSize; }
  443.  
  444.  
  445. ////////////////////////////////////////////////////////////////////////////
  446.  
  447. _AFXCOLL_INLINE int CMapPtrToWord::GetCount() const
  448.     { return m_nCount; }
  449. _AFXCOLL_INLINE BOOL CMapPtrToWord::IsEmpty() const
  450.     { return m_nCount == 0; }
  451. _AFXCOLL_INLINE void CMapPtrToWord::SetAt(void* key, WORD newValue)
  452.     { (*this)[key] = newValue; }
  453. _AFXCOLL_INLINE POSITION CMapPtrToWord::GetStartPosition() const
  454.     { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; }
  455. _AFXCOLL_INLINE UINT CMapPtrToWord::GetHashTableSize() const
  456.     { return m_nHashTableSize; }
  457.  
  458.  
  459. ////////////////////////////////////////////////////////////////////////////
  460.  
  461. _AFXCOLL_INLINE int CMapPtrToPtr::GetCount() const
  462.     { return m_nCount; }
  463. _AFXCOLL_INLINE BOOL CMapPtrToPtr::IsEmpty() const
  464.     { return m_nCount == 0; }
  465. _AFXCOLL_INLINE void CMapPtrToPtr::SetAt(void* key, void* newValue)
  466.     { (*this)[key] = newValue; }
  467. _AFXCOLL_INLINE POSITION CMapPtrToPtr::GetStartPosition() const
  468.     { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; }
  469. _AFXCOLL_INLINE UINT CMapPtrToPtr::GetHashTableSize() const
  470.     { return m_nHashTableSize; }
  471.  
  472.  
  473. ////////////////////////////////////////////////////////////////////////////
  474.  
  475. _AFXCOLL_INLINE int CMapWordToOb::GetCount() const
  476.     { return m_nCount; }
  477. _AFXCOLL_INLINE BOOL CMapWordToOb::IsEmpty() const
  478.     { return m_nCount == 0; }
  479. _AFXCOLL_INLINE void CMapWordToOb::SetAt(WORD key, CObject* newValue)
  480.     { (*this)[key] = newValue; }
  481. _AFXCOLL_INLINE POSITION CMapWordToOb::GetStartPosition() const
  482.     { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; }
  483. _AFXCOLL_INLINE UINT CMapWordToOb::GetHashTableSize() const
  484.     { return m_nHashTableSize; }
  485.  
  486.  
  487. ////////////////////////////////////////////////////////////////////////////
  488. _AFXCOLL_INLINE int CMapStringToPtr::GetCount() const
  489.     { return m_nCount; }
  490. _AFXCOLL_INLINE BOOL CMapStringToPtr::IsEmpty() const
  491.     { return m_nCount == 0; }
  492. _AFXCOLL_INLINE void CMapStringToPtr::SetAt(LPCTSTR key, void* newValue)
  493.     { (*this)[key] = newValue; }
  494. _AFXCOLL_INLINE POSITION CMapStringToPtr::GetStartPosition() const
  495.     { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; }
  496. _AFXCOLL_INLINE UINT CMapStringToPtr::GetHashTableSize() const
  497.     { return m_nHashTableSize; }
  498.  
  499.  
  500. ////////////////////////////////////////////////////////////////////////////
  501. _AFXCOLL_INLINE int CMapStringToOb::GetCount() const
  502.     { return m_nCount; }
  503. _AFXCOLL_INLINE BOOL CMapStringToOb::IsEmpty() const
  504.     { return m_nCount == 0; }
  505. _AFXCOLL_INLINE void CMapStringToOb::SetAt(LPCTSTR key, CObject* newValue)
  506.     { (*this)[key] = newValue; }
  507. _AFXCOLL_INLINE POSITION CMapStringToOb::GetStartPosition() const
  508.     { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; }
  509. _AFXCOLL_INLINE UINT CMapStringToOb::GetHashTableSize() const
  510.     { return m_nHashTableSize; }
  511.  
  512.  
  513. ////////////////////////////////////////////////////////////////////////////
  514. _AFXCOLL_INLINE int CMapStringToString::GetCount() const
  515.     { return m_nCount; }
  516. _AFXCOLL_INLINE BOOL CMapStringToString::IsEmpty() const
  517.     { return m_nCount == 0; }
  518. _AFXCOLL_INLINE void CMapStringToString::SetAt(LPCTSTR key, LPCTSTR newValue)
  519.     { (*this)[key] = newValue; }
  520. _AFXCOLL_INLINE POSITION CMapStringToString::GetStartPosition() const
  521.     { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; }
  522. _AFXCOLL_INLINE UINT CMapStringToString::GetHashTableSize() const
  523.     { return m_nHashTableSize; }
  524.  
  525. /////////////////////////////////////////////////////////////////////////////
  526.  
  527. #endif //_AFXCOLL_INLINE
  528.