Make WvStreams compile with gcc 4.4.
[wvstreams.git] / include / wvmonikerregistry.h
blobbb8b4c51669d8ff4ce593f8e8c9c7dfba22e503b
1 /* -*- Mode: C++ -*-
2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
4 *
5 * Support for moniker registries. See wvmoniker.h.
6 */
7 #ifndef __WVMONIKERREGISTRY_H
8 #define __WVMONIKERREGISTRY_H
10 #include "wvmoniker.h"
11 #include "wvlinklist.h"
13 /**
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>
20 struct Registration
22 WvString id;
23 WvMonikerCreateFunc *func;
25 Registration(WvStringParm _id, WvMonikerCreateFunc *_func)
26 : id(_id), func(_func)
27 { }
30 DeclareWvList(Registration);
32 unsigned refcount;
34 public:
35 UUID reg_iid;
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);
50 // IObject stuff
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