2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
5 * Support for moniker registries. See wvmoniker.h.
7 #ifndef __WVMONIKERREGISTRY_H
8 #define __WVMONIKERREGISTRY_H
10 #include "wvmoniker.h"
11 #include "wvlinklist.h"
14 * A list for holding moniker-prefix to factory-function mappings.
16 * This is used by WvMoniker and wvcreate(). See those for details.
18 class WvMonikerRegistry
//: public GenericComponent<IObject>
23 WvMonikerCreateFunc
*func
;
25 Registration(WvStringParm _id
, WvMonikerCreateFunc
*_func
)
26 : id(_id
), func(_func
)
30 DeclareWvList(Registration
);
36 RegistrationList list
;
38 WvMonikerRegistry(const UUID
&iid
);
39 virtual ~WvMonikerRegistry();
41 virtual void add(WvStringParm id
, WvMonikerCreateFunc
*func
,
42 const bool override
= false);
43 virtual void del(WvStringParm id
);
45 virtual void *create(WvStringParm _s
, IObject
*_obj
);
47 // find a registry for objects of the given interface UUID
48 static WvMonikerRegistry
*find_reg(const UUID
&iid
);
51 virtual IObject
*getInterface(const UUID
&uuid
);
53 // we can't use GenericComponent's implementation, since we have to
54 // unregister ourselves on the second-last release().
55 virtual unsigned int addRef();
56 virtual unsigned int release();
60 #endif // __WVMONIKERREGISTRY_H