lib
Kross::Api::Manager Class Reference
#include <manager.h>
Inheritance diagram for Kross::Api::Manager:

Detailed Description
The Manager class is the main entry point to work with Kross.It spends an abstraction layer between what is under the hood of Kross and the functionality you need to access. Use Interpreter to just work with some implementated interpreter like python. While Script spends a more flexible container.
Definition at line 54 of file manager.h.
Public Member Functions | |
~Manager () | |
QMap< QString, InterpreterInfo * > | getInterpreterInfos () |
bool | hasInterpreterInfo (const QString &interpretername) const |
InterpreterInfo * | getInterpreterInfo (const QString &interpretername) |
const QString | getInterpreternameForFile (const QString &file) |
KSharedPtr< ScriptContainer > | getScriptContainer (const QString &scriptname) |
Interpreter * | getInterpreter (const QString &interpretername) |
const QStringList | getInterpreters () |
bool | addModule (Module::Ptr module) |
Module::Ptr | loadModule (const QString &modulename) |
Static Public Member Functions | |
static Manager * | scriptManager () |
Protected Member Functions | |
Manager () |
Constructor & Destructor Documentation
Manager::Manager | ( | ) | [protected] |
Constructor.
Use scriptManager() to access the Manager singleton instance.
Definition at line 78 of file manager.cpp.
Manager::~Manager | ( | ) |
Member Function Documentation
Manager * Manager::scriptManager | ( | ) | [static] |
Return the Manager instance.
Always use this function to access the Manager singleton.
Definition at line 67 of file manager.cpp.
QMap< QString, InterpreterInfo * > Manager::getInterpreterInfos | ( | ) |
- Returns:
- a map with InterpreterInfo* instances used to describe interpreters.
Definition at line 127 of file manager.cpp.
bool Manager::hasInterpreterInfo | ( | const QString & | interpretername | ) | const |
- Returns:
- true if there exists an interpreter with the name
interpretername
else false.
Definition at line 132 of file manager.cpp.
InterpreterInfo * Manager::getInterpreterInfo | ( | const QString & | interpretername | ) |
- Returns:
- the InterpreterInfo* matching to the defined
interpretername
or NULL if there does not exists such a interpreter.
Definition at line 137 of file manager.cpp.
const QString Manager::getInterpreternameForFile | ( | const QString & | file | ) |
- Returns:
- the name of the Interpreter that feels responsible for the defined
file
.
- Parameters:
-
file The filename we should try to determinate the interpretername for.
- Returns:
- The name of the Interpreter which will be used to execute the file or QString::null if we failed to determinate a matching interpreter for the file.
Definition at line 142 of file manager.cpp.
ScriptContainer::Ptr Manager::getScriptContainer | ( | const QString & | scriptname | ) |
Return the existing ScriptContainer with scriptname or create a new ScriptContainer instance and associate the passed scriptname with it.
- Parameters:
-
scriptname The name of the script. This should be unique for each Script and could be something like the filename.
- Returns:
- The ScriptContainer instance matching to scriptname.
Definition at line 154 of file manager.cpp.
Interpreter * Manager::getInterpreter | ( | const QString & | interpretername | ) |
Return the Interpreter instance defined by the interpretername.
- Parameters:
-
interpretername The name of the interpreter. e.g. "python" or "kjs".
- Returns:
- The Interpreter instance or NULL if there does not exists an interpreter with such an interpretername.
Definition at line 167 of file manager.cpp.
const QStringList Manager::getInterpreters | ( | ) |
- Returns:
- a list of names of the at the backend supported interpreters.
Definition at line 179 of file manager.cpp.
bool Manager::addModule | ( | Module::Ptr | module | ) |
Add the an external module to the global shared list of loaded modules.
- Parameters:
-
module The Module instace to add.
- Returns:
- true if the module was added successfully else false.
Definition at line 192 of file manager.cpp.
Module::Ptr Manager::loadModule | ( | const QString & | modulename | ) |
Load an external module and return it.
- Parameters:
-
modulename The name of the library we should try to load. Those library needs to be a valid kross module.
- Returns:
- The loaded Object or NULL if loading failed. The loaded Module isn't added to the global shared list of modules.
Definition at line 200 of file manager.cpp.
The documentation for this class was generated from the following files: