KActivitiesStats 5.109.0
Classes | Public Types | Public Member Functions | List of all members
KActivities::Stats::ResultSet

Class that can query the KActivities usage tracking mechanism for resources. More...

#include <KActivities/Stats/ResultSet>

Classes

class  Result
 Structure containing data of one of the results. More...
 

Public Types

typedef Result value_type
 ResultSet is a container.
 

Public Member Functions

 ResultSet (const ResultSet &source)
 
 ResultSet (Query query)
 Creates the ResultSet from the specified query.
 
 ResultSet (ResultSet &&source)
 
Result at (int index) const
 
const_iterator begin () const
 
const_iterator cbegin () const
 Alias for begin.
 
const_iterator cend () const
 Alias for end.
 
const_iterator constBegin () const
 Alias for begin.
 
const_iterator constEnd () const
 Alias for end.
 
const_iterator end () const
 
ResultSetoperator= (ResultSet source)
 

Detailed Description

Class that can query the KActivities usage tracking mechanism for resources.

Note: It is important to note that you should not create long-living instances of ResultSet. It might lock the database and break proper updating mechanisms. If you want a list of results that automatically get updated, use ResultModel.

ResultSet is meant to be used when you just need to fetch a few results like this:

auto results = ResultSet(AllResources | Agent("org.kde.kate"));
for (const auto &result: results) {
// ...
}
Class that can query the KActivities usage tracking mechanism for resources.
Definition resultset.h:44

Member Typedef Documentation

◆ value_type

ResultSet is a container.

This notifies the generic algorithms from STL and others of the contained type.

Constructor & Destructor Documentation

◆ ResultSet()

KActivities::Stats::ResultSet::ResultSet ( Query  query)

Creates the ResultSet from the specified query.

Member Function Documentation

◆ at()

Result KActivities::Stats::ResultSet::at ( int  index) const
Returns
a result at the specified index
Parameters
indexof the result
Note
You should use iterators instead

◆ begin()

const_iterator KActivities::Stats::ResultSet::begin ( ) const
Returns
a constant iterator pointing to the start of the collection (to the first item)
Note
as usual in C++, the range of the collection is [begin, end)

◆ cbegin()

const_iterator KActivities::Stats::ResultSet::cbegin ( ) const
inline

Alias for begin.

◆ cend()

const_iterator KActivities::Stats::ResultSet::cend ( ) const
inline

Alias for end.

◆ constBegin()

const_iterator KActivities::Stats::ResultSet::constBegin ( ) const
inline

Alias for begin.

◆ constEnd()

const_iterator KActivities::Stats::ResultSet::constEnd ( ) const
inline

Alias for end.

◆ end()

const_iterator KActivities::Stats::ResultSet::end ( ) const
Returns
a constant iterator pointing to the end of the collection (after the last item)
Note
as usual in C++, the range of the collection is [begin, end)