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