Using CLists in c++ -Could not understand
I searched for a sample program to work on with the CList.But i could not find it.I got some basic definitions about the CLists(template class that behaves similar to the doubly linked lists).. and is used to store the aggregate data..The 1st argument is stored internally by the list..I could not see what elements are stored in the list and how to retrieve it.
RsData Data; //object of class RsData
RsEvent* Event;//pointer to class RsEvent
CList<Event*,Event*> Event开发者_高级运维Queue;
Data.EventQueue.RemoveAll();
//removing the attributes and methods of the class RsEvent stored in the list.
So the doc is CList on MSDN
And there is a link there for the COLLECT Sample: Illustrates MFC Collection Classes
I'm not sure how this doc was not found, so perhaps your question needs to be clarrified.
The list offers front/back inserting and looking, aswell as methods for iterating.
// Define myList.
CList<CString,CString&> myList;
// Add an element to the front of the list.
myList.AddHead(CString("ABC"));
// Verify the element was added to the front of the list.
ASSERT(CString("ABC") == myList.GetHead());
精彩评论