Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

mdynamic.h File Reference

More...

Go to the source code of this file.

Compounds

class  GetClassInstance
 Callback class for retrieving a new instance of the class. More...


Defines

#define BEGIN_NAMESPACE(ns)   namespace ns {
#define decl_dynamic(classname)
#define impl_dynamic(classname, bases)
#define impl_abstract(classname, bases)   Class classname::class_##classname (#classname, #bases, NULL);\
#define newobj(classname)   ((classname*) & ClassLib::getinstance(#classname))
#define dyncreate(classname)   (&ClassLib::getinstance(classname))

Functions

 BEGIN_NAMESPACE (MagiC)


Detailed Description

Definition in file mdynamic.h.


Define Documentation

#define BEGIN_NAMESPACE ns       namespace ns {
 

This file is part of the MagiC++ library.

* * Copyright (C) 1998-2002 Marko Grönroos <magi@iki.fi> * *

* This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, Inc., 59 Temple Place *

  • Suite 330, Boston, MA 02111-1307, USA. * *

Definition at line 29 of file mdynamic.h.

#define decl_dynamic classname   
 

Value:

static Class class_##classname;\
  public:\
    virtual const Class&    getclass    () const {return class_##classname;}\
  protected:
Declares the dynamic features of a class.

This macro should be used in class declaration of a dynamic class.

Definition at line 55 of file mdynamic.h.

#define dyncreate classname       (&ClassLib::getinstance(classname))
 

Creates an object of the given class dynamically.

Definition at line 94 of file mdynamic.h.

#define impl_abstract classname,
bases       Class classname::class_##classname (#classname, #bases, NULL);\
 

Implements the dynamic features of an abstract class.

Definition at line 79 of file mdynamic.h.

#define impl_dynamic classname,
bases   
 

Value:

class GetInstance_##classname : public GetClassInstance {\
      public: Object* getInstance(){return new classname();}\
    };\
    Class   classname::class_##classname (#classname, #bases, new GetInstance_##classname());\
Implements the dynamic features of a class.

This macro should be used in the definition file of a dynamic class.

Definition at line 67 of file mdynamic.h.

#define newobj classname       ((classname*) & ClassLib::getinstance(#classname))
 

Creates an object of the given class dynamically.

Definition at line 89 of file mdynamic.h.


Function Documentation

BEGIN_NAMESPACE MagiC   
 

This file is part of the MagiC++ library.

* * Copyright (C) 1998-2002 Marko Grönroos <magi@iki.fi> * *

* This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, Inc., 59 Temple Place *

  • Suite 330, Boston, MA 02111-1307, USA. * *


Generated on Thu Feb 10 20:06:42 2005 for LibMagiC by doxygen1.2.18