class MAbstractCreator

A pure virtual class that defines an abstract connection creator used by the PeerHood factory. Through this class connections can be created transparently without knowledge of the exact transport medium.

Inheritance:


Public Methods

[more]virtual ~MAbstractCreator()
Default destructor.
[more]virtual MAbstractConnection* CreateConnectionL(const std::string& aProto) = 0
Used to transparently create a new abstract connection object.
[more]virtual MAbstractPinger* CreatePingerL(const std::string& aProto, const std::string& aAddress) = 0
Used to transparently create a new abstract pinger object.
[more]virtual MAbstractMonitor* CreateMonitorL(const std::string& aProto, const std::string& aAddress) = 0
Used to transparently create a new abstract monitor object.
[more]virtual const std::string& GetPrototype() = 0
Returns creator's unique id string.


Documentation

This pure virtual class defines a common interface for all real connection creators. This is one of the base classes of the PeerHood factory that in turn enables transparent use of many concrete transport medias. All real connection creators must inherit this interface. Both this class and also the corresponding connection objects should be compiled into plugin that can be loaded by the PeerHood library. The environment variable PH_PLUGIN_DIR should point to the library's directory. The plugin must be named as <code>XXpeerhood.so</code> so that the PeerHood library can find it.

ovirtual ~MAbstractCreator()
Default destructor. Currently this does nothing but is here because base classes without a destructor are <b><i>evil</i></b>.

Returns:
none

ovirtual MAbstractConnection* CreateConnectionL(const std::string& aProto) = 0
Creates a new connection object of the desired type if the given medium prototype is recognized by this creator. This function should not be called directly; use the PeerHood factory instead.

Parameters:
aProto - Prototype id of the transport medium type.
Returns:
The created connection or NULL if the medium prototype was not recognized by this creator.

ovirtual MAbstractPinger* CreatePingerL(const std::string& aProto, const std::string& aAddress) = 0
Creates a new pinger object of the desired type if the given medium prototype is recognized by this creator. This function should not be called directly; use the PeerHood factory instead.

Parameters:
aProto - Prototype id of the transport medium type.
aAddress - Remote device's address.
Returns:
The created pinger object or NULL if the medium prototype was not recognized by this creator.

ovirtual MAbstractMonitor* CreateMonitorL(const std::string& aProto, const std::string& aAddress) = 0
Creates a new monitor object of the desired type if the given medium prototype is recognized by this creator. This function should not be called directly; use the PeerHood factory instead.

Parameters:
aProto - Prototype id of the transport medium type.
aAddress - Remote device's address.
Returns:
The created monitor object or NULL if the medium prototype was not recognized by this creator.

ovirtual const std::string& GetPrototype() = 0
Returns creator's unique id string. Every creator must have a <b>unique </b> id or disasters will follow. Most likely creator's id is the same as corresponding plugin's id.

Returns:
creator's unique id string


Direct child classes:
CWLANCreator
CLocalCreator
CGPRSCreator
CBTCreator
See Also:
Factory
AbstractConnection

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.