Top | ![]() |
![]() |
![]() |
![]() |
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.
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”).
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()
.
factory |
||
network |
A network specifier, such as "tcp/ip" or "jabber". |
|
method_name |
A method identifier, such as "central" or "groupchat". |
|
registry |
A InfCommunicationRegistry at which the created method can register connections. |
|
group |
The InfCommunicationGroup for which to create the method. |
typedef struct _InfCommunicationFactory InfCommunicationFactory;
InfCommunicationFactory is an opaque data type. You should only access it via the public API functions.
struct InfCommunicationFactoryInterface { gboolean (*supports_method)(InfCommunicationFactory* factory, const gchar* network, const gchar* method_name); InfCommunicationMethod* (*instantiate)(InfCommunicationFactory* factory, const gchar* network, const gchar* method_name, InfCommunicationRegistry* registry, InfCommunicationGroup* group); };
The virtual methods of InfCommunicationFactory. These handle instantiating a InfCommunicationMethod for a InfCommunicationGroup.