예제 #1
0
        public override Task <GetInfoResponse> GetInfo(GetInfoRequest request,
                                                       ServerCallContext context)
        {
            RemoteFrame          frame = frameStore.GetObject(request.Frame.Id);
            FrameInfo <SbModule> info  = frame.GetInfo((FrameInfoFlags)request.Fields);

            // Note: info can't be null since it's a struct.
            var moduleId = info.Module != null?moduleStore.AddObject(info.Module) : (long?)null;

            return(Task.FromResult(new GetInfoResponse
            {
                Info = GrpcFactoryUtils.CreateFrameInfo(info, moduleId)
            }));
        }
예제 #2
0
        public override Task <GetFramesWithInfoResponse> GetFramesWithInfo(
            GetFramesWithInfoRequest request, ServerCallContext context)
        {
            var thread         = threadStore.GetObject(request.Thread.Id);
            var framesWithInfo = thread.GetFramesWithInfo((FrameInfoFlags)request.Fields,
                                                          request.StartIndex, request.MaxCount);
            var response = new GetFramesWithInfoResponse();

            foreach (var frameWithInfo in framesWithInfo)
            {
                var grpcFrameWithInfo = new GrpcFrameWithInfo();
                grpcFrameWithInfo.Frame = CreateGrpcSbFrame(frameWithInfo.Frame);
                FrameInfo <SbModule> info = frameWithInfo.Info;
                long?moduleId             = info.Module != null?
                                            moduleStore.AddObject(info.Module) : (long?)null;

                grpcFrameWithInfo.Info = GrpcFactoryUtils.CreateFrameInfo(info, moduleId);
                response.FramesWithInfo.Add(grpcFrameWithInfo);
            }
            return(Task.FromResult(response));
        }