示例#1
0
        private bool DoesLifetimeOutlastLifetimeGraph(BoundedLifetime boundedLifetime, LifetimeGraphIdentifier graphIdentifier)
        {
            BoundedLifetimeGraph boundedLifetimeGraph = boundedLifetime.DiagramGraph;
            BoundedLifetimeGraph diagramGraph         = _diagramGraphs[graphIdentifier];

            if (boundedLifetimeGraph == diagramGraph)
            {
                return(boundedLifetimeGraph.DoesOutlast(boundedLifetime, boundedLifetimeGraph.DiagramLifetime));
            }
            else
            {
                LifetimeGraphIdentifier currentGraphIdentifier = graphIdentifier, parentGraphIdentifier;
                while (_graphParents.TryGetValue(currentGraphIdentifier, out parentGraphIdentifier))
                {
                    diagramGraph = _diagramGraphs[currentGraphIdentifier];
                    if (diagramGraph == boundedLifetimeGraph)
                    {
                        return(true);
                    }
                    currentGraphIdentifier = parentGraphIdentifier;
                }
                return(false);
            }
        }
示例#2
0
 public override bool DoesOutlastLifetimeGraph(LifetimeGraphIdentifier lifetimeGraphIdentifier)
 => _graphTree.DoesLifetimeOutlastLifetimeGraph(this, lifetimeGraphIdentifier);
示例#3
0
 public Lifetime CreateLifetimeThatIsBoundedByLifetimeGraph(LifetimeGraphIdentifier graphIdentifier)
 {
     return(_diagramGraphs[graphIdentifier].CreateLifetimeThatIsBoundedByDiagram());
 }
示例#4
0
 public Lifetime GetLifetimeGraphRootLifetime(LifetimeGraphIdentifier graphIdentifier)
 {
     return(_diagramGraphs[graphIdentifier].DiagramLifetime);
 }
示例#5
0
 public void EstablishLifetimeGraph(LifetimeGraphIdentifier identifier, LifetimeGraphIdentifier parentIdentifier)
 {
     _diagramGraphs[identifier] = new BoundedLifetimeGraph(this);
     _graphParents[identifier]  = parentIdentifier;
 }
示例#6
0
 public abstract bool DoesOutlastLifetimeGraph(LifetimeGraphIdentifier lifetimeGraphIdentifier);
示例#7
0
 public override bool DoesOutlastLifetimeGraph(LifetimeGraphIdentifier lifetimeGraphIdentifier) => !_isEmpty;
示例#8
0
 public OutlastsLifetimeGraphConstraint(LifetimeGraphIdentifier lifetimeGraph)
 {
     _lifetimeGraph = lifetimeGraph;
 }