Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 27, 2008, 12:27:13 AM (16 years ago)
Author:
landauf
Message:

autocompletion is almost done

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/console/src/core/TclThreadManager.cc

    r1424 r1434  
    4848namespace orxonox
    4949{
    50     SetConsoleCommandShortcutGeneric(tclexecute, createConsoleCommand(createFunctor(&TclThreadManager::execute), "tclexecute"));
    51     SetConsoleCommandShortcutGeneric(tclquery,   createConsoleCommand(createFunctor(&TclThreadManager::query),   "tclquery"  ));
     50    SetConsoleCommandShortcutGeneric(tclexecute, createConsoleCommand(createFunctor(&TclThreadManager::execute), "tclexecute")).setArgumentCompleter(0, autocompletion::tclthreads());
     51    SetConsoleCommandShortcutGeneric(tclquery,   createConsoleCommand(createFunctor(&TclThreadManager::query),   "tclquery"  )).setArgumentCompleter(0, autocompletion::tclthreads());
    5252    SetConsoleCommand(TclThreadManager, create,  false);
    53     SetConsoleCommand(TclThreadManager, destroy, false);
    54     SetConsoleCommand(TclThreadManager, execute, false);
    55     SetConsoleCommand(TclThreadManager, query,   false);
     53    SetConsoleCommand(TclThreadManager, destroy, false).setArgumentCompleter(0, autocompletion::tclthreads());
     54    SetConsoleCommand(TclThreadManager, execute, false).setArgumentCompleter(0, autocompletion::tclthreads());
     55    SetConsoleCommand(TclThreadManager, query,   false).setArgumentCompleter(0, autocompletion::tclthreads());
    5656    SetConsoleCommand(TclThreadManager, status,  false);
    57     SetConsoleCommand(TclThreadManager, dump,    false);
    58     SetConsoleCommand(TclThreadManager, flush,   false);
     57    SetConsoleCommand(TclThreadManager, dump,    false).setArgumentCompleter(0, autocompletion::tclthreads());
     58    SetConsoleCommand(TclThreadManager, flush,   false).setArgumentCompleter(0, autocompletion::tclthreads());
    5959
    6060    TclThreadManager* instance_tclthreadmanager = &TclThreadManager::getInstance();
     
    632632    }
    633633
     634    std::list<std::pair<std::string, std::string> > TclThreadManager::getThreadList() const
     635    {
     636        boost::mutex::scoped_lock bundles_lock(TclThreadManager::getInstance().bundlesMutex_);
     637        std::list<std::pair<std::string, std::string> > threads;
     638        for (std::map<unsigned int, TclInterpreterBundle*>::const_iterator it = this->interpreterBundles_.begin(); it != this->interpreterBundles_.end(); ++it)
     639        {
     640            std::string number = getConvertedValue<unsigned int, std::string>((*it).first);
     641            threads.push_back(std::pair<std::string, std::string>(number, number));
     642        }
     643        return threads;
     644    }
     645
    634646    void tclThread(TclInterpreterBundle* interpreterBundle, std::string command)
    635647    {
Note: See TracChangeset for help on using the changeset viewer.