/**************************************************************************

	ChanHH.h													JJS 9/06/95
	
		part of CONICAL, the Computational Neuroscience Class Library
	
	ChanHH implements a Hodgkin-Huxley form active ion channel.  The
	channel conductance G is equal to M^Mexp * H^Hexp, where M and H
	are functions of voltage and time, and Mexp and Hexp are constants
	(integer by convention, but any value is allowed here).

	This is not an abstract base class; you can instantiate it, but it
	doesn't do much.  The UpdateM and UpdateH methods do nothing, which
	means that the gating variables (M and H) stay wherever you set them.
	Subclasses should override these two functions.

	Requires:
		Channel			-- base class
		math			-- ANSI math functions (defined in <math.h>)
		
**************************************************************************/

#ifndef CHANHH_H
#define CHANHH_H

#include "Channel.h"

class ChanHH : public Channel
{
  public:

	// constructors
	ChanHH( Compartment *pTo, real pMaxG=0.1, real pMexp=1, real pHexp=1 )
	: Channel( pTo, pMaxG ), M(1), H(1), Mexp(pMexp), Hexp(pHexp) {}

	ChanHH( VSink *pTo, VSource *pComp, real pMaxG=0.1, real pMexp=1, real pHexp=1 )
	: Channel( pTo, pComp, pMaxG ), M(1), H(1), Mexp(pMexp), Hexp(pHexp) {}

	// update methods
	
	virtual void Step( const real dt );			// updates G,
												// calls UpdateM and UpdateH	

	virtual void UpdateM( const real dt ) {}	// update M (override this)
	virtual void UpdateH( const real dt ) {}	// update H (override this)
	
	// public variables:
	
	real M, H;					// gating variables
	real Mexp, Hexp;			// exponents in current function

};	

#endif

