Akonadi

Akonadi::Server::_detail::ById< Op > Struct Template Reference

#include <entity.h>

Public Types

using result_type = bool
 

Public Member Functions

template<typename E >
bool operator() (const E &lhs, const E &rhs) const
 
template<typename E >
bool operator() (const E &lhs, Entity::Id rhs) const
 
template<typename E >
bool operator() (Entity::Id lhs, const E &rhs) const
 
bool operator() (Entity::Id lhs, Entity::Id rhs) const
 

Detailed Description

template<template< typename U > class Op>
struct Akonadi::Server::_detail::ById< Op >

Binary predicate to sort collections of Entity subclasses by their id.

Example for sorting:

std::sort( coll.begin(), coll.end(), _detail::ById<std::less>() );

Example for finding by id:

// linear:
std::find_if( coll.begin(), coll.end(), bind( _detail::ById<std::equal_to>(), _1, myId ) );
// binary:
std::lower_bound( coll.begin(), coll.end(), myId, _detail::ById<std::less>() );

Definition at line 192 of file entity.h.

Member Typedef Documentation

◆ result_type

template<template< typename U > class Op>
using Akonadi::Server::_detail::ById< Op >::result_type = bool

Definition at line 193 of file entity.h.

Member Function Documentation

◆ operator()() [1/4]

template<template< typename U > class Op>
template<typename E >
bool Akonadi::Server::_detail::ById< Op >::operator() ( const E & lhs,
const E & rhs ) const
inline

Definition at line 199 of file entity.h.

◆ operator()() [2/4]

template<template< typename U > class Op>
template<typename E >
bool Akonadi::Server::_detail::ById< Op >::operator() ( const E & lhs,
Entity::Id rhs ) const
inline

Definition at line 204 of file entity.h.

◆ operator()() [3/4]

template<template< typename U > class Op>
template<typename E >
bool Akonadi::Server::_detail::ById< Op >::operator() ( Entity::Id lhs,
const E & rhs ) const
inline

Definition at line 209 of file entity.h.

◆ operator()() [4/4]

template<template< typename U > class Op>
bool Akonadi::Server::_detail::ById< Op >::operator() ( Entity::Id lhs,
Entity::Id rhs ) const
inline

Definition at line 194 of file entity.h.


The documentation for this struct was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.