| libinfinity-0.4 Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Prerequisites | Known Implementations | ||||
#include <libinfinity/communication/inf-communication-factory.h>
InfCommunicationFactory;
InfCommunicationFactoryIface;
gboolean inf_communication_factory_supports_method
(InfCommunicationFactory *factory,
const gchar *network,
const gchar *method_name);
InfCommunicationMethod * inf_communication_factory_instantiate
(InfCommunicationFactory *factory,
const gchar *network,
const gchar *method_name,
InfCommunicationRegistry *registry,
InfCommunicationGroup *group);
A InfCommunicationFactory is used by the communication manager to create InfCommunicationMethods. All a factory has to do is to tell whether it supports a specific network and method name combination, and create a corresponding InfCommunicationMethod if it does.
InfCommunicationFactorys are added to a communication manager via
inf_communication_manager_add_factory(). The communication manager will
automatically use the factory if it needs to create a method it supports.
typedef struct _InfCommunicationFactory InfCommunicationFactory;
InfCommunicationFactory is an opaque data type. You should only access it via the public API functions.
typedef struct {
} InfCommunicationFactoryIface;
The virtual methods of InfCommunicationFactory. These handle instantiating a InfCommunicationMethod for a InfCommunicationGroup.
gboolean inf_communication_factory_supports_method (InfCommunicationFactory *factory, const gchar *network, const gchar *method_name);
Returns whether factory supports creating methods that implement
method_name as communication method for connections on network
(see "network").
|
A InfCommunicationFactory. |
|
A network specifier, such as "tcp/ip" or "jabber". |
|
A method identifier, such as "central" or "groupchat". |
Returns : |
Whether factory supports the given network and method name.
|
InfCommunicationMethod * inf_communication_factory_instantiate (InfCommunicationFactory *factory, const gchar *network, const gchar *method_name, InfCommunicationRegistry *registry, InfCommunicationGroup *group);
Creates a new InfCommunicationMethod for network and method_name. The
factory needs to support that method, see
inf_communication_factory_supports_method().
|
A InfCommunicationFactory. |
|
A network specifier, such as "tcp/ip" or "jabber". |
|
A method identifier, such as "central" or "groupchat". |
|
A InfCommunicationRegistry at which the created method can register connections. |
|
The InfCommunicationGroup for which to create the method. |
Returns : |
A new InfCommunicationMethod. |