/*
** SellaNMS
** $Id: policy_statement.h,v 1.5 2005/05/21 23:10:28 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_H__
#define __POLICY_STATEMENT_H__

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

#include "statement.h"
#include "map_statement.h"
#include "format_statement.h"
#include "policy_statement_term.h"

#include <stl/string>
#include <stl/slist>

class PolicyStatement: public Statement {
	public:
		PolicyStatement();
		PolicyStatement(Statement const &src);
		PolicyStatement(PolicyStatement const &src);
		virtual ~PolicyStatement();
		virtual Statement const& operator=(Statement const &src);
		virtual PolicyStatement const& operator=(PolicyStatement const &src);

		RESULT getAppliedFormatStatement(string &format_names);
		RESULT getAppliedMapStatements(slist<string> &map_names);
		RESULT getReferencedVariables(variable_reference_t &referenced);

		RESULT applyFormatStatement(FormatStatement &format);

		RESULT setCompiledStatements(hash_map<string, PolicyStatement> *policies, hash_map<string, MapStatement> *maps);

		virtual RESULT compile(ConfigNode *config);

		virtual RESULT clear();

		/* For testing.. */
		RESULT print(unsigned long depth = 0);
	protected:
		virtual Term *getNewStatementTerm() const;

	private:
		string						appliedFormatStatement;
};

#endif

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