In file classadItor.h:

class ClassAdIterator

An object for iterating over the attributes of a ClassAd

Public Methods

ClassAdIterator(const ClassAd &ca)
Constructor which initializes the iterator to the given ClassAd
ClassAdIterator()
Constructor
bool CurrentAttribute( string& attr, const ExprTree*& expr )
Gets the attribute currently referred to by the iterator
inline void Initialize(const ClassAd &ca)
Initializes the object to iterate over a ClassAd; the iterator begins at the "before first" position
inline bool IsAfterLast()
Predicate to check the position of the iterator
inline bool IsAtFirst()
Predicate to check the position of the iterator
bool NextAttribute( string& attr, const ExprTree*& expr )
Gets the next attribute in the ClassAd
inline void ToAfterLast()
Positions the iterator to the "after last" position
inline void ToFirst()
Positions the iterator to the "before first" position.
~ClassAdIterator()
Destructor

Documentation

An object for iterating over the attributes of a ClassAd. Several iterators may be active over the same ClassAd at any time, and the same iterator object may be used to iterate over other ClassAds as well. Note that attributes will not be provided in any specific order. Also, ClassAdIterator is a ``forward iterator'' only; i.e., there is no PreviousAttribute() method.
ClassAdIterator(const ClassAd &ca)
Constructor which initializes the iterator to the given ClassAd
Parameters:
ca - The ClassAd to iterate over.
See Also:
initialize

inline void Initialize(const ClassAd &ca)
Initializes the object to iterate over a ClassAd; the iterator begins at the "before first" position. This method must be called before the iterator is usable. (The iteration methods return false if the iterator has not been initialized.) This method may be called any number of times, with different ClassAds as arguments.
Parameters:
l - The expression list to iterate over (i.e., the iteratee).

bool NextAttribute( string& attr, const ExprTree*& expr )
Gets the next attribute in the ClassAd
Returns:
false if the iterator has crossed the last attribute in the ClassAd, or true otherwise.
Parameters:
attr - The name of the next attribute in the ClassAd.
expr - The expression of the next attribute in the ClassAd.

bool CurrentAttribute( string& attr, const ExprTree*& expr )
Gets the attribute currently referred to by the iterator
Returns:
false if the operation failed, true otherwise.
Parameters:
attr - The name of the next attribute in the ClassAd.
expr - The expression of the next attribute in the ClassAd.

inline bool IsAtFirst()
Predicate to check the position of the iterator
Returns:
true iff the iterator is before the first element.

inline bool IsAfterLast()
Predicate to check the position of the iterator
Returns:
true iff the iterator is after the last element.


This class has no child classes.

alphabetic index hierarchy of classes


Condor Home Page

generated by doc++