Пример #1
0
    /// <summary>
    /// Initializes a new instance of the <see cref="HiLoGenerator"/> class
    /// by using the given next high delegate and max lo value.
    /// </summary>
    /// <param name="next_high">
    /// A <see cref="CallableDelegate{T}"/> that is used to get the next High
    /// value.
    /// </param>
    public HiLoGenerator(NextHighDelegate next_high) {
      if (next_high == null) {
        throw new ArgumentNullException("next_high");
      }

      next_high_ = next_high;
      hi_lo_range_ = new FullHiloRange();
      lo_ = MaxHigh + 1;
    }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HiLoGenerator"/> class
        /// by using the given next high delegate and max lo value.
        /// </summary>
        /// <param name="next_high">
        /// A <see cref="CallableDelegate{T}"/> that is used to get the next High
        /// value.
        /// </param>
        public HiLoGenerator(NextHighDelegate next_high)
        {
            if (next_high == null)
            {
                throw new ArgumentNullException("next_high");
            }

            next_high_   = next_high;
            hi_lo_range_ = new FullHiloRange();
            lo_          = MaxHigh + 1;
        }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HiLoGenerator"/> class
 /// by using the given next hi delegate and max lo value.
 /// </summary>
 /// <param name="next_high">
 /// A <see cref="CallableDelegate{T}"/> that is used to get the next High
 /// value.
 /// </param>
 public ThreadSafeHiLoGenerator(NextHighDelegate next_high)
     : base(next_high)
 {
     lock_ = new object();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HiLoGenerator"/> class
 /// by using the given next hi delegate and max lo value.
 /// </summary>
 /// <param name="next_high">
 /// A <see cref="CallableDelegate{T}"/> that is used to get the next High
 /// value.
 /// </param>
 public ThreadSafeHiLoGenerator(NextHighDelegate next_high)
   : base(next_high) {
   lock_ = new object();
 }