OsinfoList

## OsinfoList OsinfoList — Abstract base class for entity lists |

## Synopsis

    struct              OsinfoList;
    struct              OsinfoListClass;
    GType               osinfo_list_get_element_type        (OsinfoList *list);
    gint                osinfo_list_get_length              (OsinfoList *list);
    OsinfoEntity *      osinfo_list_get_nth                 (OsinfoList *list,
                                                             gint idx);
    OsinfoEntity *      osinfo_list_find_by_id              (OsinfoList *list,
                                                             const gchar *id);
    GList *             osinfo_list_get_elements            (OsinfoList *list);
    void                osinfo_list_add                     (OsinfoList *list,
                                                             OsinfoEntity *entity);
    void                osinfo_list_add_filtered            (OsinfoList *list,
                                                             OsinfoList *source,
                                                             OsinfoFilter *filter);
    void                osinfo_list_add_intersection        (OsinfoList *list,
                                                             OsinfoList *sourceOne,
                                                             OsinfoList *sourceTwo);
    void                osinfo_list_add_union               (OsinfoList *list,
                                                             OsinfoList *sourceOne,
                                                             OsinfoList *sourceTwo);
    void                osinfo_list_add_all                 (OsinfoList *list,
                                                             OsinfoList *source);
    OsinfoList *        osinfo_list_new_copy                (OsinfoList *source);
    OsinfoList *        osinfo_list_new_filtered            (OsinfoList *source,
                                                             OsinfoFilter *filter);
    OsinfoList *        osinfo_list_new_intersection        (OsinfoList *sourceOne,
                                                             OsinfoList *sourceTwo);
    OsinfoList *        osinfo_list_new_union               (OsinfoList *sourceOne,
                                                             OsinfoList *sourceTwo);

## Object Hierarchy

      GObject
       +----OsinfoList
             +----OsinfoDatamapList
             +----OsinfoDeploymentList
             +----OsinfoDeviceDriverList
             +----OsinfoDeviceLinkList
             +----OsinfoDeviceList
             +----OsinfoInstallConfigParamList
             +----OsinfoInstallScriptList
             +----OsinfoMediaList
             +----OsinfoProductList
             +----OsinfoResourcesList
             +----OsinfoTreeList

## Properties

      "element-type"             GType*                : Read / Write / Construct Only

## Description

OsinfoList provides a way to maintain a list of OsinfoEntity objects.

## Details

### struct OsinfoList

    struct OsinfoList;

### struct OsinfoListClass

    struct OsinfoListClass {
    };

### osinfo_list_get_element_type ()

    GType               osinfo_list_get_element_type        (OsinfoList *list);

Retrieves the type of the subclass of OsinfoEntity that may be stored in the list

`list` : | the entity list
Returns : | the type of entity stored

### osinfo_list_get_length ()

    gint                osinfo_list_get_length              (OsinfoList *list);

Retrieves the number of elements currently stored in the list

`list` : | the entity list
Returns : | the list length

### osinfo_list_get_nth ()

    OsinfoEntity *      osinfo_list_get_nth                 (OsinfoList *list,
                                                             gint idx);

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.

`list` : | the entity list
`idx` : | the list position to fetch
Returns : | the list element. [transfer none]

### osinfo_list_find_by_id ()

    OsinfoEntity *      osinfo_list_find_by_id              (OsinfoList *list,
                                                             const gchar *id);

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

`list` : | the entity list
`id` : | the unique identifier
Returns : | the matching entity, or NULL. [transfer none]

### osinfo_list_get_elements ()

    GList *             osinfo_list_get_elements            (OsinfoList *list);

Retrieve a linked list of all elements in the list.

`list` : | the entity list
Returns : | the list elements. [transfer container][element-type OsinfoEntity]

### osinfo_list_add ()

    void                osinfo_list_add                     (OsinfoList *list,
                                                             OsinfoEntity *entity);

Adds a new entity to the list.

`list` : | the entity list
`entity` : | the entity to add to the list. [transfer none]

### osinfo_list_add_filtered ()

    void                osinfo_list_add_filtered            (OsinfoList *list,
                                                             OsinfoList *source,
                                                             OsinfoFilter *filter);

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

`list` : | the entity list
`source` : | the source for elements. [transfer none]
`filter` : | filter to process the source with. [transfer none]

### osinfo_list_add_intersection ()

    void                osinfo_list_add_intersection        (OsinfoList *list,
                                                             OsinfoList *sourceOne,
                                                             OsinfoList *sourceTwo);

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

`list` : | the entity list
`sourceOne` : | the first list to add. [transfer none]
`sourceTwo` : | the second list to add. [transfer none]

### osinfo_list_add_union ()

    void                osinfo_list_add_union               (OsinfoList *list,
                                                             OsinfoList *sourceOne,
                                                             OsinfoList *sourceTwo);

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

`list` : | the entity list
`sourceOne` : | the first list to add. [transfer none]
`sourceTwo` : | the second list to add. [transfer none]

### osinfo_list_add_all ()

    void                osinfo_list_add_all                 (OsinfoList *list,
                                                             OsinfoList *source);

Adds all entities from `source` to `list`. Using one of the constructors in a subclass is preferrable to this method.

`list` : | the entity list
`source` : | the list to add. [transfer none]

### osinfo_list_new_copy ()

    OsinfoList *        osinfo_list_new_copy                (OsinfoList *source);

Construct a new list that is filled with elements from `source`

`source` : | the list to copy
Returns : | a copy of the list. [transfer full]

### osinfo_list_new_filtered ()

    OsinfoList *        osinfo_list_new_filtered            (OsinfoList *source,
                                                             OsinfoFilter *filter);

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

`source` : | the list to copy
`filter` : | the filter to apply
Returns : | a filtered copy of the list. [transfer full]

### osinfo_list_new_intersection ()

    OsinfoList *        osinfo_list_new_intersection        (OsinfoList *sourceOne,
                                                             OsinfoList *sourceTwo);

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

`sourceOne` : | the first list to copy
`sourceTwo` : | the second list to copy
Returns : | an intersection of the two lists. [transfer full]

### osinfo_list_new_union ()

    OsinfoList *        osinfo_list_new_union               (OsinfoList *sourceOne,
                                                             OsinfoList *sourceTwo);

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

`sourceOne` : | the first list to copy
`sourceTwo` : | the second list to copy
Returns : | a union of the two lists. [transfer full]

## Property Details

### The `"element-type"` property

      "element-type"             GType*                : Read / Write / Construct Only

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

Allowed values: OsinfoEntity

## See Also

OsinfoEntity