public static void OnTransportGraphChanged(
            IntPtr transportApiHandle,
            TransportNetworkType transportNetworkType,
            MortonKeyInterop cellKeyInterop,
            TransportGraphChangeReason transportGraphChangeReason)
        {
            var transportApiInternal = transportApiHandle.NativeHandleToObject <TransportApiInternal>();
            var cellKey = cellKeyInterop.FromInterop();

            transportApiInternal.NotifyTransportGraphChanged(transportNetworkType, cellKey, transportGraphChangeReason);
        }
 private static extern bool NativeTransportApi_TryTransportCellKeyToString(IntPtr ptr, MortonKeyInterop cellKeyInterop, int bufferSize, IntPtr stringBufer);
 private static extern bool NativeTransportApi_TryGetWayIdsForNetworkInCell(IntPtr ptr, TransportNetworkType networkType, MortonKeyInterop cellKeyInterop, int bufferElementCount, IntPtr wayIdInteropBuffer);
 private static extern int NativeTransportApi_GetWayCountForNetworkInCell(IntPtr ptr, TransportNetworkType networkType, MortonKeyInterop cellKeyInterop);
        private IList <TransportWayIdInterop> FetchWayIdsForNetworkInCell(TransportNetworkType transportNetwork, MortonKeyInterop cellKeyInterop)
        {
            int wayCount = NativeTransportApi_GetWayCountForNetworkInCell(NativePluginRunner.API, transportNetwork, cellKeyInterop);

            if (wayCount <= 0)
            {
                return(new List <TransportWayIdInterop>());
            }

            var wayIdInteropBuffer         = new TransportWayIdInterop[wayCount];
            var wayIdInteropBufferGCHandle = GCHandle.Alloc(wayIdInteropBuffer, GCHandleType.Pinned);
            var wayIdInteropBufferPtr      = wayIdInteropBufferGCHandle.AddrOfPinnedObject();
            var waySuccess = NativeTransportApi_TryGetWayIdsForNetworkInCell(NativePluginRunner.API, transportNetwork, cellKeyInterop, wayCount, wayIdInteropBufferPtr);

            if (!waySuccess)
            {
                throw new System.ArgumentOutOfRangeException("incorrect buffer size passed for way ids");
            }

            wayIdInteropBufferGCHandle.Free();

            return(wayIdInteropBuffer);
        }