/* Web Polygraph       http://www.web-polygraph.org/
 * (C) 2003-2006 The Measurement Factory
 * Licensed under the Apache License, Version 2.0 */

#ifndef POLYGRAPH__PGL_AGENTARRITER_H
#define POLYGRAPH__PGL_AGENTARRITER_H

#include "pgl/HostsBasedIter.h"

class AgentSym;

// agent array iterator, based on HostsBasedIter
class AgentArrIter: public HostsBasedIter {
	public:
		typedef Array<AgentSym*> CfgSyms;

	public:
		AgentArrIter(CfgSyms &aCfgSyms, const Addrs *aLocalAddrs, const String &anAgentType);

		void includeProxySides(bool doIt);

		AgentSym *agentSym();
		virtual int cfgCount() const;

	protected:
		virtual bool belongs(const HostsBasedSym *cfgSym, const NetAddr &host) const;
		HostsBasedSym *cfgSym(int idx) const;

	protected:
		CfgSyms theCfgs;
		String theAgentType;  // iterate through agents of this type
		bool doIncludeProxySides; // include the corresponding proxy side
};

#endif


syntax highlighted by Code2HTML, v. 0.9.1