IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
NUnit.Framework.Constraints.ConstraintBuilder Class Reference

ConstraintBuilder maintains the stacks that are used in processing a ConstraintExpression. An OperatorStack is used to hold operators that are waiting for their operands to be reorganized. a ConstraintStack holds input constraints as well as the results of each operator applied. More...

+ Inheritance diagram for NUnit.Framework.Constraints.ConstraintBuilder:
+ Collaboration diagram for NUnit.Framework.Constraints.ConstraintBuilder:

Classes

class  ConstraintStack
 ConstraintStack is a type-safe stack for holding Constraints More...
 
class  OperatorStack
 OperatorStack is a type-safe stack for holding ConstraintOperators More...
 

Public Member Functions

 ConstraintBuilder ()
 Initializes a new instance of the ConstraintBuilder class. More...
 
void Append (ConstraintOperator op)
 Appends the specified operator to the expression by first reducing the operator stack and then pushing the new operator on the stack. More...
 
void Append (Constraint constraint)
 Appends the specified constraint to the expression by pushing it on the constraint stack. More...
 
IConstraint Resolve ()
 Resolves this instance, returning a Constraint. If the Builder is not currently in a resolvable state, an exception is thrown. More...
 

Properties

bool IsResolvable [get]
 Gets a value indicating whether this instance is resolvable. More...
 

Private Member Functions

void SetTopOperatorRightContext (object rightContext)
 Sets the top operator right context. More...
 
void ReduceOperatorStack (int targetPrecedence)
 Reduces the operator stack until the topmost item precedence is greater than or equal to the target precedence. More...
 

Private Attributes

readonly OperatorStack ops
 
readonly ConstraintStack constraints
 
object lastPushed
 

Detailed Description

ConstraintBuilder maintains the stacks that are used in processing a ConstraintExpression. An OperatorStack is used to hold operators that are waiting for their operands to be reorganized. a ConstraintStack holds input constraints as well as the results of each operator applied.

Constructor & Destructor Documentation

NUnit.Framework.Constraints.ConstraintBuilder.ConstraintBuilder ( )
inline

Initializes a new instance of the ConstraintBuilder class.

Member Function Documentation

void NUnit.Framework.Constraints.ConstraintBuilder.Append ( ConstraintOperator  op)
inline

Appends the specified operator to the expression by first reducing the operator stack and then pushing the new operator on the stack.

Parameters
opThe operator to push.

References NUnit.Framework.Constraints.ConstraintOperator.LeftContext, and NUnit.Framework.Constraints.ConstraintOperator.LeftPrecedence.

Referenced by NUnit.Framework.Constraints.ConstraintExpression.Append().

void NUnit.Framework.Constraints.ConstraintBuilder.Append ( Constraint  constraint)
inline

Appends the specified constraint to the expression by pushing it on the constraint stack.

Parameters
constraintThe constraint to push.

References NUnit.Framework.Constraints.Constraint.Builder.

void NUnit.Framework.Constraints.ConstraintBuilder.SetTopOperatorRightContext ( object  rightContext)
inlineprivate

Sets the top operator right context.

Parameters
rightContextThe right context.

References NUnit.Framework.Constraints.ConstraintOperator.LeftPrecedence.

void NUnit.Framework.Constraints.ConstraintBuilder.ReduceOperatorStack ( int  targetPrecedence)
inlineprivate

Reduces the operator stack until the topmost item precedence is greater than or equal to the target precedence.

Parameters
targetPrecedenceThe target precedence.
IConstraint NUnit.Framework.Constraints.ConstraintBuilder.Resolve ( )
inline

Resolves this instance, returning a Constraint. If the Builder is not currently in a resolvable state, an exception is thrown.

Returns
The resolved constraint

Implements NUnit.Framework.Constraints.IResolveConstraint.

References NUnit.Framework.Constraints.ConstraintOperator.Reduce().

Referenced by NUnit.Framework.Constraints.ConstraintExpression.ToString().

Member Data Documentation

readonly OperatorStack NUnit.Framework.Constraints.ConstraintBuilder.ops
private
readonly ConstraintStack NUnit.Framework.Constraints.ConstraintBuilder.constraints
private
object NUnit.Framework.Constraints.ConstraintBuilder.lastPushed
private

Property Documentation

bool NUnit.Framework.Constraints.ConstraintBuilder.IsResolvable
getprivate

Gets a value indicating whether this instance is resolvable.

true if this instance is resolvable; otherwise, false.


The documentation for this class was generated from the following file: