C# Класс Microsoft.Cci.Ast.TypeInvariant

A condition that must be true after an object has been constructed and that is by default a part of the precondition and postcondition of every public method of the associated type.
Наследование: Invariant, ITypeInvariant
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
Dispatch ( ICodeAndContractVisitor visitor ) : void

Calls visitor.Visit(ITypeInvariant).

Dispatch ( SourceVisitor visitor ) : void

Calls visitor.Visit(TypeInvariant).

MakeCopyFor ( BlockStatement containingBlock ) : TypeInvariant

Makes a copy of this type invariant, changing the containing block to the given block.

SetContainingExpression ( Expression containingExpression ) : void

Completes the two stage construction of this object. This allows bottom up parsers to construct an Expression before constructing the containing Expression. This method should be called once only and must be called before this object is made available to client code. The construction code itself should also take care not to call any other methods or property/event accessors on the object until after this method has been called.

TypeInvariant ( Microsoft.Cci.Ast.NameDeclaration name, Expression condition, bool isAxiom, ISourceLocation sourceLocation ) : System.Collections.Generic

Allocates a condition that must be true at the start of a method, possibly bundled with an exception that will be thrown if the condition does not hold.

Защищенные методы

Метод Описание
TypeInvariant ( BlockStatement containingBlock, TypeInvariant template ) : System.Collections.Generic

A copy constructor that allocates an instance that is the same as the given template, except for its containing block.

Описание методов

Dispatch() публичный Метод

Calls visitor.Visit(ITypeInvariant).
public Dispatch ( ICodeAndContractVisitor visitor ) : void
visitor ICodeAndContractVisitor
Результат void

Dispatch() публичный Метод

Calls visitor.Visit(TypeInvariant).
public Dispatch ( SourceVisitor visitor ) : void
visitor SourceVisitor
Результат void

MakeCopyFor() публичный Метод

Makes a copy of this type invariant, changing the containing block to the given block.
public MakeCopyFor ( BlockStatement containingBlock ) : TypeInvariant
containingBlock BlockStatement
Результат TypeInvariant

SetContainingExpression() публичный Метод

Completes the two stage construction of this object. This allows bottom up parsers to construct an Expression before constructing the containing Expression. This method should be called once only and must be called before this object is made available to client code. The construction code itself should also take care not to call any other methods or property/event accessors on the object until after this method has been called.
public SetContainingExpression ( Expression containingExpression ) : void
containingExpression Expression
Результат void

TypeInvariant() защищенный Метод

A copy constructor that allocates an instance that is the same as the given template, except for its containing block.
protected TypeInvariant ( BlockStatement containingBlock, TypeInvariant template ) : System.Collections.Generic
containingBlock BlockStatement The containing block of the copied type invariant. This should be different from the containing block of the template.
template TypeInvariant The statement to copy.
Результат System.Collections.Generic

TypeInvariant() публичный Метод

Allocates a condition that must be true at the start of a method, possibly bundled with an exception that will be thrown if the condition does not hold.
public TypeInvariant ( Microsoft.Cci.Ast.NameDeclaration name, Expression condition, bool isAxiom, ISourceLocation sourceLocation ) : System.Collections.Generic
name Microsoft.Cci.Ast.NameDeclaration The name of the axiom. Used in error diagnostics. May be null.
condition Expression The condition that must be true at the start of the method that is associated with this Precondition instance.
isAxiom bool An axiom is a type invariant whose truth is assumed rather than derived. Commonly used to make statements about the meaning of contract methods.
sourceLocation ISourceLocation The source location corresponding to the newly allocated source item.
Результат System.Collections.Generic