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

#ifndef POLYGRAPH__PGL_PGLCONTAINERSYM_H
#define POLYGRAPH__PGL_PGLCONTAINERSYM_H

#include "pgl/PglExprSym.h"

class StringArray;

// one expression can represent more than one SynSym,
// with optional per-item probabilities
class ContainerSym: public ExpressionSym {
	public:
		static String TheType;

	public:
		ContainerSym(const String &aType): ExpressionSym(aType) {}

		virtual int count() const = 0;
		virtual bool probsSet() const = 0;

		// offset must be between 0 and count-1
		virtual const SynSym *itemProb(int offset, double &prob) const = 0;

		const SynSym *operator[](int offset) const { return item(offset); }
		const SynSym *item(int offset) const;
		//double prob(int offset) const;

		virtual bool isA(const String &type) const;

		virtual void toStringArray(StringArray &strs) const = 0;

		virtual ExpressionSym *bnOper(const Oper &op, const SynSym &exp) const;
};

#endif


syntax highlighted by Code2HTML, v. 0.9.1