GUPnP.ResourceFactory

g GObject.Object GObject.Object GUPnP.ResourceFactory GUPnP.ResourceFactory GObject.Object->GUPnP.ResourceFactory

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

get_default ()

class

new ()

register_resource_proxy_type (upnp_type, type)

register_resource_type (upnp_type, type)

unregister_resource_proxy_type (upnp_type)

unregister_resource_type (upnp_type)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class GUPnP.ResourceFactory(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

GUPnP.ResourceFactoryClass

Associating custom Services, Devices, ServiceProxies and DeviceProxies with UPnP types.

GUPnP.ResourceFactory objects are used by [class`GUPnP`.ControlPoint], [class`GUPnP`.DeviceProxy] and [class`GUPnP`.Device] to create resource proxy and resource objects.

Register UPnP type - [alias`GLib`.Type] pairs to have resource or resource proxy objects created with the specified GObject.GType whenever an object for a resource of the specified UPnP type is requested. The GObject.GType needs to be derived from the relevant resource or resource proxy type (e.g. a device proxy type needs to be derived from [class`GUPnP`.DeviceProxy]).

classmethod get_default()
Returns:

A GUPnPResourceFactory object.

Return type:

GUPnP.ResourceFactory

Get the default singleton GUPnP.ResourceFactory object.

classmethod new()
Returns:

A GUPnP.ResourceFactory object.

Return type:

GUPnP.ResourceFactory

Create a new GUPnP.ResourceFactory object.

register_resource_proxy_type(upnp_type, type)
Parameters:
  • upnp_type (str) – The UPnP type name of the resource.

  • type (GObject.GType) – The requested GObject.GType assignment for the resource proxy.

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

Note: GObject.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.

register_resource_type(upnp_type, type)
Parameters:

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

You can either register a type for a concrete version of a device or service such as urn:schemas-upnp-org:py:data::service<GUPnP.ResourceFactory.props.service>:AVTransport:2 or version-independently, urn:schemas-upnp-org:py:data::service<GUPnP.ResourceFactory.props.service>:AVTransport. If you register for an explicit version of a service, it will be an exact match.

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

unregister_resource_proxy_type(upnp_type)
Parameters:

upnp_type (str) – The UPnP type name of the resource.

Returns:

True if GObject.GType assignment was removed successfully, False otherwise.

Return type:

bool

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

unregister_resource_type(upnp_type)
Parameters:

upnp_type (str) – The UPnP type name of the resource.

Returns:

True if GObject.GType assignment was removed successfully, False otherwise.

Return type:

bool

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