Kernel Module


Detailed Description

Contents

Introduction

Kernel...

Structure

Structure...


Files

file  arg.h
file  class.cpp
file  class.h
file  cmd.h
file  cmdproto.cpp
file  cmdproto.h
file  cmdprotonative.cpp
file  cmdprotonative.h
file  condition.h
file  config.h
 Configuration options for kernel pre-processing.
file  counted.cpp
file  counted.h
file  crc.cpp
file  crc.h
file  debug.cpp
file  debug.h
file  defclass.h
file  directory.cpp
file  directory.h
file  env.cpp
file  env.h
file  env_cmds.cpp
file  file.cpp
file  file.h
file  fileserver.cpp
file  fileserver.h
file  fileserver_cmds.cpp
file  flagged.h
file  hashlist.h
file  hashnode.h
file  hashtable.h
file  kernel.cpp
file  kernelserver.cpp
file  kernelserver.h
file  keyarray.h
file  list.h
file  listnode.h
file  logmacros.h
file  logserver.cpp
file  logserver.h
file  mathlib.h
file  matrix.h
file  matrix33.h
file  matrix44.h
file  memory.cpp
file  memory.h
file  messagereceiver.h
file  messages.h
file  messageserver.cpp
file  messageserver.h
file  mutex.h
file  object.cpp
file  object.h
file  object_cmds.cpp
file  pool.h
file  poolnode.h
file  profiler.cpp
file  profiler.h
file  ref.h
file  referenced.cpp
file  referenced.h
file  root.cpp
file  root.h
file  root_cmds.cpp
file  rootserver.h
file  scriptloader.cpp
file  scriptloader.h
file  scriptserver.cpp
file  scriptserver.h
file  semaphore.h
file  serialized.cpp
file  serialized.h
file  serializer.cpp
file  serializer.h
file  serializeserver.cpp
file  serializeserver.h
file  serializeserver_cmds.cpp
file  server.h
file  strlist.h
file  strnode.h
file  system.h
 Includes all common kernel headers.
file  thread.h
file  threadpool.h
file  threadserver.h
file  timeserver.cpp
file  timeserver.h
file  timeserver_cmds.cpp
file  treenode.h
file  types.h
file  vector.h
file  vector2.h
file  vector3.h
file  vector4.h

Classes

class  Arg
class  Class
class  Cmd
class  CmdProto
class  CmdProtoNative
 A factory for Cmd objects that correspond to natively implemented script commands. More...
class  Condition
 Condition. More...
class  Counted
 Implements counted pointers. More...
class  CRC
class  Directory
 Wrapper for directory functions. More...
class  File
 Wrapper class for accessing file system files. Provides functions for reading and writing files. More...
class  FileServer
 Central server object of file system. Provides functions for creating file and directory objects and assigns. More...
class  Flagged< Type >
 Helps with setting flags. More...
class  HashList
 A doubly linked list of named nodes with fast hashtable based search. More...
class  HashNode
 A node element in a HashList. More...
class  HashTable
 Implements a simple string Hash table. More...
class  KernelServer
 Central kernel server class. More...
class  KeyArray< Type >
 Implements growable array of key-data pairs. The array is kept sorted for fast Find() by key. More...
class  List< Node >
 Implements double linked list. More...
class  SList
 Simple list (not template). More...
class  ListNode< Node >
 Implements a node used with List template. More...
class  SListNode
 Simple list node (not template). More...
class  LogServer
 This server provides logging messages. More...
class  MessageReceiver< Type >
class  BaseMessage
class  Message< Type >
class  Request< Type >
class  Response< Type >
class  Event< Type >
class  EmptyMessage
class  MessageServer
class  Mutex
 Mutex. More...
class  RecMutex
 Recursive mutex. More...
class  Object
class  Pool< Node >
 Pool. More...
class  PoolNode< Node >
 Implements a node used with Pool template. More...
class  Ref< TYPE >
class  Referenced
class  Root
 Defines the basic functionality and interface for object hierarchy. More...
class  RootServer< Node >
 RootServer. More...
