Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members  

IMoniker Class Reference

An interface for obtaining an IObject given a moniker string. More...

Inheritance diagram for IMoniker:

IObject IMonikerService List of all members.

Public Methods

virtual IObjectresolve (const char *moniker)=0
 Given a moniker string, return the IObject it refers to, or NULL if no objects match.

virtual unsigned int addRef ()=0
 Indicate you are using this object.

virtual unsigned int release ()=0
 Indicate that you are finished using this object.

virtual IObjectgetInterface (const UUID &)=0
 Returns the requested XPLC interface.

virtual IWeakRefgetWeakRef ()=0
 Return a weak reference to this object.


Detailed Description

An interface for obtaining an IObject given a moniker string.

A moniker can be used to obtain a particular object using a human-readable string to describe it, rather than having to know the object's UUID. Human-readable strings are, unfortunately, not guaranteed to be universally unique, so you might (theoretically) not get the object you want.

You can retrieve the standard XPLC moniker service from the service manager using the XPLC_monikers UUID, which can then be used to resolve monikers and register your own using the IMonikerService interface it provides.

Note that XPLC::get() and XPLC::create() are a convenient interface to the XPLC moniker system.


Member Function Documentation

virtual unsigned int IObject::addRef   [pure virtual, inherited]
 

Indicate you are using this object.

This increases the reference count of the object by one. Usually, when the reference count reaches zero, the object is freed automatically.

This called a "strong reference", because they will prevent the object from being destroyed. They should thus be used carefully, as they control the lifetime of the object. For example, you do not need to call addRef() on object passed as parameters, unless you intend on keeping them.

addRef() is often called automatically for you in XPLC, but you'll have to call release() by hand sometimes unless you use xplc_ptr.

virtual IObject* IObject::getInterface const UUID &    [pure virtual, inherited]
 

Returns the requested XPLC interface.

Will return NULL if the interface is not supported. The returned interface has been addRef()ed, so you will need to release() it when done. Note that the interface returned may be a pointer to the same object or a different one - that's none of your business. Asking for the IObject interface should always return the same pointer for a given logical object, so this can be used for comparison by identity.

You should probably use the convenient mutate() and get() functions instead of this, or use an xplc_ptr, which mutates the object for you.

virtual IWeakRef* IObject::getWeakRef   [pure virtual, inherited]
 

Return a weak reference to this object.

A weak reference points at the object, but does not control the lifetime of the object. An object can thus still be deleted while someone holds a weak reference. You will still need to release() the weak reference when you are done with it.

See also:
IWeakRef

virtual unsigned int IObject::release   [pure virtual, inherited]
 

Indicate that you are finished using this object.

This decreases the reference count of the object by one. Usually, when the reference count reaches zero, the object is freed automatically.

You will usually need to manually release() any object given to you by any other XPLC function, unless you give the object to someone else who will call release.

If you use xplc_ptr, it will do this for you.

virtual IObject* IMoniker::resolve const char *    moniker [pure virtual]
 

Given a moniker string, return the IObject it refers to, or NULL if no objects match.

The returned object is already addRef()'d.


The documentation for this class was generated from the following file:
Generated on Sun Sep 26 04:01:44 2004 for XPLC by doxygen1.2.18