KSortableItem

Search for usage in LXR

KSortableItem< T, Key > Class Template Reference

#include <KSortableItem>

Public Member Functions

 KSortableItem ()
 
 KSortableItem (const KSortableItem< T, Key > &rhs)
 
 KSortableItem (Key i, const T &t)
 
Key key () const
 
bool operator!= (const KSortableItem< T, Key > &i2) const
 
bool operator< (const KSortableItem< T, Key > &i2) const
 
bool operator<= (const KSortableItem< T, Key > &i2) const
 
KSortableItem< T, Key > & operator= (const KSortableItem< T, Key > &i)
 
bool operator== (const KSortableItem< T, Key > &i2) const
 
bool operator> (const KSortableItem< T, Key > &i2) const
 
bool operator>= (const KSortableItem< T, Key > &i2) const
 
T & value ()
 
const T & value () const
 

Detailed Description

template<typename T, typename Key = int>
class KSortableItem< T, Key >

KSortableItem is a QPair that provides several operators for sorting.

See also
KSortableList

Definition at line 25 of file ksortablelist.h.

Constructor & Destructor Documentation

◆ KSortableItem() [1/3]

template<typename T , typename Key = int>
KSortableItem< T, Key >::KSortableItem ( Key i,
const T & t )
inline

Creates a new KSortableItem with the given values.

Parameters
ithe first value (the key)
tthe second value (the item)

Definition at line 33 of file ksortablelist.h.

◆ KSortableItem() [2/3]

template<typename T , typename Key = int>
KSortableItem< T, Key >::KSortableItem ( const KSortableItem< T, Key > & rhs)
inline

Creates a new KSortableItem that copies another one.

Parameters
rhsthe other item to copy

Definition at line 41 of file ksortablelist.h.

◆ KSortableItem() [3/3]

template<typename T , typename Key = int>
KSortableItem< T, Key >::KSortableItem ( )
inline

Creates a new KSortableItem with uninitialized values.

Definition at line 49 of file ksortablelist.h.

Member Function Documentation

◆ key()

template<typename T , typename Key = int>
Key KSortableItem< T, Key >::key ( ) const
inline
Returns
the first value.

Definition at line 132 of file ksortablelist.h.

◆ operator!=()

template<typename T , typename Key = int>
bool KSortableItem< T, Key >::operator!= ( const KSortableItem< T, Key > & i2) const
inline

Compares the two items.

This implementation only compares the first value.

Definition at line 108 of file ksortablelist.h.

◆ operator<()

template<typename T , typename Key = int>
bool KSortableItem< T, Key >::operator< ( const KSortableItem< T, Key > & i2) const
inline

Compares the two items.

This implementation only compares the first value.

Definition at line 76 of file ksortablelist.h.

◆ operator<=()

template<typename T , typename Key = int>
bool KSortableItem< T, Key >::operator<= ( const KSortableItem< T, Key > & i2) const
inline

Compares the two items.

This implementation only compares the first value.

Definition at line 92 of file ksortablelist.h.

◆ operator=()

template<typename T , typename Key = int>
KSortableItem< T, Key > & KSortableItem< T, Key >::operator= ( const KSortableItem< T, Key > & i)
inline

Assignment operator, just copies the item.

Definition at line 56 of file ksortablelist.h.

◆ operator==()

template<typename T , typename Key = int>
bool KSortableItem< T, Key >::operator== ( const KSortableItem< T, Key > & i2) const
inline

Compares the two items.

This implementation only compares the first value.

Definition at line 100 of file ksortablelist.h.

◆ operator>()

template<typename T , typename Key = int>
bool KSortableItem< T, Key >::operator> ( const KSortableItem< T, Key > & i2) const
inline

Compares the two items.

This implementation only compares the first value.

Definition at line 68 of file ksortablelist.h.

◆ operator>=()

template<typename T , typename Key = int>
bool KSortableItem< T, Key >::operator>= ( const KSortableItem< T, Key > & i2) const
inline

Compares the two items.

This implementation only compares the first value.

Definition at line 84 of file ksortablelist.h.

◆ value() [1/2]

template<typename T , typename Key = int>
T & KSortableItem< T, Key >::value ( )
inline
Returns
the second value (the item)

Definition at line 116 of file ksortablelist.h.

◆ value() [2/2]

template<typename T , typename Key = int>
const T & KSortableItem< T, Key >::value ( ) const
inline
Returns
the second value (the item)

Definition at line 124 of file ksortablelist.h.


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.