afxcoll.inl 20 KB

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