Home · Modules · All Classes · All Namespaces
Public Types | Public Member Functions | List of all members
Tp::ReferencedHandles Class Reference

Helper container for safe management of handle lifetimes. Every handle in a ReferencedHandles container is guaranteed to be valid (and stay valid, as long it's in at least one ReferencedHandles container). More...

#include <TelepathyQt/ReferencedHandles>

Public Types

typedef UIntList::const_iterator const_iterator
 
typedef UIntList::ConstIterator ConstIterator
 
typedef UIntList::const_pointer const_pointer
 
typedef UIntList::const_reference const_reference
 
typedef UIntList::difference_type difference_type
 
typedef UIntList::pointer pointer
 
typedef UIntList::reference reference
 
typedef UIntList::size_type size_type
 
typedef UIntList::value_type value_type
 

Public Member Functions

 ReferencedHandles ()
 
 ReferencedHandles (const ReferencedHandles &other)
 
 ~ReferencedHandles ()
 
ConnectionPtr connection () const
 
HandleType handleType () const
 
uint at (int i) const
 
uint back () const
 
uint first () const
 
uint front () const
 
uint last () const
 
uint value (int i, uint defaultValue=0) const
 
const_iterator begin () const
 
const_iterator constBegin () const
 
const_iterator constEnd () const
 
const_iterator end () const
 
bool contains (uint handle) const
 
int count (uint handle) const
 
int count () const
 
bool empty () const
 
bool endsWith (uint handle) const
 
int indexOf (uint handle, int from=0) const
 
bool isEmpty () const
 
int lastIndexOf (uint handle, int from=-1) const
 
int length () const
 
ReferencedHandles mid (int pos, int length=-1) const
 
int size () const
 
bool startsWith (uint handle) const
 
void append (const ReferencedHandles &another)
 
void clear ()
 
void move (int from, int to)
 
void pop_back ()
 
void pop_front ()
 
int removeAll (uint handle)
 
void removeAt (int i)
 
void removeFirst ()
 
void removeLast ()
 
bool removeOne (uint handle)
 
void swap (int i, int j)
 
uint takeAt (int i)
 
uint takeFirst ()
 
uint takeLast ()
 
bool operator!= (const ReferencedHandles &another) const
 
bool operator!= (const UIntList &another) const
 
ReferencedHandles operator+ (const ReferencedHandles &another) const
 
ReferencedHandlesoperator+= (const ReferencedHandles &another)
 
ReferencedHandlesoperator<< (const ReferencedHandles &another)
 
ReferencedHandlesoperator= (const ReferencedHandles &another)
 
bool operator== (const ReferencedHandles &another) const
 
bool operator== (const UIntList &list) const
 
uint operator[] (int i) const
 
UIntList toList () const
 
QSet< uint > toSet () const
 
std::list< uint > toStdList () const
 
QVector< uint > toVector () const
 

Detailed Description

Helper container for safe management of handle lifetimes. Every handle in a ReferencedHandles container is guaranteed to be valid (and stay valid, as long it's in at least one ReferencedHandles container).

The class offers a QList-style API. However, from the mutable operations, only the operations for which the validity guarantees can be preserved are provided. This means no functions which can add an arbitrary handle to the container are included - the only way to add handles to the container is to reference them using Connection::referenceHandles() and appending the resulting ReferenceHandles instance.

ReferencedHandles is a implicitly shared class.

Member Typedef Documentation

◆ const_iterator

typedef UIntList::const_iterator Tp::ReferencedHandles::const_iterator

◆ ConstIterator

typedef UIntList::ConstIterator Tp::ReferencedHandles::ConstIterator

◆ const_pointer

typedef UIntList::const_pointer Tp::ReferencedHandles::const_pointer

◆ const_reference

typedef UIntList::const_reference Tp::ReferencedHandles::const_reference

◆ difference_type

typedef UIntList::difference_type Tp::ReferencedHandles::difference_type

◆ pointer

typedef UIntList::pointer Tp::ReferencedHandles::pointer

◆ reference

typedef UIntList::reference Tp::ReferencedHandles::reference

◆ size_type

typedef UIntList::size_type Tp::ReferencedHandles::size_type

◆ value_type

typedef UIntList::value_type Tp::ReferencedHandles::value_type

Constructor & Destructor Documentation

◆ ReferencedHandles() [1/2]

Tp::ReferencedHandles::ReferencedHandles ( )

◆ ReferencedHandles() [2/2]

Tp::ReferencedHandles::ReferencedHandles ( const ReferencedHandles other)

◆ ~ReferencedHandles()

Tp::ReferencedHandles::~ReferencedHandles ( )

Member Function Documentation

◆ connection()

ConnectionPtr Tp::ReferencedHandles::connection ( ) const

◆ handleType()

HandleType Tp::ReferencedHandles::handleType ( ) const

◆ at()

uint Tp::ReferencedHandles::at ( int  i) const

◆ back()

uint Tp::ReferencedHandles::back ( ) const
inline

◆ first()

uint Tp::ReferencedHandles::first ( ) const
inline

◆ front()

uint Tp::ReferencedHandles::front ( ) const
inline

◆ last()

uint Tp::ReferencedHandles::last ( ) const
inline

◆ value()

uint Tp::ReferencedHandles::value ( int  i,
uint  defaultValue = 0 
) const

◆ begin()

ReferencedHandles::const_iterator Tp::ReferencedHandles::begin ( ) const

◆ constBegin()

const_iterator Tp::ReferencedHandles::constBegin ( ) const
inline

◆ constEnd()

const_iterator Tp::ReferencedHandles::constEnd ( ) const
inline

◆ end()

ReferencedHandles::const_iterator Tp::ReferencedHandles::end ( ) const

◆ contains()

bool Tp::ReferencedHandles::contains ( uint  handle) const

◆ count() [1/2]

int Tp::ReferencedHandles::count ( uint  handle) const

◆ count() [2/2]

int Tp::ReferencedHandles::count ( ) const
inline

◆ empty()

bool Tp::ReferencedHandles::empty ( ) const
inline

◆ endsWith()

bool Tp::ReferencedHandles::endsWith ( uint  handle) const
inline

◆ indexOf()

int Tp::ReferencedHandles::indexOf ( uint  handle,
int  from = 0 
) const

◆ isEmpty()

bool Tp::ReferencedHandles::isEmpty ( ) const

◆ lastIndexOf()

int Tp::ReferencedHandles::lastIndexOf ( uint  handle,
int  from = -1 
) const

◆ length()

int Tp::ReferencedHandles::length ( ) const
inline

◆ mid()

ReferencedHandles Tp::ReferencedHandles::mid ( int  pos,
int  length = -1 
) const

◆ size()

int Tp::ReferencedHandles::size ( ) const

◆ startsWith()

bool Tp::ReferencedHandles::startsWith ( uint  handle) const
inline

◆ append()

void Tp::ReferencedHandles::append ( const ReferencedHandles another)
inline

◆ clear()

void Tp::ReferencedHandles::clear ( )

◆ move()

void Tp::ReferencedHandles::move ( int  from,
int  to 
)

◆ pop_back()

void Tp::ReferencedHandles::pop_back ( )
inline

◆ pop_front()

void Tp::ReferencedHandles::pop_front ( )
inline

◆ removeAll()

int Tp::ReferencedHandles::removeAll ( uint  handle)

◆ removeAt()

void Tp::ReferencedHandles::removeAt ( int  i)

◆ removeFirst()

void Tp::ReferencedHandles::removeFirst ( )
inline

◆ removeLast()

void Tp::ReferencedHandles::removeLast ( )
inline

◆ removeOne()

bool Tp::ReferencedHandles::removeOne ( uint  handle)

◆ swap()

void Tp::ReferencedHandles::swap ( int  i,
int  j 
)

◆ takeAt()

uint Tp::ReferencedHandles::takeAt ( int  i)

◆ takeFirst()

uint Tp::ReferencedHandles::takeFirst ( )
inline

◆ takeLast()

uint Tp::ReferencedHandles::takeLast ( )
inline

◆ operator!=() [1/2]

bool Tp::ReferencedHandles::operator!= ( const ReferencedHandles another) const
inline

◆ operator!=() [2/2]

bool Tp::ReferencedHandles::operator!= ( const UIntList another) const
inline

◆ operator+()

ReferencedHandles Tp::ReferencedHandles::operator+ ( const ReferencedHandles another) const

◆ operator+=()

ReferencedHandles& Tp::ReferencedHandles::operator+= ( const ReferencedHandles another)
inline

◆ operator<<()

ReferencedHandles& Tp::ReferencedHandles::operator<< ( const ReferencedHandles another)
inline

◆ operator=()

ReferencedHandles & Tp::ReferencedHandles::operator= ( const ReferencedHandles another)

◆ operator==() [1/2]

bool Tp::ReferencedHandles::operator== ( const ReferencedHandles another) const

◆ operator==() [2/2]

bool Tp::ReferencedHandles::operator== ( const UIntList list) const

◆ operator[]()

uint Tp::ReferencedHandles::operator[] ( int  i) const
inline

◆ toList()

UIntList Tp::ReferencedHandles::toList ( ) const

◆ toSet()

QSet<uint> Tp::ReferencedHandles::toSet ( ) const
inline

◆ toStdList()

std::list<uint> Tp::ReferencedHandles::toStdList ( ) const
inline

◆ toVector()

QVector<uint> Tp::ReferencedHandles::toVector ( ) const
inline