#ifndef SYMFUNC_H
#define SYMFUNC_H
#include "behavioral.h"
namespace hub {
	// ----------------------------------------------------------------------
	//	combinational fully symmetric functions with one output
	// ----------------------------------------------------------------------
	class SymFunc: public BehavDescr {
	public: 
		typedef enum { 
				fT0, fT1,								// no inputs
				fBuf, fInv,								// one input
				fAnd, fXor, fOr, fNor, fXnor, fNand,	// two and more inputs
				fNull									// unknown/invalid
		} Func;
		
		SymFunc (Func f, unsigned int inp): inpNo_(inp), func_(f)  {}
		SymFunc (void): inpNo_ (0), func_(fNull) {}

		unsigned int inpNo (void) const { return inpNo_; }
		void inpNo (unsigned int inp) { inpNo_=inp; }
		Func func (void) const { return func_; }
		void func (Func f) { func_=f; }

		virtual std::string getDescrName();

	private:
		unsigned int inpNo_;
		Func func_;
	};
	// ----------------------------------------------------------------------
	//	comparison and construction agent for SymFunc
	// ----------------------------------------------------------------------
	class SymFuncAgent: public BehavAgent {
	public:
		virtual bool Eq (const BehavDescr*) const;		// compare func equivalence
		virtual BehavDescr* CreateDescr (void) const;	// create log representation

		SymFuncAgent (SymFunc::Func f, unsigned int inp): repr_(f,inp) {}

		unsigned int inpNo (void) const { return repr_.inpNo(); }
		void inpNo (unsigned int inp) { repr_.inpNo(inp); }
		SymFunc::Func func (void) const { return repr_.func(); }
		void func (SymFunc::Func f) { repr_.func(f); }

	private:
		SymFunc repr_;
	};

	// ----------------------------------------------------------------------
	//	RTL description of a FF - no clock, no reset, triggering unknown
	// ----------------------------------------------------------------------
	class RTLReg: public BehavDescr {
		virtual std::string getDescrName();
	public: 
	};
	// ----------------------------------------------------------------------
	//	RTL description of a FF - library searching agent 
	// ----------------------------------------------------------------------
	class RTLRegAgent: public BehavAgent {
	public:
		virtual bool Eq (const BehavDescr*) const;		// compare func equivalence
		virtual BehavDescr* CreateDescr (void) const;	// create log representation
	};
}
#endif
