add PdBuffer

This commit is contained in:
Chikashi Miyama 2019-07-06 16:22:52 +02:00
parent 3441b7b4b9
commit 30256c77a5
2 changed files with 25 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
UnityProject/Library

View file

@ -0,0 +1,24 @@
using System;
using System.IO.MemoryMappedFiles;
namespace PdConnection
{
public class PdBuffer : IDisposable
{
private readonly MemoryMappedFile memoryMappedFile_;
private readonly MemoryMappedViewAccessor viewAccessor_;
public PdBuffer()
{
memoryMappedFile_ = MemoryMappedFile.OpenExisting("shared_memory");
viewAccessor_ = memoryMappedFile_.CreateViewAccessor();
}
public void Dispose()
{
viewAccessor_?.Dispose();
memoryMappedFile_?.Dispose();
}
}
}