VRUT::GeneralManager Class Reference

Server managing any module that was created as general. More...

#include <generalmanager.h>

Inheritance diagram for VRUT::GeneralManager:

VRUT::ServerBase< T >

List of all members.

Public Member Functions

 GeneralManager ()
 Class constructor.
virtual ~GeneralManager ()
 Class destructor.
virtual size_t AddAvailableModules (const wxString &pathToModules)
 Update lists of currently available modules - ServerBase overload.
MODULE_ID RunModule (const wxString &moduleName)
 Find and create module, then start its thread.


Detailed Description

Server managing any module that was created as general.

Definition at line 24 of file generalmanager.h.


Constructor & Destructor Documentation

GeneralManager::GeneralManager (  ) 

Class constructor.

Definition at line 20 of file generalmanager.cpp.

GeneralManager::~GeneralManager (  )  [virtual]

Class destructor.

Definition at line 25 of file generalmanager.cpp.

00026 {
00027 }


Member Function Documentation

size_t GeneralManager::AddAvailableModules ( const wxString &  pathToModules  )  [virtual]

Update lists of currently available modules - ServerBase overload.

Reimplemented from VRUT::ServerBase< T >.

Definition at line 30 of file generalmanager.cpp.

00031 {
00032        size_t count = ServerBase<Module>::AddAvailableModules(pathToModules);
00033        wxDir dir(pathToModules);
00034        wxString dirName;
00035        bool ok = dir.GetFirst(&dirName, wxEmptyString, wxDIR_DIRS);
00036        while (ok)
00037        {
00038               count += ServerBase<Module>::AddAvailableModules(pathToModules + wxT("/") + dirName);
00039               ok = dir.GetNext(&dirName);
00040        }
00041 
00042        return count;
00043 }

MODULE_ID GeneralManager::RunModule ( const wxString &  moduleName  ) 

Find and create module, then start its thread.

Create module instance

Set scene manager if module is of scene type

Set kernel if module is of kernel type

Definition at line 46 of file generalmanager.cpp.

00047 {
00049        MODULE_ID moduleID = createModuleInstance(moduleName);
00050        Module * module = getModule(moduleID);
00051        if (!module)
00052        {
00053               LOGERROR(wxString::Format(wxT("<GeneralManager>Module '%s' could not be started"), moduleName.c_str()));
00054               return MODULE_ID_NONE;
00055        }
00057        if (module->IsOfType(MODULE_TYPE_SCENE))
00058               ((SceneModule *)module)->SetSceneMgr(KERNEL->sceneManager);
00060        if (module->IsOfType(MODULE_TYPE_KERNEL))
00061        {
00062               ((KernelModule *)module)->SetKernel(KERNEL);
00063               KERNEL->GetMessageSink()->RegisterKernelModule(moduleID);
00064        }
00065        ModuleHandle<Module>::StartModuleThread(module);
00066 
00067        return moduleID;
00068 }


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

Generated on Tue Mar 10 14:41:42 2009 for VRUT by  doxygen 1.5.5