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

	ChanAB.h													JJS 9/06/95
	
		part of CONICAL, the Computational Neuroscience Class Library
	
	A ChanAB is a ChanHH in which the change in the gating variables
	(i.e., UpdateM and UpdateH) are defined in terms of Alpha and Beta
	functions (AlphaM, BetaM, AlphaH, and BetaH).  See ChanInfTau for
	an alternative to this format.
	
	Like ChanHH itself, ChanAB can be instantiated, but doesn't do much,
	because AlphaM etc. do nothing.  Subclasses should override these
	four functions to provide full functionality.
	
	Requires:
		ChanHH			-- base class
		
**************************************************************************/

#ifndef CHANAB_H
#define CHANAB_H

#include "ChanHH.h"

class ChanAB : public ChanHH
{
  public:
  
	// constructors
	ChanAB( Compartment *pTo, real pMaxG=0.1, real pMexp=1, real pHexp=1 )
	: ChanHH( pTo, pMaxG, pMexp, pHexp ) {}
	
	ChanAB( VSink *pTo, VSource *pComp, real pMaxG=0.1, real pMexp=1, real pHexp=1 )
	: ChanHH( pTo, pComp, pMaxG, pMexp, pHexp ) {}
	
	virtual void UpdateM( const real dt );		// update M (calls AlphaM, BetaM)
	virtual void UpdateH( const real dt );		// update H (calls AlphaH, BetaH)
	
	// channel activation/inactivation functions: override these
	virtual real AlphaM( const real V ) const	{ return 1; }
	virtual real BetaM( const real V) const		{ return 1; }
	virtual real AlphaH( const real V ) const	{ return 1; }
	virtual real BetaH( const real V ) const	{ return 1; }
	
};

#endif
