Beispiel #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);
            }
        }
Beispiel #2
0
 public override bool DoesOutlastLifetimeGraph(LifetimeGraphIdentifier lifetimeGraphIdentifier)
 => _graphTree.DoesLifetimeOutlastLifetimeGraph(this, lifetimeGraphIdentifier);
Beispiel #3
0
 public Lifetime CreateLifetimeThatIsBoundedByLifetimeGraph(LifetimeGraphIdentifier graphIdentifier)
 {
     return(_diagramGraphs[graphIdentifier].CreateLifetimeThatIsBoundedByDiagram());
 }
Beispiel #4
0
 public Lifetime GetLifetimeGraphRootLifetime(LifetimeGraphIdentifier graphIdentifier)
 {
     return(_diagramGraphs[graphIdentifier].DiagramLifetime);
 }
Beispiel #5
0
 public void EstablishLifetimeGraph(LifetimeGraphIdentifier identifier, LifetimeGraphIdentifier parentIdentifier)
 {
     _diagramGraphs[identifier] = new BoundedLifetimeGraph(this);
     _graphParents[identifier]  = parentIdentifier;
 }
Beispiel #6
0
 public abstract bool DoesOutlastLifetimeGraph(LifetimeGraphIdentifier lifetimeGraphIdentifier);
Beispiel #7
0
 public override bool DoesOutlastLifetimeGraph(LifetimeGraphIdentifier lifetimeGraphIdentifier) => !_isEmpty;
Beispiel #8
0
 public OutlastsLifetimeGraphConstraint(LifetimeGraphIdentifier lifetimeGraph)
 {
     _lifetimeGraph = lifetimeGraph;
 }