//                           UNCLASSIFIED
/*-------------------------------------------------------------------------
RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION
PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS
AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO
UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO
RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS
CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS
OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON
COMPANY.

THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S.
GOVERNMENT.

UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY.
-------------------------------------------------------------------------*/

using System;

namespace BitMeasurementManagerLib
{
   /// <summary>
   /// 
   /// </summary>
   /// <typeparam name="TData"></typeparam>
   public class BitConfigurableMessageDataItem<TData> : IConfigurableDataItem<TData>
   {
      #region PublicClassMembers
      #endregion

      #region PrivateClassMembers
      private string _dataItemName;
      private int _numItems;
      private string _defaultValueStr;
      private BitConfigurableMessage.DataItemType _dataItemType;
      #endregion

      #region PublicFunctions

      /// <summary>
      /// 
      /// </summary>
      /// <param name="dataItemName"></param>
      /// <param name="type"></param>
      /// <param name="dataValue"></param>
      public BitConfigurableMessageDataItem(string dataItemName, BitConfigurableMessage.DataItemType type, TData dataValue, string defaultValueStr, int numItems)
      {
         _dataItemName = dataItemName;
         _dataItemType = type;
         _defaultValueStr = defaultValueStr;
         _numItems = numItems;
         Data = dataValue;
      }

      /// <summary>
      /// 
      /// </summary>
      public Type DataType
      {
         get { return typeof(TData); }
      }

      /// <summary>
      /// 
      /// </summary>
      object IConfigurableDataItem.Data
      {
         get { return Data; }
         set { Data = (TData)value; }
      }

      /// <summary>
      /// 
      /// </summary>
      public TData Data { get; set; }

      /// <summary>
      /// 
      /// </summary>
      /// <returns></returns>
      public string GetDataItemName()
      {
         return _dataItemName;
      }

      /// <summary>
      /// 
      /// </summary>
      /// <returns></returns>
      public string GetDefaultValueStr()
      {
         return _defaultValueStr;
      }

      /// <summary>
      /// 
      /// </summary>
      /// <returns></returns>
      public BitConfigurableMessage.DataItemType GetDataItemType()
      {
         return _dataItemType;
      }

      /// <summary>
      /// 
      /// </summary>
      /// <returns></returns>
      public int GetNumDataItems()
      {
         return _numItems;
      }
      #endregion
   }
}