示例#1
0
 /// <summary>
 /// Construtor padrão.
 /// </summary>
 /// <param name="mmf"></param>
 /// <param name="viewSize">Tamanho da visualização.</param>
 public ViewManager(MmfFile mmf, uint viewSize)
 {
     _mmf         = mmf;
     _viewSize    = viewSize;
     _viewsOpen   = new ArrayList();
     _viewsClosed = new ArrayList();
 }
示例#2
0
        public static MmfFile Create(IntPtr hFile, ulong maxLength)
        {
            if (maxLength < 0)
            {
                throw new ArgumentOutOfRangeException("maxLength");
            }
            MmfFile file = new MmfFile(hFile, maxLength, MemoryProtection.PageReadWrite);

            if (!file.IsPageFile)
            {
                file.SetMaxLength(Math.Max(maxLength, file.FileSize));
                return(file);
            }
            file.SetMaxLength(maxLength);
            return(file);
        }
示例#3
0
 /// <summary>
 /// Abre o armazenamento da memória mapeada.
 /// </summary>
 /// <param name="fileName"></param>
 /// <param name="viewCount"></param>
 /// <param name="viewSize"></param>
 /// <param name="initialSizeMB"></param>
 public void OpenMemoryMappedStore(string fileName, uint viewCount, uint viewSize, uint initialSizeMB)
 {
     try
     {
         _fileName      = fileName;
         _viewCount     = viewCount;
         _viewSize      = SysUtil.AllignViewSize(viewSize);
         _initialSizeMB = initialSizeMB;
         _mmf           = MmfFile.Create(_fileName, (ulong)(_initialSizeMB * 0x100000), false);
         _viewManager   = new ViewManager(_mmf, _viewSize);
         _viewManager.CreateInitialViews(_viewCount);
     }
     catch (Exception)
     {
         throw;
     }
 }
示例#4
0
 /// <summary>
 /// Construtor padrão.
 /// </summary>
 /// <param name="mmf">MmfFile.</param>
 /// <param name="id">Identificador da instancia.</param>
 /// <param name="size"></param>
 public ViewRef(MmfFile mmf, uint id, uint size) : base(mmf, id, size)
 {
 }
示例#5
0
 /// <summary>
 /// Construtor padrão.
 /// </summary>
 /// <param name="mmf"></param>
 /// <param name="id"></param>
 /// <param name="size">Tamanho dos dados.</param>
 public View(MmfFile mmf, uint id, uint size)
 {
     _mmf  = mmf;
     _vid  = id;
     _size = size;
 }