object-manager: add _get_n_objects() method

This commit is contained in:
George Kiagiadakis 2020-03-31 15:00:41 +03:00
parent 69ea11ca61
commit c06317ac3b
2 changed files with 16 additions and 0 deletions

View file

@ -280,6 +280,19 @@ wp_object_manager_add_interest (WpObjectManager *self,
i->constraints = constraints ? g_variant_ref_sink (constraints) : NULL;
}
/**
* wp_object_manager_get_n_objects:
* @self: the object manager
*
* Returns: the number of objects managed by this #WpObjectManager
*/
guint
wp_object_manager_get_n_objects (WpObjectManager * self)
{
g_return_val_if_fail (WP_IS_OBJECT_MANAGER (self), 0);
return self->objects->len;
}
/**
* wp_object_manager_get_objects:
* @self: the object manager

View file

@ -47,6 +47,9 @@ WP_API
void wp_object_manager_add_interest (WpObjectManager *self,
GType gtype, GVariant * constraints, WpProxyFeatures wanted_features);
WP_API
guint wp_object_manager_get_n_objects (WpObjectManager * self);
WP_API
GPtrArray * wp_object_manager_get_objects (WpObjectManager *self,
GType type_filter);