windows-nt/Source/XPSP1/NT/base/efiutil/efilib/inc/arrayit.hxx
2020-09-26 16:20:57 +08:00

122 lines
1.7 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*++
Copyright (c) 1990 Microsoft Corporation
Module Name:
arrayit.hxx
Abstract:
This module contains the declaration for the ARRAY_ITERATOR class.
ARRAY_ITERATOR is a concrete implementation derived from the abstarct
ITERATOR class. It is used to 'read' (iterate) over an ARRAY object.
It has no public constructor and therefore can only be queried from an
ARRAY object. It is the client's responsibility to detsroy
ARRAY_ITERATORs when they are done. ARRAY_ITERATORs maintain the currency
for reading an ARRAY in order.
Environment:
ULIB, User Mode
--*/
#if ! defined( _ARRAY_ITERATOR_ )
#define _ARRAY_ITERATOR_
#include "iterator.hxx"
//
// Forward references
//
DECLARE_CLASS( ARRAY );
DECLARE_CLASS( ARRAY_ITERATOR );
class ARRAY_ITERATOR : public ITERATOR {
friend ARRAY;
public:
VIRTUAL
~ARRAY_ITERATOR(
);
VIRTUAL
VOID
Reset(
);
VIRTUAL
POBJECT
GetCurrent(
);
VIRTUAL
POBJECT
GetNext(
);
VIRTUAL
POBJECT
GetPrevious(
);
NONVIRTUAL
ULONG
QueryCurrentIndex(
);
protected:
DECLARE_CAST_MEMBER_FUNCTION( ARRAY_ITERATOR );
DECLARE_CONSTRUCTOR( ARRAY_ITERATOR );
NONVIRTUAL
BOOLEAN
Initialize(
IN OUT PARRAY Array
);
NONVIRTUAL
VOID
Construct(
);
private:
PARRAY _Array; // Array
ULONG _CurrentIndex; // Current index
};
INLINE
ULONG
ARRAY_ITERATOR::QueryCurrentIndex(
)
/*++
Routine Description:
Obtains the current index
Arguments:
None
Return Value:
ULONG - The current index
--*/
{
return _CurrentIndex;
}
#endif // _ARRAY_ITERATOR_