/*
** SellaNMS
** $Id: policy_statement_from.h,v 1.5 2006/01/24 07:08:09 sella Exp $
** Copyright (c) 2001-2005 Digital Genesis Software, LLC. All Rights Reserved.
** Released under the GPL Version 2 License.
** http://www.digitalgenesis.com
*/

#ifndef __POLICY_STATEMENT_FROM_H__
#define __POLICY_STATEMENT_FROM_H__

#ifdef HAVE_CONFIG_H
	#include "config.h"
#endif

#include "from.h"
#include "policy_statement_from_variable.h"
#include "format_statement.h"

#include <stl/slist>

class PolicyStatementFrom: public From {
	public:
		PolicyStatementFrom();
		PolicyStatementFrom(From const &src);
		PolicyStatementFrom(PolicyStatementFrom const &src);
		virtual ~PolicyStatementFrom();

		RESULT getReferencedVariables(slist<variable_t> &referenced);

		RESULT setCompiledStatements(hash_map<string, PolicyStatement> *policies, hash_map<string, MapStatement> *maps);
		RESULT getAppliedMapStatements(slist<string> &map_names);

		virtual From const& operator=(From const &src);
		virtual PolicyStatementFrom const& operator=(PolicyStatementFrom const &src);

		virtual RESULT compile(ConfigNode *config);
		virtual ACTION evaluate(variable_binding_t &input);

		virtual RESULT clear();
		virtual RESULT print(unsigned long depth = 0);

		RESULT applyFormatStatement(FormatStatement &format);

	private:
		slist<PolicyStatementFromVariable>	variables;
};

#endif

/*
** Local Variables:
** c-basic-offset: 3
** tab-width: 3
** End:
** vim:
** vim: noet ts=3 sw=3 sts=3
*/
