GUPnP.ResourceFactory¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class GUPnP.ResourceFactory(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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. TheGObject.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:
Get the default singleton
GUPnP.ResourceFactory
object.
- classmethod new()¶
- Returns:
A
GUPnP.ResourceFactory
object.- Return type:
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 requestedGObject.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 ofGObject.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:
upnp_type (
str
) – The UPnP type name of the resource.type (
GObject.GType
) – The requestedGObject.GType
assignment for the resource.
Registers the
GObject.GType
type for the resource of UPnP type upnp_type. After this call, the factory self will create object ofGObject.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
ifGObject.GType
assignment was removed successfully,False
otherwise.- Return type:
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
ifGObject.GType
assignment was removed successfully,False
otherwise.- Return type:
Unregisters the
GObject.GType
assignment for the resource of UPnP type upnp_type.