class  ScriptLoader
class  ScriptServer
class  Semaphore
 Semaphore. More...
class  Serialized
class  Serializer
class  SerializeServer
class  Server< Node >
 Server. More...
class  StrList
 Implements double linked list of named nodes. More...
class  StrNode
 Implements a named node used with StrList template. More...
class  Thread
 Thread. More...
class  ThreadPool
 ThreadPool. More...
class  ThreadServer
 Threads, mutexes, conditional variables. More...
class  TimeServer
 Time server interface. More...
class  TreeNode< Node >
 Implements a tree node with childrens stored in list. More...

Defines

#define UseModule(module)   extern "C" void module()
#define PrepareRootClass(CLASS, NEWFUNC, INITFUNC, INITCMDSFUNC)
#define PrepareClass(CLASS, SUPERCLASSNAME, NEWFUNC, INITFUNC)
#define PrepareScriptClass(CLASS, SUPERCLASSNAME, NEWFUNC, INITFUNC, INITCMDSFUNC)


Define Documentation

#define PrepareClass ( CLASS,
SUPERCLASSNAME,
NEWFUNC,
INITFUNC   ) 

Value:

extern Object* NEWFUNC(const char *name); \
        extern bool INITFUNC(Class* clazz, KernelServer* kernel_server); \
        \
        Object* NEWFUNC(const char *name) { return NEW CLASS(name); }; \
        \
        bool INITFUNC(Class* clazz, KernelServer* kernel_server) {\
                clazz->SetInstanceSize(sizeof(CLASS)); \
                kernel_server->AddClass(SUPERCLASSNAME, clazz); \
                return true; \
        };
Prepare a simple class without script interface. It takes the C name of the class, a string defining the superclass name, function that creates new instances and initialisation function.

        PrepareClass(TestClass, "ParentClass", s_NewTestClass, s_InitTestClass);

#define PrepareRootClass ( CLASS,
NEWFUNC,
INITFUNC,
INITCMDSFUNC   ) 

Value:

extern Object* NEWFUNC(const char *name); \
        extern bool INITFUNC(Class* clazz, KernelServer* kernel_server); \
        extern void INITCMDSFUNC(Class *); \
        \
        Object* NEWFUNC(const char *name) { return NEW CLASS(name); }; \
        \
        bool INITFUNC(Class* clazz, KernelServer* kernel_server) {\
                clazz->SetInstanceSize(sizeof(CLASS)); \
                INITCMDSFUNC(clazz); \
                return true; \
        };
Special macro for the root class.

        PrepareClass(RootClass, s_NewRootClass, s_InitRootClass);

#define PrepareScriptClass ( CLASS,
SUPERCLASSNAME,
NEWFUNC,
INITFUNC,
INITCMDSFUNC   ) 

Value:

extern Object* NEWFUNC(const char *name); \
        extern bool INITFUNC(Class* clazz, KernelServer* kernel_server); \
        extern void INITCMDSFUNC(Class *); \
        \
        Object* NEWFUNC(const char *name) { return NEW CLASS(name); }; \
        \
        bool INITFUNC(Class* clazz, KernelServer* kernel_server) {\
                clazz->SetInstanceSize(sizeof(CLASS)); \
                kernel_server->AddClass(SUPERCLASSNAME, clazz); \
                INITCMDSFUNC(clazz); \
                return true; \
        };
Prepares a class with script interface. You'll have to provide a function void s_Init*_cmds(Class*). It takes the C name of the class, a string defining the superclass name, function that creates new instances, initialisation function and function that initialise script commands.

        PrepareScriptClass(TestClass, "ParentClass", s_NewTestClass, s_InitTestClass, s_InitTestClass_cmds);

#define UseModule ( module   )     extern "C" void module()

Wraps the module initialization function.

Use like this:

        UseModule(ModuleName);

        void main()
        {
                NEW KernelServer();
                KernelServer::GetInstance()->AddPackage(ModuleName);
        }


Generated on Sat Oct 20 14:47:30 2007 for Dark Oberon by  doxygen 1.5.3