class ClassInitAttribute

Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::tools::mc::ClassInitAttribute Class Reference

#include <ClassInitAttribute.h>

Inheritance diagram for acdk::tools::mc::ClassInitAttribute:

acdk::tools::mc::CodeAttribute acdk::lang::Object acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch List of all members.

Detailed Description

If a ClazzInfo will be registered (typically when shared library with ACDK objects will be loaded) the given initialization method will be called for static class initialization If the ClazzInfo will be derigistered (shared library will be unloaded) the given deinitialization method will be called.

The initialization and deinitialization methods must be exported DMI-Methods [private/protected/public] static void methodname(); Only one initialization and deinitialization method can be declared per class. The name of the method is either a fully qualified method name (namespace.class.method) or the name of the method only if the method is defined in the attributed class. Sample:

    namespace my {
    namespace package {
    ACDK_CLASSATTRIBUTE(acdk.tools.mc.ClassInitAttribute(: initFunction = my.package.MyClass.classInit))
    class MY_PACKAGE_PUBLIC MyClass
    : extends acdk::lang::Object
      static void classInit() 
        // make class wide initialization here  

Public Member Functions

 ClassInitAttribute (IN(RString) initFunction=Nil, IN(RString) deinitFunction=Nil)
virtual bool apply (IN(RCodeInfo) cm)

Static Public Member Functions

void initAttribute (IN(RMetaCompiler) mc)

Public Attributes

RString _initFunction
RString _deinitFunction

Constructor & Destructor Documentation

acdk::tools::mc::ClassInitAttribute::ClassInitAttribute IN(RString initFunction = Nil,
IN(RString deinitFunction = Nil

Member Function Documentation

virtual bool acdk::tools::mc::ClassInitAttribute::apply IN(RCodeInfo cm  )  [virtual]

Reimplemented from acdk::tools::mc::CodeAttribute.

void acdk::tools::mc::ClassInitAttribute::initAttribute IN(RMetaCompiler mc  )  [static]

Reimplemented from acdk::tools::mc::CodeAttribute.

Member Data Documentation

RString acdk::tools::mc::ClassInitAttribute::_deinitFunction

RString acdk::tools::mc::ClassInitAttribute::_initFunction