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

File: [Pegasus] / pegasus / doc / Attic / iterator_example.txt (download)
Revision: 1.1, Fri Mar 23 21:27:05 2001 UTC (23 years, 2 months ago) by mike
Branch: MAIN
CVS Tags: version_1_01, version_0_99_1, version_0_99, version_0_97_3, version_0_97_2, version_0_97_1, version_0_97, version_0_96, version_0_95, version_0_79_4, test, stable_0_95, stable, pep_88, pegasus25BeforeLicenseUpdate, merge_of_dev, mday-merge-start, mday-merge-pegasus/src/Pegasus/Server, mday-merge-pegasus/src/Pegasus/Common, mday-2-0-patches, main, local, dev_dead, dev, VERSION_2_1_RELEASE_HEAD, VERSION_2_1_RELEASE_BRANCH, VERSION_2_1_RELEASE, VERSION_2_1_1_RELEASE, VERSION_2_01_01, VERSION_2_00_RC_4, VERSION_2_00_RC_3, VERSION_2_00_RC_2, VERSION_2_00_RC_1, VERSION_2_00_BRANCH, VERSION_1_10, VERSION_1_09, VERSION_1_08, VERSION_1_07, TEST, STABLE, SNAPSHOT_1_04, SLPPERFINST-root, SLPPERFINST-branch, RELEASE_2_5_0-RC1, RELEASE_2_5_0, RELEASE_2_4_FC_CANDIDATE_1, RELEASE_2_4_3, RELEASE_2_4_2, RELEASE_2_4_1-BETA3, RELEASE_2_4_1-BETA2, RELEASE_2_4_1-BETA1, RELEASE_2_4_1, RELEASE_2_4_0-RC3, RELEASE_2_4_0-RC2, RELEASE_2_4_0, RELEASE_2_4-root, RELEASE_2_4-branch, RELEASE_2_3_2-testfreeze, RELEASE_2_3_2-root, RELEASE_2_3_2-releasesnapshot, RELEASE_2_3_2-branch-freeze, RELEASE_2_3_2-branch, RELEASE_2_3_1-root, RELEASE_2_3_1-branch, RELEASE_2_3_0-root, RELEASE_2_3_0-msg-freeze, RELEASE_2_3_0-branch, RELEASE_2_2_1-snapshot, RELEASE_2_2_0_0-release, RELEASE_2_2_0-root, RELEASE_2_2_0-branch, RELEASE_2_2-root, PRE_LICENSE_UPDATE_2003, POST_LICENSE_UPDATE_2003, PEP244_ServerProfile-root, PEP244_ServerProfile-branch, PEP233_EmbeddedInstSupport-root, PEP233_EmbeddedInstSupport-branch, PEP217_PRE_BRANCH, PEP217_POST_BRANCH, PEP217_BRANCH, PEP214ROOT, PEP214BRANCH, PEP214-root, PEP214-branch, PEP213_SIZE_OPTIMIZATIONS, PEP-214B-root, PEGASUS_FC_VERSION_2_2, PEGASUS_2_5_0_PerformanceDev-string-end, PEGASUS_2_5_0_PerformanceDev-rootlt, PEGASUS_2_5_0_PerformanceDev-root, PEGASUS_2_5_0_PerformanceDev-r2, PEGASUS_2_5_0_PerformanceDev-r1, PEGASUS_2_5_0_PerformanceDev-lit-end, PEGASUS_2_5_0_PerformanceDev-buffer-end, PEGASUS_2_5_0_PerformanceDev-branch, PEGASUS_2_5_0_PerformanceDev-AtomicInt-branch, PEG25_IBM_5_16_05, NPEGASUS_2_5_0_PerformanceDev-String-root, NNPEGASUS_2_5_0_PerformanceDev-String-branch, MONITOR_CONSOLIDATION_2_5_BRANCH, LOCAL_ASSOCPROV-ROOT, LOCAL_ASSOCPROV-BRANCH, IBM_241_April1405, CQL_2_5_BRANCH, CHUNKTESTDONE_PEP140, BUG_4225_PERFORMANCE_VERSION_1_DONE
Refined TODO list

			  Iterator "Study"


    -------------------------------------------------------------------------
    Prsent Scheme
    -------------------------------------------------------------------------

    CIMClass c;

    for (Uint32 i = 0; i < c.getNuProperties(); i++)
    {
	CIMProperty p = c.getProperty(i);
    }

    -------------------------------------------------------------------------
    Scheme #1 (dependent iterator)
    -------------------------------------------------------------------------

    CIMClass c;

    for (CIMProperty::Iterator i = c.firstProperty(); c.more(i); c.next(i))
    {
	CIMProperty p = i.current(i);
    }

    -------------------------------------------------------------------------
    Scheme #2 (independent iterator)
    -------------------------------------------------------------------------

    CIMClass c;

    for (CIMClass::Iterator i = c.getProperties(); i.more(); i.next())
    {
	Property p = i.current();
    }

    -------------------------------------------------------------------------
    Scheme #3 (independent iterator with operator overloading trickery)
    -------------------------------------------------------------------------

    CIMClass c;

    for (CIMClass::Iterator i = c.getProperties(); i; i++)
    {
	Property p = *i;
    }


No CVS admin address has been configured
Powered by
ViewCVS 0.9.2