lib

#include <manager.h>

Inheritance diagram for Kross::Api::Manager:
Kross::Api::MainModule Kross::Api::Module Kross::Api::Class< Module > Kross::Api::Event< Module > Kross::Api::Callable Kross::Api::Object

Public Member Functions

 ~Manager ()
TQMap< TQString, InterpreterInfo * > getInterpreterInfos ()
bool hasInterpreterInfo (const TQString &interpretername) const
InterpreterInfo * getInterpreterInfo (const TQString &interpretername)
const TQString getInterpreternameForFile (const TQString &file)
TDESharedPtr< ScriptContainer > getScriptContainer (const TQString &scriptname)
Interpreter * getInterpreter (const TQString &interpretername)
const TQStringList getInterpreters ()
bool addModule (Module::Ptr module)
Module::Ptr loadModule (const TQString &modulename)
Public Member Functions inherited from Kross::Api::MainModule
 MainModule (const TQString &name)
virtual ~MainModule ()
virtual const TQString getClassName () const
bool hadException ()
Exception::Ptr getException ()
void setException (Exception::Ptr exception)
EventSignal::Ptr addSignal (const TQString &name, TQObject *sender, TQCString signal)
EventSlot::Ptr addSlot (const TQString &name, TQObject *receiver, TQCString slot)
QtObject::Ptr addTQObject (TQObject *object, const TQString &name=TQString())
EventAction::Ptr addTDEAction (TDEAction *action, const TQString &name=TQString())
Public Member Functions inherited from Kross::Api::Module
 Module (const TQString &name)
virtual ~Module ()
virtual Kross::Api::Object::Ptr get (const TQString &, void *=0)
Public Member Functions inherited from Kross::Api::Class< Module >
 Class (const TQString &name)
virtual ~Class ()
 operator Module * ()
Public Member Functions inherited from Kross::Api::Event< Module >
 Event (const TQString &name)
virtual ~Event ()
void addFunction (const TQString &name, FunctionPtr function)
void addFunction4 (const TQString &name, INSTANCE *instance, METHOD method, ARG1OBJ *arg1=0, ARG2OBJ *arg2=0, ARG3OBJ *arg3=0, ARG4OBJ *arg4=0)
void addFunction3 (const TQString &name, INSTANCE *instance, METHOD method, ARG1OBJ *arg1=0, ARG2OBJ *arg2=0, ARG3OBJ *arg3=0)
void addFunction2 (const TQString &name, INSTANCE *instance, METHOD method, ARG1OBJ *arg1=0, ARG2OBJ *arg2=0)
void addFunction1 (const TQString &name, INSTANCE *instance, METHOD method, ARG1OBJ *arg1=0)
void addFunction0 (const TQString &name, INSTANCE *instance, METHOD method)
bool isAFunction (const TQString &name) const
virtual Object::Ptr call (const TQString &name, List::Ptr arguments)
Public Member Functions inherited from Kross::Api::Callable
 Callable (const TQString &name)
virtual ~Callable ()
const TQString getName () const
bool hasChild (const TQString &name) const
Object::Ptr getChild (const TQString &name) const
TQMap< TQString, Object::Ptr > getChildren () const
bool addChild (const TQString &name, Object *object)
bool addChild (Callable *object)
void removeChild (const TQString &name)
void removeAllChildren ()
Public Member Functions inherited from Kross::Api::Object
 Object ()
virtual ~Object ()
virtual const TQString toString ()
virtual Object::Ptr call (const TQString &name, TDESharedPtr< List > arguments)
virtual TQStringList getCalls ()

Static Public Member Functions

static Manager * scriptManager ()
Static Public Member Functions inherited from Kross::Api::Class< Module >
static Object::Ptr toObject (TYPE t)
Static Public Member Functions inherited from Kross::Api::Object
template<class T>
static T * fromObject (Object::Ptr object)
template<typename TYPE>
static Object::Ptr toObject (TYPE t)

Protected Member Functions

 Manager ()

Additional Inherited Members

Public Types inherited from Kross::Api::MainModule
typedef TDESharedPtr< MainModule > Ptr
Public Types inherited from Kross::Api::Module
typedef TDESharedPtr< Module > Ptr
Public Types inherited from Kross::Api::Class< Module >
typedef TDESharedPtr< Module > Ptr
Public Types inherited from Kross::Api::Callable
typedef TDESharedPtr< Callable > Ptr
Public Types inherited from Kross::Api::Object
typedef TDESharedPtr< Object > Ptr

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.

Constructor & Destructor Documentation

◆ Manager()

Manager::Manager ( )
protected

Constructor.

Use scriptManager() to access the Manager singleton instance.

Definition at line 78 of file manager.cpp.

◆ ~Manager()

Manager::~Manager ( )

Destructor.

Definition at line 120 of file manager.cpp.

Member Function Documentation

◆ addModule()

bool Manager::addModule ( Module::Ptr module)

Add the an external module to the global shared list of loaded modules.

Parameters
moduleThe Module instace to add.
Returns
true if the module was added successfully else false.

Definition at line 192 of file manager.cpp.

◆ getInterpreter()

Interpreter * Manager::getInterpreter ( const TQString & interpretername)

Return the Interpreter instance defined by the interpretername.

Parameters
interpreternameThe 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.

◆ getInterpreterInfo()

InterpreterInfo * Manager::getInterpreterInfo ( const TQString & 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.

◆ getInterpreterInfos()

TQMap< TQString, InterpreterInfo * > Manager::getInterpreterInfos ( )
Returns
a map with InterpreterInfo* instances used to describe interpreters.

Definition at line 127 of file manager.cpp.

◆ getInterpreternameForFile()

const TQString Manager::getInterpreternameForFile ( const TQString & file)
Returns
the name of the Interpreter that feels responsible for the defined file .
Parameters
fileThe filename we should try to determinate the interpretername for.
Returns
The name of the Interpreter which will be used to execute the file or TQString() if we failed to determinate a matching interpreter for the file.

Definition at line 142 of file manager.cpp.

◆ getInterpreters()

const TQStringList Manager::getInterpreters ( )
Returns
a list of names of the at the backend supported interpreters.

Definition at line 179 of file manager.cpp.

◆ getScriptContainer()

ScriptContainer::Ptr Manager::getScriptContainer ( const TQString & scriptname)

Return the existing ScriptContainer with scriptname or create a new ScriptContainer instance and associate the passed scriptname with it.

Parameters
scriptnameThe 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.

◆ hasInterpreterInfo()

bool Manager::hasInterpreterInfo ( const TQString & interpretername) const
Returns
true if there exists an interpreter with the name interpretername else false.

Definition at line 132 of file manager.cpp.

◆ loadModule()

Module::Ptr Manager::loadModule ( const TQString & modulename)

Load an external module and return it.

Parameters
modulenameThe 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.

◆ scriptManager()

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.


The documentation for this class was generated from the following files: