blob: 614c1f85a4ee3073a9b96d3db20997625ab5f6d7 [file] [log] [blame]
using System;
using System.Runtime.InteropServices;
namespace Apache
{
namespace Geode
{
namespace DotNetCore
{
public class RegionFactory : GemfireNativeObject
{
[DllImport(Constants.libPath,
CharSet = CharSet.Auto)]
private static extern IntPtr apache_geode_Cache_CreateRegionFactory(IntPtr cache, int regionType);
[DllImport(Constants.libPath,
CharSet = CharSet.Auto)]
private static extern IntPtr apache_geode_DestroyRegionFactory(IntPtr regionFactory);
internal RegionFactory(IntPtr cache, RegionShortcut regionType)
{
_containedObject = apache_geode_Cache_CreateRegionFactory(cache, (int) regionType);
}
public Region CreateRegion(string regionName)
{
return new Region(_containedObject, regionName);
}
protected override void DestroyContainedObject()
{
apache_geode_DestroyRegionFactory(_containedObject);
_containedObject = IntPtr.Zero;
}
}
}
}
}