using System;
using System.Collections;

namespace Minntech.Listener
{
	/// <summary>
	/// Singleton, typed Queue class to contain raw transmission strings
	/// </summary>
	public class TxQueue : Queue, IDisposable
	{
		private static TxQueue _instance = null;

		#region construct/init/dispose

		private TxQueue()
		{
		}

		public static TxQueue GetInstance()
		{
			if ( _instance == null )
				_instance = new TxQueue();
			return _instance;
		}
		public void Dispose()
		{
			//flush pending entries to database?
		}


		#endregion 

		public override void Enqueue(object TxString)
		{
			if ( TxString.GetType().Equals(typeof(string)) )
				base.Enqueue (TxString);	
			else
				throw new ArgumentException ("TxQueue accepts only string values", "TxString");
		}
	}
}
