コード例 #1
0
ファイル: MemoryMapping.cs プロジェクト: cephdon/systemsharp
        /// <summary>
        /// Maps a constant to this region.
        /// </summary>
        /// <param name="data">constant value to map</param>
        /// <returns>storage mapping of the constant</returns>
        public MemoryMappedStorage Map(object data)
        {
            Contract.Requires(data != null);
            var result = new MemoryMappedStorage(data, this, Marshal.Layout(TypeDescriptor.GetTypeOf(data), MarshalInfo));

            Items.Add(result);
            return(result);
        }
コード例 #2
0
ファイル: MemoryMapping.cs プロジェクト: cephdon/systemsharp
        /// <summary>
        /// Maps a variable to this region.
        /// </summary>
        /// <param name="v">variable to map</param>
        /// <returns>storage mapping of the variable</returns>
        public MemoryMappedStorage Map(Variable v)
        {
            Contract.Requires(v != null);
            var result = new MemoryMappedStorage(v, this, Marshal.Layout(v.Type, MarshalInfo));

            Items.Add(result);
            return(result);
        }
コード例 #3
0
ファイル: MemoryMapping.cs プロジェクト: cephdon/systemsharp
        /// <summary>
        /// Maps a data item to this region.
        /// </summary>
        /// <param name="item">object which is used a key to identify the data item</param>
        /// <param name="dataType">type of actual data</param>
        /// <returns>sotrage mapping of the data item</returns>
        public MemoryMappedStorage Map(object item, TypeDescriptor dataType)
        {
            Contract.Requires(item != null);
            Contract.Requires(dataType != null);
            var result = new MemoryMappedStorage(item, dataType, this, Marshal.Layout(dataType, MarshalInfo));

            Items.Add(result);
            return(result);
        }
コード例 #4
0
 /// <summary>
 /// Maps a data item to this region.
 /// </summary>
 /// <param name="item">object which is used a key to identify the data item</param>
 /// <param name="dataType">type of actual data</param>
 /// <returns>sotrage mapping of the data item</returns>
 public MemoryMappedStorage Map(object item, TypeDescriptor dataType)
 {
     Contract.Requires(item != null);
     Contract.Requires(dataType != null);
     var result = new MemoryMappedStorage(item, dataType, this, Marshal.Layout(dataType, MarshalInfo));
     Items.Add(result);
     return result;
 }
コード例 #5
0
 /// <summary>
 /// Maps a constant to this region.
 /// </summary>
 /// <param name="data">constant value to map</param>
 /// <returns>storage mapping of the constant</returns>
 public MemoryMappedStorage Map(object data)
 {
     Contract.Requires(data != null);
     var result = new MemoryMappedStorage(data, this, Marshal.Layout(TypeDescriptor.GetTypeOf(data), MarshalInfo));
     Items.Add(result);
     return result;
 }
コード例 #6
0
 /// <summary>
 /// Maps a variable to this region.
 /// </summary>
 /// <param name="v">variable to map</param>
 /// <returns>storage mapping of the variable</returns>
 public MemoryMappedStorage Map(Variable v)
 {
     Contract.Requires(v != null);
     var result = new MemoryMappedStorage(v, this, Marshal.Layout(v.Type, MarshalInfo));
     Items.Add(result);
     return result;
 }