#ifndef _COUNTER_
#define _COUNTER_
// Counter
class Counter
{
private:
int aValue;
int aResetValue;
public:
Counter (); // Default constructor
Counter (int ResetValue);
Counter (int Value, int ResetValue);
void Increment ();
void Decrement ();
void Reset ();
void Value (int Value);
const int Value ();
const int ResetValue ();
};

class CounterN : public Counter
{
private:
int anIncValue;
public:
CounterN (); // Default constructor
CounterN (int IncValue);
CounterN (int Incvalue, int ResetValue);
CounterN (int IncValue, int Value, int ResetValue);
void Increment ();
void Decrement ();
void SetIncrement(int IncValue);
};


Counter::Counter ()
{
	aValue = 0;
	aResetValue = 0;
}

Counter::Counter (int ResetValue) :
  aResetValue(ResetValue), aValue(ResetValue)
{
}

Counter::Counter (int Value, int ResetValue) :
  aResetValue(ResetValue), aValue(Value)
{
}

void Counter::Increment ()
{
aValue++;
}

void Counter::Decrement ()
{
aValue--;
}

void Counter::Reset ()
{
aValue = aResetValue;
}

void Counter::Value (int Value)
{
aValue = Value;
}

const int Counter::Value ()
{
return aValue;
}

CounterN::CounterN () : Counter ()
{
	anIncValue = 1;
}

CounterN::CounterN (int IncValue) : Counter (),
  anIncValue(IncValue)
{
}

CounterN::CounterN (int IncValue, int ResetValue) :
  Counter(ResetValue), anIncValue(IncValue)
{
}

CounterN::CounterN (int IncValue, int Value, int ResetValue) :
  Counter(Value, ResetValue), anIncValue(IncValue)
{
}

void CounterN::Increment ()
{
int aValue = Value();
aValue += anIncValue;
Value(aValue);
}

void CounterN::Decrement ()
{
int aValue = Value();
aValue -= anIncValue;
Value(aValue);
}

void CounterN::SetIncrement(int IncValue)
{
anIncValue = IncValue;
}

#endif