(file) Return to iterator_example.txt CVS log (file) (dir) Up to [Pegasus] / pegasus / doc

 1 mike  1.1 			  Iterator "Study"
 2           
 3           
 4               -------------------------------------------------------------------------
 5               Prsent Scheme
 6               -------------------------------------------------------------------------
 7           
 8               CIMClass c;
 9           
10               for (Uint32 i = 0; i < c.getNuProperties(); i++)
11               {
12           	CIMProperty p = c.getProperty(i);
13               }
14           
15               -------------------------------------------------------------------------
16               Scheme #1 (dependent iterator)
17               -------------------------------------------------------------------------
18           
19               CIMClass c;
20           
21               for (CIMProperty::Iterator i = c.firstProperty(); c.more(i); c.next(i))
22 mike  1.1     {
23           	CIMProperty p = i.current(i);
24               }
25           
26               -------------------------------------------------------------------------
27               Scheme #2 (independent iterator)
28               -------------------------------------------------------------------------
29           
30               CIMClass c;
31           
32               for (CIMClass::Iterator i = c.getProperties(); i.more(); i.next())
33               {
34           	Property p = i.current();
35               }
36           
37               -------------------------------------------------------------------------
38               Scheme #3 (independent iterator with operator overloading trickery)
39               -------------------------------------------------------------------------
40           
41               CIMClass c;
42           
43 mike  1.1     for (CIMClass::Iterator i = c.getProperties(); i; i++)
44               {
45           	Property p = *i;
46               }
47           

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2