GUPnPResourceFactory

GUPnPResourceFactory — Class for resource and resource proxy object creation.

Synopsis




                    GUPnPResourceFactory;
                    GUPnPResourceFactoryClass;
GUPnPResourceFactory* gupnp_resource_factory_new        (void);
GUPnPResourceFactory* gupnp_resource_factory_get_default
                                                        (void);
void                gupnp_resource_factory_register_resource_type
                                                        (GUPnPResourceFactory *factory,
                                                         const char *upnp_type,
                                                         GType type);
gboolean            gupnp_resource_factory_unregister_resource_type
                                                        (GUPnPResourceFactory *factory,
                                                         const char *upnp_type);
void                gupnp_resource_factory_register_resource_proxy_type
                                                        (GUPnPResourceFactory *factory,
                                                         const char *upnp_type,
                                                         GType type);
gboolean            gupnp_resource_factory_unregister_resource_proxy_type
                                                        (GUPnPResourceFactory *factory,
                                                         const char *upnp_type);


Description

GUPnPResourceFactory objects are used by GUPnPControlPoint, GUPnPDeviceProxy and GUPnPDevice to create resource proxy and resource objects. Register UPnP type - GType pairs to have resource or resource proxy objects created with the specified GType whenever an object for a resource of the specified UPnP type is requested. The GTypes need to be derived from the relevant resource or resource proxy type (e.g. a device proxy type needs to be derived from GUPnPDeviceProxy).

Details

GUPnPResourceFactory

typedef struct {
        GObject parent;

        GUPnPResourceFactoryPrivate *priv;
} GUPnPResourceFactory;


GUPnPResourceFactoryClass

typedef struct {
        GObjectClass parent_class;

        /* future padding */
        void (* _gupnp_reserved1) (void);
        void (* _gupnp_reserved2) (void);
        void (* _gupnp_reserved3) (void);
        void (* _gupnp_reserved4) (void);
} GUPnPResourceFactoryClass;


gupnp_resource_factory_new ()

GUPnPResourceFactory* gupnp_resource_factory_new        (void);

Returns : A new GUPnPResourceFactory object.

gupnp_resource_factory_get_default ()

GUPnPResourceFactory* gupnp_resource_factory_get_default
                                                        (void);

Returns : The default singleton GUPnPResourceFactory object.

gupnp_resource_factory_register_resource_type ()

void                gupnp_resource_factory_register_resource_type
                                                        (GUPnPResourceFactory *factory,
                                                         const char *upnp_type,
                                                         GType type);

Registers the GType type for the resource of UPnP type upnp_type. After this call, the factory factory will create object of GType type each time it is asked to create a resource object for UPnP type upnp_type.

Note: GType type must be a derived type of GUPNP_TYPE_DEVICE if resource is a device or GUPNP_TYPE_SERVICE if its a service.

factory : A GUPnPResourceFactory.
upnp_type : The UPnP type name of the resource.
type : The requested GType assignment for the resource.

gupnp_resource_factory_unregister_resource_type ()

gboolean            gupnp_resource_factory_unregister_resource_type
                                                        (GUPnPResourceFactory *factory,
                                                         const char *upnp_type);

Unregisters the GType assignment for the resource of UPnP type upnp_type.

factory : A GUPnPResourceFactory.
upnp_type : The UPnP type name of the resource.
Returns : TRUE if GType assignment was removed successfully, FALSE otherwise.

gupnp_resource_factory_register_resource_proxy_type ()

void                gupnp_resource_factory_register_resource_proxy_type
                                                        (GUPnPResourceFactory *factory,
                                                         const char *upnp_type,
                                                         GType type);

Registers the GType type for the proxy of resource of UPnP type upnp_type. After this call, the factory factory will create object of GType type each time it is asked to create a resource proxy object for UPnP type upnp_type.

Note: GType type must be a derived type of GUPNP_TYPE_DEVICE_PROXY if resource is a device or GUPNP_TYPE_SERVICE_PROXY if its a service.

factory : A GUPnPResourceFactory.
upnp_type : The UPnP type name of the resource.
type : The requested GType assignment for the resource proxy.

gupnp_resource_factory_unregister_resource_proxy_type ()

gboolean            gupnp_resource_factory_unregister_resource_proxy_type
                                                        (GUPnPResourceFactory *factory,
                                                         const char *upnp_type);

Unregisters the GType assignment for the proxy of resource of UPnP type upnp_type.

factory : A GUPnPResourceFactory.
upnp_type : The UPnP type name of the resource.
Returns : TRUE if GType assignment was removed successfully, FALSE otherwise.