Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

cxx.h File Reference


Detailed Description

C++ UPF headers.

Note:
Don't include this file directly, use <upf/upf.h> instead.
#include <stdio.h>
#include <upf/abi.h>
#include <string>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  upf

Defines

#define UPF_DECLARE_CLASS(classname)
 Declares that a class is available to UPF system.

#define UPF_INTERFACE(iface)
 Declares that the class implements interface iface.

#define UPF_PROPERTY(name, value)
 Assigns property to the class.

#define UPF_REQUIRES_CLASS(classname)
 Declares that class named classname must be available.

#define UPF_IMPLEMENT_CLASS(classname)
 This macro expands to implementation of UPF boilerplate code.

#define UPF_REGISTER_CLASS(classname)
 Register class classname in UPF system.

#define UPF_DLL_MODULE()
 Declarator used to enumerate classes exported from DLL.

#define UPF_EXPORTED_CLASS(classname)
 Declare that class classname should be exported from DLL.

#define UPF_ON_LOAD(func)
 Function func will be called immediately after the DLL module is loaded.

#define UPF_ON_UNLOAD(func)
 Function func will be called before the DLL module is unloaded.


Define Documentation

#define _UPF_DECLARE_CLASS_FRIENDS_DECL classname   
 

Value:

typedef ::upf::StdFactory< classname > _upfFactory; \
        typedef ::upf::ClassRegistrator< classname > _upfRegistrator; \
        friend class _upfFactory; \
        friend class _upfRegistrator;

#define _UPF_DECLARE_CLASS_NO_FRIENDS classname   
 

Value:

private:\
        typedef classname _upfClassType; \
        upf_Object _upf_object; \
        static void _upfMultiPurposeHook(::upf::MultiPurposeHookArgs *data, classname *instance); \
        static void _upf_initClass(::upf::IWriteableClassInfo *classinfo); \
        static ::upf::CID _upf_getCID(); \
        void _upf_initInstance(); \
    public: \
        upf_Object* _upf_getABIObject() { return &_upf_object; } \
        void incRef(); \
        void decRef(); \
        ::upf::InterfacePtr queryInterface(const ::upf::IID& iface); \
        ::upf::CID getClassID();

#define UPF_DECLARE_CLASS classname   
 

Declares that a class is available to UPF system.

This macro will add some internally used variables and implementations of IObject methods. This macro must be part of class declaration.

Example:

    namespace foo { 
      class Bar : public my::IBar  {
        ...
        UPF_DECLARE_CLASS(Bar)
      };
    }

See also:
C++ Tutorial, UPF_IMPLEMENT_CLASS

 
#define UPF_DLL_MODULE  
 

Declarator used to enumerate classes exported from DLL.

The macro expands to code that declares and implements DLL's entry point. An example:

Note:
UPF_BUILDING_MODULE macro must be defined for this macro to be available.
Note:
This macro may be used only once per DLL/shared library. If your module DLL consists of several source files, only one of them can contain UPF_DLL_MODULE block (and it may occur only once in the file, too).
See also:
C++ Tutorial, UPF_EXPORTED_CLASS, UPF_ON_LOAD, UPF_ON_UNLOAD

#define UPF_EXPORTED_CLASS classname   
 

Declare that class classname should be exported from DLL.

For use only inside UPF_DLL_MODULE statement.

Note:
UPF_BUILDING_MODULE macro must be defined for this macro to be available.
See also:
C++ Tutorial, UPF_REGISTER_CLASS

#define UPF_IMPLEMENT_CLASS classname   
 

This macro expands to implementation of UPF boilerplate code.

It must be used for every class that contains UPF_DECLARE_CLASS in its declaration. UPF_IMPLEMENT_CLASS is followed by { } brackets that contains UPF_INTERFACE and UPF_PROPERTY declarations.

    UPF_IMPLEMENT_CLASS(foo::Bar)
    {
      UPF_INTERFACE(my::IBar)

      UPF_PROPERTY("Description", "A simple calculator implementation")
      UPF_PROPERTY("Author",      "Joe Hacker")

      UPF_REQUIRES_CLASS(foo::Helper)
    }

See also:
C++ Tutorial, UPF_DECLARE_CLASS, UPF_PROPERTY, UPF_INTERFACE, UPF_REQUIRES_CLASS

#define UPF_INTERFACE iface   
 

Declares that the class implements interface iface.

Can be only used inside a UPF_IMPLEMENT_CLASS block.

See also:
C++ Tutorial, UPF_IMPLEMENT_CLASS

#define UPF_ON_LOAD func   
 

Function func will be called immediately after the DLL module is loaded.

For use only inside UPF_DLL_MODULE statement. func may either return bool value (the module won't be loaded if any of UPF_ON_LOAD functions return false) or not return any value.

Note:
UPF_BUILDING_MODULE macro must be defined for this macro to be available.
This function is called before classes from this module are registered in UPF registry!
See also:
C++ Tutorial, UPF_REGISTER_CLASS, UPF_ON_UNLOAD

#define UPF_ON_UNLOAD func   
 

Function func will be called before the DLL module is unloaded.

For use only inside UPF_DLL_MODULE statement. func may either return bool value (the module won't be loaded if any of UPF_ON_LOAD functions return false) or not return any value.

Note:
UPF_BUILDING_MODULE macro must be defined for this macro to be available.
See also:
C++ Tutorial, UPF_REGISTER_CLASS, UPF_ON_LOAD

#define UPF_PROPERTY name,
value   
 

Assigns property to the class.

Can be only used inside a UPF_IMPLEMENT_CLASS block.

See also:
C++ Tutorial, UPF_IMPLEMENT_CLASS, Properties

#define UPF_REGISTER_CLASS classname   
 

Register class classname in UPF system.

You must either call this macro or use runtime-loaded DLL and UPF_DLL_MODULE macro, otherwise the class won't be visible in UPF! Example:

    upf::init();
    UPF_REGISTER_CLASS(MyClass);
    ...

See also:
UPF_DLL_MODULE, UPF_EXPORTED_CLASS

#define UPF_REQUIRES_CLASS classname   
 

Declares that class named classname must be available.

(I.e. call to upf::create("classname") would create its instance.) If this condition is not met, the class will not be registered in UPF classes registry.

Parameters:
classname  Name of required class in C++ syntax, without quotes. An example:
           UPF_REQUIRES_CLASS(upf::impl::ServiceManager)
Todo:
NOT YET IMPLEMENTED!
See also:
C++ Tutorial, UPF_IMPLEMENT_CLASS


Generated on Wed Jan 15 23:10:55 2003 for Universal Plugins Framework by doxygen1.2.18