Ejemplo n.º 1
0
 internal ExchangePeer(ILocalMember localMember, IPEndPoint address, Func <IPEndPoint, IClient> clientFactory, TimeSpan requestTimeout, PipeOptions pipeConfig, IClientMetricsCollector?metrics)
     : base(localMember, address, metrics)
 {
     client = clientFactory(address);
     this.requestTimeout = requestTimeout;
     this.pipeConfig     = pipeConfig;
 }
 private protected RaftClusterMember(ILocalMember localMember, IPEndPoint endPoint, IClientMetricsCollector?metrics)
 {
     this.localMember = localMember;
     this.metrics     = metrics;
     Endpoint         = endPoint;
     status           = new AtomicEnum <ClusterMemberStatus>(ClusterMemberStatus.Unknown);
 }
Ejemplo n.º 3
0
            public string Visit(ILocalMember local, IntermediateNameRequestDetails context)
            {
                string name = null;

                switch (context)
                {
                case IntermediateNameRequestDetails.TargetFileName:
                    this.fileNameLookup.TryGetValue(local.Parent.Assembly, out name);
                    if (this.HtmlContext)
                    {
                        name = string.Format("{0}#loc{1:X8}", name, local.GetHashCode());
                    }
                    break;

                case IntermediateNameRequestDetails.SourceFileName:
                    name = local.Parent.Assembly.FileName;
                    break;

                case IntermediateNameRequestDetails.DisplayName:
                    name = local.Name;
                    break;

                case IntermediateNameRequestDetails.ReferenceName:
                    if (this.HtmlContext)
                    {
                        name = string.Format("loc{0:X8}", local.GetHashCode());
                    }
                    break;
                }
                return(name);
            }
        public static IUsingBlockStatement Using(this IBlockStatementParent parent, ILocalMember resourceAcquisition, params ILocalMember[] siblings)
        {
            var decl           = resourceAcquisition.GetDeclarationStatement(siblings);
            var usingStatement = new UsingBlockStatement(parent, decl);

            parent.Add(usingStatement);
            return(usingStatement);
        }
        private protected static Func <int, ExchangePool> ExchangePoolFactory(ILocalMember localMember)
        {
            ExchangePool CreateExchangePool(int count)
            {
                var result = new ExchangePool();

                while (--count >= 0)
                {
                    result.Add(new ServerExchange(localMember));
                }
                return(result);
            }

            return(CreateExchangePool);
        }
Ejemplo n.º 6
0
 /// <summary><para>Creates a C&#9839; compiler warning, relative to the
 /// abstract model, (level 3) &#35;168:</para><para>The variable
 /// '<paramref name="assignedButUnusedLocalVariable"/>' is assigned but
 /// its value is never used</para></summary>
 /// <param name="assignedButUnusedLocalVariable">The <see cref="ILocalMember"/> which is assigned
 /// a value, but unused within the scope of the method.</param>
 public static ICompilerSourceModelWarning <ILocalMember> WarningCS0168(ILocalMember assignedButUnusedLocalVariable)
 {
     //ToDo: Add location information to local variables.
     return(new CompilerSourceModelWarning <ILocalMember>(CS0168, assignedButUnusedLocalVariable, null, LineColumnPair.Zero, LineColumnPair.Zero, assignedButUnusedLocalVariable.UniqueIdentifier.ToString()));
 }
 private protected static Func <ServerExchange> ServerExchangeFactory(ILocalMember localMember)
 => () => new ServerExchange(localMember);
 public static IYieldReturnStatement YieldReturn(this IBlockStatementParent blockParent, ILocalMember returnValue)
 {
     return(blockParent.YieldReturn((IExpression)returnValue.GetReference()));
 }
Ejemplo n.º 9
0
 public void DefineDeclaration(ILocalMember declaration)
 {
     this.Formatter.DefineDeclaration(declaration);
 }
Ejemplo n.º 10
0
 public void ReferenceDeclaration(ILocalMember declaration)
 {
 }
Ejemplo n.º 11
0
 internal ServerExchange(ILocalMember server, PipeOptions?options = null)
     : base(options) => this.server = server;
Ejemplo n.º 12
0
 public void ReferenceDeclaration(ILocalMember declaration)
 {
     ReferenceDeclaration((IIntermediateMember)declaration);
 }
Ejemplo n.º 13
0
 public TestLinkerResult Visit(ILocalMember local, ICompilationContext context)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 14
0
 public void DefineDeclaration(ILocalMember declaration)
 {
     this.DefineDeclaration((IIntermediateMember)declaration);
 }
Ejemplo n.º 15
0
 static TcpServer CreateServer(ILocalMember member, IPEndPoint address, TimeSpan timeout) => new TcpServer(address, 100, DefaultAllocator, ServerExchangeFactory(member), NullLoggerFactory.Instance)
 {
     ReceiveTimeout          = timeout,
     TransmissionBlockSize   = 65535,
     GracefulShutdownTimeout = 2000
 };
Ejemplo n.º 16
0
 static UdpServer CreateServer(ILocalMember member, IPEndPoint address, TimeSpan timeout) => new UdpServer(address, 2, DefaultAllocator, ExchangePoolFactory(member), NullLoggerFactory.Instance)
 {
     ReceiveTimeout = timeout,
     DatagramSize   = UdpSocket.MaxDatagramSize,
     DontFragment   = false
 };
Ejemplo n.º 17
0
 public abstract void Translate(ILocalMember intermediateMember);
Ejemplo n.º 18
0
 public void ReferenceDeclaration(ILocalMember declaration)
 {
     this.Formatter.ReferenceDeclaration(declaration);
 }
Ejemplo n.º 19
0
 void IIntermediateMemberVisitor.Visit(ILocalMember intermediateMember)
 {
     this.Translate(intermediateMember);
 }
Ejemplo n.º 20
0
 /// <summary><para>Creates a C&#9839; compiler warning, relative to the
 /// abstract model, (level 3) &#35;219:</para><para>The variable {0} is assigned but its value is never used</para></summary>
 public static ICompilerSourceModelWarning <ILocalMember> WarningCS0219(ILocalMember targetMember)
 {
     //ToDo: Add location information to local members.
     return(new CompilerSourceModelWarning <ILocalMember>(CS0219, targetMember, null, LineColumnPair.Zero, LineColumnPair.Zero, targetMember.UniqueIdentifier.ToString()));
 }
Ejemplo n.º 21
0
 public void DefineDeclaration(ILocalMember declaration)
 {
 }
 public static IReturnStatement Return(this IBlockStatementParent blockParent, ILocalMember returnValue)
 {
     return(blockParent.Return(returnValue.GetReference()));
 }
 public static ILockStatement Lock(this IBlockStatementParent parent, ILocalMember localMember)
 {
     return(parent.Lock(localMember.GetReference()));
 }
Ejemplo n.º 24
0
 public TransformationKind Visit(ILocalMember local, ITransformationContext context)
 {
     throw new NotImplementedException();
 }