Пример #1
0
 /// <summary>
 ///  Constructs a DataBuffer containing the specified number of
 ///  banks with the indicated initial <seealso cref="State State"/>.
 ///  Each bank has the specified size and an offset of 0.
 /// </summary>
 ///  <param name="initialState"> the initial <seealso cref="State State"/> state of the data </param>
 ///  <param name="dataType"> the data type of this <code>DataBuffer</code> </param>
 ///  <param name="size"> the size of the banks </param>
 ///  <param name="numBanks"> the number of banks in this
 ///         <code>DataBuffer</code>
 ///  @since 1.7 </param>
 internal DataBuffer(State initialState, int dataType, int size, int numBanks)
 {
     this.TheTrackable     = StateTrackableDelegate.createInstance(initialState);
     this.DataType_Renamed = dataType;
     this.Banks            = numBanks;
     this.Size_Renamed     = size;
     this.Offset_Renamed   = 0;
     this.Offsets_Renamed  = new int[Banks];            // init to 0 by new
 }
Пример #2
0
 /// <summary>
 ///  Constructs a DataBuffer which contains the specified number
 ///  of banks with the indicated initial <seealso cref="State State"/>.
 ///  Each bank has the specified datatype and size.  The
 ///  offset for each bank is specified by its respective entry in
 ///  the offsets array.
 /// </summary>
 ///  <param name="initialState"> the initial <seealso cref="State State"/> state of the data </param>
 ///  <param name="dataType"> the data type of this <code>DataBuffer</code> </param>
 ///  <param name="size"> the size of the banks </param>
 ///  <param name="numBanks"> the number of banks in this
 ///         <code>DataBuffer</code> </param>
 ///  <param name="offsets"> an array containing an offset for each bank. </param>
 ///  <exception cref="ArrayIndexOutOfBoundsException"> if <code>numBanks</code>
 ///          does not equal the length of <code>offsets</code>
 ///  @since 1.7 </exception>
 internal DataBuffer(State initialState, int dataType, int size, int numBanks, int[] offsets)
 {
     if (numBanks != offsets.Length)
     {
         throw new ArrayIndexOutOfBoundsException("Number of banks" + " does not match number of bank offsets");
     }
     this.TheTrackable     = StateTrackableDelegate.createInstance(initialState);
     this.DataType_Renamed = dataType;
     this.Banks            = numBanks;
     this.Size_Renamed     = size;
     this.Offset_Renamed   = offsets[0];
     this.Offsets_Renamed  = (int[])offsets.clone();
 }
Пример #3
0
 /// <summary>
 ///  Constructs a DataBuffer that contains the specified number
 ///  of banks with the indicated initial <seealso cref="State State"/>.
 ///  Each bank has the specified datatype, size and offset.
 /// </summary>
 ///  <param name="initialState"> the initial <seealso cref="State State"/> state of the data </param>
 ///  <param name="dataType"> the data type of this <code>DataBuffer</code> </param>
 ///  <param name="size"> the size of the banks </param>
 ///  <param name="numBanks"> the number of banks in this
 ///         <code>DataBuffer</code> </param>
 ///  <param name="offset"> the offset for each bank
 ///  @since 1.7 </param>
 internal DataBuffer(State initialState, int dataType, int size, int numBanks, int offset)
 {
     this.TheTrackable     = StateTrackableDelegate.createInstance(initialState);
     this.DataType_Renamed = dataType;
     this.Banks            = numBanks;
     this.Size_Renamed     = size;
     this.Offset_Renamed   = offset;
     this.Offsets_Renamed  = new int[numBanks];
     for (int i = 0; i < numBanks; i++)
     {
         this.Offsets_Renamed[i] = offset;
     }
 }
Пример #4
0
 public virtual void SetTrackable(DataBuffer db, StateTrackableDelegate trackable)
 {
     db.TheTrackable = trackable;
 }