/*
** SellaNMS
** $Id: format_statement_from_group.h,v 1.7 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 __FORMAT_STATEMENT_FROM_GROUP_H__
#define __FORMAT_STATEMENT_FROM_GROUP_H__

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

#include "format_statement_from_variable.h"

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

class FormatStatementFromGroup: public FormatStatementFromVariable {
	public:
		virtual ACTION evaluate(variable_binding_t &input);		
		virtual RESULT compile(ConfigNode *config);

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

		RESULT setVariableType(unsigned long &type, string &variable);
		RESULT setVariableFunction(unsigned long &function, string &variable);
		RESULT setVariableMap(slist<string> &mapStatements, string &variable);

	protected:
		RESULT addGroup(FormatStatementFromGroup &group);
		RESULT addVariable(FormatStatementFromVariable &variable);
		
		slist<FormatStatementFromGroup>               	groups;
		hash_map<string, FormatStatementFromVariable> 	variables;
};

#endif

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