Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

wvmonikerregistry.h

00001 /* -*- Mode: C++ -*-
00002  * Worldvisions Weaver Software:
00003  *   Copyright (C) 1997-2002 Net Integration Technologies, Inc.
00004  * 
00005  * Support for moniker registries.  See wvmoniker.h.
00006  */
00007 #ifndef __WVMONIKERREGISTRY_H
00008 #define __WVMONIKERREGISTRY_H
00009 
00010 #include "wvmoniker.h"
00011 #include "wvscatterhash.h"
00012 
00018 class WvMonikerRegistry //: public GenericComponent<IObject>
00019 {
00020     struct Registration
00021     {
00022         WvString id;
00023         WvMonikerCreateFunc *func;
00024         
00025         Registration(WvStringParm _id, WvMonikerCreateFunc *_func) 
00026             : id(_id)
00027             { func = _func; }
00028     };
00029     
00030     DeclareWvScatterDict(Registration, WvString, id);
00031 
00032     unsigned refcount;
00033     
00034 public:
00035     UUID reg_iid;
00036     RegistrationDict dict;
00037     
00038     WvMonikerRegistry(const UUID &iid);
00039     virtual ~WvMonikerRegistry();
00040     
00041     virtual void add(WvStringParm id, WvMonikerCreateFunc *func);
00042     virtual void del(WvStringParm id);
00043     
00044     virtual void *create(WvStringParm _s,
00045                          IObject *obj = NULL, void *userdata = NULL);
00046     
00047     // find a registry for objects of the given interface UUID
00048     static WvMonikerRegistry *find_reg(const UUID &iid);
00049     
00050     // IObject stuff
00051     virtual IObject *getInterface(const UUID &uuid);
00052     
00053     // we can't use GenericComponent's implementation, since we have to
00054     // unregister ourselves on the second-last release().
00055     virtual unsigned int addRef();
00056     virtual unsigned int release();
00057 };
00058 
00059 
00060 #endif // __WVMONIKERREGISTRY_H

Generated on Tue Jul 12 02:59:27 2005 for WvStreams by  doxygen 1.4.0