Listing 1: MultiFor.h Definition of the CMultiFor Class


class CMultiFor
{
public:
    CMultiFor() {};
    ~CMultiFor() {};

    // add a for loop
    void Add( int start, int end );

    // looping constucts
    void Initialize();
    BOOL CarryOn();
    void Increment();

    // information
    int Count() {return m_start.GetSize();};
    int Index( int i );

// data
private:
    CArray<int, int&>    m_start;
    CArray<int, int&>    m_end;
    CArray<int, int&>    m_current;
};

// End of File