Main Page | Class Hierarchy | Class List | File List | Class Members

ClassAdIterator Class Reference

An object for iterating over the attributes of a ClassAd--deprecated. More...

#include <classadItor.h>

Collaboration diagram for ClassAdIterator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ClassAdIterator ()
 Constructor.

 ClassAdIterator (const ClassAd &ca)
 Constructor which initializes the iterator to the given ClassAd.

 ~ClassAdIterator ()
 Destructor.

void Initialize (const ClassAd &ca)
 Initializes the object to iterate over a ClassAd; the iterator begins at the "before first" position.

void ToFirst ()
 Positions the iterator to the "before first" position.

void ToAfterLast ()
 Positions the iterator to the "after last" position.

bool NextAttribute (std::string &attr, const ExprTree *&expr)
 Gets the next attribute in the ClassAd.

bool CurrentAttribute (std::string &attr, const ExprTree *&expr) const
 Gets the attribute currently referred to by the iterator.

bool IsAtFirst () const
 Predicate to check the position of the iterator.

bool IsAfterLast () const
 Predicate to check the position of the iterator.


Detailed Description

An object for iterating over the attributes of a ClassAd--deprecated.

We recommend that you now use the STL-like iterators defined with 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.


Constructor & Destructor Documentation

ClassAdIterator::ClassAdIterator const ClassAd ca  )  [inline]
 

Constructor which initializes the iterator to the given ClassAd.

Parameters:
ca The ClassAd to iterate over.
See also:
initialize


Member Function Documentation

bool ClassAdIterator::CurrentAttribute std::string &  attr,
const ExprTree *&  expr
const
 

Gets the attribute currently referred to by the iterator.

Parameters:
attr The name of the next attribute in the ClassAd.
expr The expression of the next attribute in the ClassAd.
Returns:
false if the operation failed, true otherwise.

void ClassAdIterator::Initialize const ClassAd ca  )  [inline]
 

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:
ca The ClassAd to iterate over (i.e., the iteratee).

bool ClassAdIterator::IsAfterLast  )  const [inline]
 

Predicate to check the position of the iterator.

Returns:
true iff the iterator is after the last element.

bool ClassAdIterator::IsAtFirst  )  const [inline]
 

Predicate to check the position of the iterator.

Returns:
true iff the iterator is before the first element.

bool ClassAdIterator::NextAttribute std::string &  attr,
const ExprTree *&  expr
 

Gets the next attribute in the ClassAd.

Parameters:
attr The name of the next attribute in the ClassAd.
expr The expression of the next attribute in the ClassAd.
Returns:
false if the iterator has crossed the last attribute in the ClassAd, or true otherwise.


The documentation for this class was generated from the following file: