WvStreams
Public Member Functions
IServiceManager Interface Reference

The XPLC service manager interface. More...

#include <xplc/IServiceManager.h>

Inheritance diagram for IServiceManager:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void addHandler (IServiceHandler *)=0
 Register a handler to be handled by this manager.
virtual void addFirstHandler (IServiceHandler *)=0
 Register a handler to be handled by this manager, explicitly adding it to the beginning of the list (highest priority).
virtual void addLastHandler (IServiceHandler *)=0
 Register a handler to be handled by this manager, explicitly adding it to the end of the list (lowest priority).
virtual void removeHandler (IServiceHandler *)=0
 Remove a handler from the list.
virtual IObjectgetObject (const UUID &)=0
 Get the object corresponding to the given UUID.
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

The XPLC service manager interface.

To do anything with XPLC, you need to use the service manager. You can obtain it by calling XPLC_getServiceManager().

The service manager knows how to find objects from their UUID. It does so by searching a list of service handlers (objects that implement the IServiceHandler interface), querying them in turn until the object is found.

The service handlers are those who know how to find objects through various means. For example, one might get objects from a statically defined list of objects, another might search a directory for plugins, etc...

If you want to provide an IServiceHandler, you should register with the service manager.

Definition at line 58 of file IServiceManager.h.


Member Function Documentation

virtual IObject* IServiceHandler::getObject ( const UUID ) [pure virtual, inherited]

Get the object corresponding to the given UUID.

The returned object is already addRef()ed. Returns NULL if there is no matching object.

Implemented in ModuleManager, Module, ServiceManager, and StaticServiceHandler.

Referenced by ServiceManager::getObject(), ModuleManager::getObject(), NewMoniker::resolve(), and MonikerService::resolve().

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.

Referenced by WvIStreamList::execute(), IObjectImplInternal::getInterface(), StaticServiceHandler::getObject(), WeakRef::getObject(), WvIStreamList::post_select(), WvQtStreamClone::WvQtStreamClone(), and WvSSLStream::WvSSLStream().

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.

Referenced by WvIStreamList::execute(), mutate(), NewMoniker::resolve(), and MonikerService::resolve().

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.

Referenced by mutate().

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

The documentation for this interface was generated from the following file: