KernelServer Class Reference
[Kernel Module]

#include <kernelserver.h>

Inheritance diagram for KernelServer:

Server< KernelServer > GlfwKernelServer

List of all members.


Detailed Description

Central kernel server class.

Manipulating with current working directory is not recomanded in multi threaded applications. Use full paths instead.

Kernel server object must persists throughout the lifetime of the application.

Public Member Functions

 KernelServer ()
virtual ~KernelServer ()
virtual bool Trigger ()
void ProcessArgs (int argc, char *argv[])
string & GetApplicationPath ()
string & GetApplicationName ()
void RegisterModule (void(*module)())
void RegisterClass (const string &name, bool(*init_func)(Class *, KernelServer *), Object *(*new_func)(const char *name))
void AddClass (const char *super_class_name, Class *cl)
void RemClass (Class *cl)
ClassFindClass (const char *class_name)
const HashListGetClassList () const
RootNew (const char *class_name, const string &path, bool fail=true)
RootNew (const string &class_name, const string &path, bool fail=true)
ObjectNewObject (const char *class_name, const char *name, bool fail=true)
ObjectNewObject (const string &class_name, const char *name, bool fail=true)
void PopCwd ()
void PushCwd (Root *node)
void PushCwd (const string &path)
void SetCwd (Root *node)
void SetCwd (const string &path)
RootGetCwd ()
RootLookup (const string &path)
void LogTree ()

Protected Member Functions

 KernelServer (bool init)
void Init ()
void Done ()
void Lock () const
void Unlock () const
void AddNode (Root *node, const string &path="")
RootCheckPath (const string &path, bool create)
bool IsAbsolutePath (const string &path)

Protected Attributes

Rootroot
Mutexmutex
vector< Root * > cwd
string app_path
string app_name
bool inited
HashList class_list


Constructor & Destructor Documentation

KernelServer::KernelServer (  ) 

KernelServer::~KernelServer (  )  [virtual]

KernelServer::KernelServer ( bool  init  )  [protected]


Member Function Documentation

bool KernelServer::Trigger (  )  [virtual]

Reimplemented from Server< KernelServer >.

void KernelServer::ProcessArgs ( int  argc,
char *  argv[] 
)

string & KernelServer::GetApplicationPath (  )  [inline]

string & KernelServer::GetApplicationName (  )  [inline]

void KernelServer::RegisterModule ( void(*)()  module  ) 

Add an extension class module to the kernel. The provided function should call KernelServer::RegisterClass() for each class in the module.

void KernelServer::RegisterClass ( const string &  name,
bool(*)(Class *, KernelServer *)  init_func,
Object *(*)(const char *name)  new_func 
)

Add a new class to the class list. Normally called from the s_init_*() function of a class module.

void KernelServer::AddClass ( const char *  super_class_name,
Class cl 
)

Add a class object to the kernel.

Parameters:
super_class_name Name of super class.
cl Class object to add.

void KernelServer::RemClass ( Class cl  ) 

Remove class object from kernel.

Parameters:
cl Pointer to class to be removed.

Class * KernelServer::FindClass ( const char *  class_name  ) 

Return pointer to class object defined by class name. If the class is not loaded, 0 is returned.

Parameters:
class_name Name of the class.
Returns:
Pointer to class object or NULL.

const HashList* KernelServer::GetClassList (  )  const

Root * KernelServer::New ( const char *  class_name,
const string &  path,
bool  fail = true 
)

Create a object given a class name and a path in the object hierarchy. This method will abort the app with a fatal error if the object couldn't be created.

Parameters:
class_name Name of the object
path Path where to create the new object in the hierarchy
fail Whether application will be interrupted on error.
Returns:
pointer to class object

Root * KernelServer::New ( const string &  class_name,
const string &  path,
bool  fail = true 
) [inline]

Object * KernelServer::NewObject ( const char *  class_name,
const char *  name,
bool  fail = true 
)

Create a named object given a class name. This method will abort the application with a fatal error if the object couldn't be created and fail parameter is set to true.

Parameters:
class_name Class name of the object.
name Name of the object.
fail Whether application will be interrupted on error.
Returns:
Pointer to new object.

Object * KernelServer::NewObject ( const string &  class_name,
const char *  name,
bool  fail = true 
) [inline]

void KernelServer::PopCwd (  )  [inline]

void KernelServer::PushCwd ( Root node  )  [inline]

void KernelServer::PushCwd ( const string &  path  )  [inline]

void KernelServer::SetCwd ( Root node  )  [inline]

void KernelServer::SetCwd ( const string &  path  )  [inline]

Root * KernelServer::GetCwd (  )  [inline]

Root * KernelServer::Lookup ( const string &  path  )  [inline]

void KernelServer::LogTree (  )  [inline]

void KernelServer::Init (  )  [protected]

void KernelServer::Done (  )  [protected]

void KernelServer::Lock (  )  const [inline, protected]

void KernelServer::Unlock (  )  const [inline, protected]

void KernelServer::AddNode ( Root node,
const string &  path = "" 
) [protected]

Root * KernelServer::CheckPath ( const string &  path,
bool  create 
) [protected]

bool KernelServer::IsAbsolutePath ( const string &  path  )  [inline, protected]


Member Data Documentation

Root* KernelServer::root [protected]

Mutex* KernelServer::mutex [protected]

vector<Root *> KernelServer::cwd [protected]

string KernelServer::app_path [protected]

string KernelServer::app_name [protected]

bool KernelServer::inited [protected]

HashList KernelServer::class_list [protected]


The documentation for this class was generated from the following files:
Generated on Sat Oct 20 14:47:32 2007 for Dark Oberon by  doxygen 1.5.3