Libosinfo.List

g GObject.Object GObject.Object Libosinfo.List Libosinfo.List GObject.Object->Libosinfo.List

Subclasses:

Libosinfo.DatamapList, Libosinfo.DeploymentList, Libosinfo.DeviceDriverList, Libosinfo.DeviceLinkList, Libosinfo.DeviceList, Libosinfo.FirmwareList, Libosinfo.ImageList, Libosinfo.InstallConfigParamList, Libosinfo.InstallScriptList, Libosinfo.MediaList, Libosinfo.OsVariantList, Libosinfo.ProductList, Libosinfo.ResourcesList, Libosinfo.TreeList

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

add (entity)

add_all (source)

add_filtered (source, filter)

add_intersection (sourceOne, sourceTwo)

add_union (sourceOne, sourceTwo)

find_by_id (id)

get_element_type ()

get_elements ()

get_length ()

get_nth (idx)

new_copy ()

new_filtered (filter)

new_intersection (sourceTwo)

new_union (sourceTwo)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

element-type

GObject.GType

r/w/co

List element type

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Libosinfo.List(**kwargs)
Bases:

GObject.Object

Abstract:

Yes

Structure:

Libosinfo.ListClass

add(entity)
Parameters:

entity (Libosinfo.Entity) – the entity to add to the list

Adds a new entity to the list.

add_all(source)
Parameters:

source (Libosinfo.List) – the list to add

Adds all entities from source to self. Using one of the constructors in a subclass is preferable to this method.

add_filtered(source, filter)
Parameters:

Adds all entities from source which are matched by filter. Using one of the constructors in a subclass is preferable to this method.

add_intersection(sourceOne, sourceTwo)
Parameters:

Computes the intersection between sourceOne and sourceTwo and adds the resulting list of entities to the self. Using one of the constructors in a subclass is preferable to this method.

add_union(sourceOne, sourceTwo)
Parameters:

Computes the union between sourceOne and sourceTwo and adds the resulting list of entities to the self. Using one of the constructors in a subclass is preferable to this method.

find_by_id(id)
Parameters:

id (str) – the unique identifier

Returns:

the matching entity, or None

Return type:

Libosinfo.Entity

Search the list looking for the entity with a matching unique identifier.

get_element_type()
Returns:

the type of entity stored

Return type:

GObject.GType

Retrieves the type of the subclass of Libosinfo.Entity that may be stored in the list

get_elements()
Returns:

the list elements

Return type:

[Libosinfo.Entity]

Retrieve a linked list of all elements in the list.

get_length()
Returns:

the list length

Return type:

int

Retrieves the number of elements currently stored in the list

get_nth(idx)
Parameters:

idx (int) – the list position to fetch

Returns:

the list element or None

Return type:

Libosinfo.Entity

Retrieves the element in the list at position idx. If idx is less than zero, or greater than the number of elements in the list, the results are undefined.

new_copy()
Returns:

a copy of the list

Return type:

Libosinfo.List

Construct a new list that is filled with elements from self

New in version 0.2.2.

new_filtered(filter)
Parameters:

filter (Libosinfo.Filter) – the filter to apply

Returns:

a filtered copy of the list

Return type:

Libosinfo.List

Construct a new list that is filled with elements from self that match filter

New in version 0.2.2.

new_intersection(sourceTwo)
Parameters:

sourceTwo (Libosinfo.List) – the second list to copy

Returns:

an intersection of the two lists

Return type:

Libosinfo.List

Construct a new list that is filled with only the elements that are present in both self and sourceTwo.

New in version 0.2.2.

new_union(sourceTwo)
Parameters:

sourceTwo (Libosinfo.List) – the second list to copy

Returns:

a union of the two lists

Return type:

Libosinfo.List

Construct a new list that is filled with all the that are present in either self and sourceTwo. self and sourceTwo must be of the same type.

New in version 0.2.2.

Property Details

Libosinfo.List.props.element_type
Name:

element-type

Type:

GObject.GType

Default Value:

<GType OsinfoEntity>

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The specialization of the list. The list will be restricted to storing Libosinfo.Entity objects of the specified type.