namespace BO.ProcessServer.Business.StatisticCounters
{
    internal class IncrementalCounter : BaseCounter
    {

        #region *** Private fields ***
        private long _value;
        #endregion

        #region *** Constructor ***
        public IncrementalCounter(string name) : base(name)
        {
        }
        #endregion

        #region *** Public Operations ***

        public void Increment()
        {
            _value++;
        }
        public void Decrement()
        {
            _value--;
        }

        public void SetValue(long newValue)
        {
            _value = newValue;
        }

        public override object GetValue()
        {
            return _value;
        }

        public long GetTypedValue()
        {
            return (long) GetValue();
        }


        public override void Reset()
        {
            _value = 0;
        }
        #endregion
    }
}
