00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef __WVMONIKER_H
00010 #define __WVMONIKER_H
00011
00012 #include "wvstring.h"
00013 #include "wvxplc.h"
00014
00015 class WvMonikerRegistry;
00016
00017 typedef void *WvMonikerCreateFunc(WvStringParm parms, IObject *obj);
00018
00031 class WvMonikerBase
00032 {
00033 protected:
00034 WvMonikerBase(const UUID &iid, WvStringParm _id,
00035 WvMonikerCreateFunc *func, const bool override = false);
00036 ~WvMonikerBase();
00037
00038 public:
00039 WvString id;
00040 WvMonikerRegistry *reg;
00041 };
00042
00043
00060 template <class T>
00061 class WvMoniker : public WvMonikerBase
00062 {
00063 public:
00064 typedef T *CreateFunc(WvStringParm parms, IObject *obj);
00065
00066 WvMoniker(WvStringParm _id, CreateFunc *_func, const bool override = false)
00067 : WvMonikerBase(XPLC_IID<T>::get(), _id, (WvMonikerCreateFunc *)_func,
00068 override)
00069 {
00070
00071
00072
00073
00074 for(IObject *silly = (T *)NULL; silly; )
00075 ;
00076 };
00077 };
00078
00079
00089 void *wvcreate(const UUID &iid, WvStringParm s, IObject *obj);
00090
00091
00103 template <class T>
00104 inline T *wvcreate(WvStringParm s, IObject *obj = 0)
00105 {
00106 return (T *)(wvcreate(XPLC_IID<T>::get(), s, obj));
00107 }
00108
00109
00110 #endif // __WVMONIKER_H