开发者

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());
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