Пример #1
0
void SystemTimer::start(void)
{
    updateHiddenDelays();

    ListIterator<TickListener*> iter = tlList.getListIterator();
    iter.reset();
    while (iter.hasNext())
    {
        TickListener *tl = iter.next();
        if (tl != NULL)
            tl->onTick();
    }

    while (time < stoptime)
    {
        time++;

        ListIterator< List<Line*>* > refIter = refLists.getListIterator();
        refIter.reset();
        while (refIter.hasNext())
        {
            List<Line*> *list = refIter.next();

            Line *line = list->first();
            if (line != NULL)
                line->update();
        }

        updateHiddenDelays();

        if (clock != NULL)
            clock->tick();

        updateHiddenDelays();

        ListIterator<TickListener*> iter = tlList.getListIterator();
        iter.reset();

        while (iter.hasNext())
        {
            TickListener *tl = iter.next();
            if (tl != NULL)
                tl->onTick();
        }
    }
}
Пример #2
0
void HiddenModuleManager::destroyModules(void)
{
    ListIterator<Module*> li = modList.getListIterator();

    li.reset();
    while (li.hasNext())
    {
        Module *mod = li.next();
        if (mod != NULL)
            delete mod;
    }
}