Ejemplo n.º 1
0
        internal override void DoFinalize(CIElementFinalizationParameters aParams, Queue <CIElement> aCallBackLast, bool aForceFinalize)
        {
            CIContainer container = base.Container;

            // Find all the stacks and add them as children before we call the base class
            // method, since the base class will then take care of finalizing the new dynamically created
            // summarisable objects.
            CIElementList <CIStack> stacks = container.ChildrenByType <CIStack>(TChildSearchType.EEntireHierarchy);

            if (stacks != null && stacks.Count > 0)
            {
                foreach (CIStack stack in stacks)
                {
                    CISummarisableEntity entity = this[stack];
                    if (entity == null)
                    {
                        entity = new CISummarisableEntity(stack);
                        AddChild(entity);
                    }
                }
            }

            // Now, make sure there are summarisable wrappers created for any threads which do not have associated
            // stacks. Call stacks will be unavailable, but there's still plenty of useful information at the thread
            // process and register levels.
            CIElementList <CIThread> threads = container.ChildrenByType <CIThread>(TChildSearchType.EEntireHierarchy);

            if (threads != null && threads.Count > 0)
            {
                foreach (CIThread thread in threads)
                {
                    CISummarisableEntity entity = this[thread];
                    if (entity == null)
                    {
                        entity = new CISummarisableEntity(thread);
                        AddChild(entity);
                    }
                }
            }

            // Now run finalizers on children et al.
            base.DoFinalize(aParams, aCallBackLast, aForceFinalize);
        }
Ejemplo n.º 2
0
 public CISummarisableEntity this[CIStack aEntry]
 {
     get
     {
         CISummarisableEntity ret = null;
         //
         foreach (CISummarisableEntity entry in this)
         {
             if (entry.IsAvailable(CISummarisableEntity.TElement.EElementStack))
             {
                 if (entry.Stack.Id == aEntry.Id)
                 {
                     ret = entry;
                     break;
                 }
             }
         }
         //
         return(ret);
     }
 }