Sayonara Player
Public Member Functions | List of all members
Util::Set< T > Class Template Reference

A set structure. Inherited from std::set with some useful methods. For integer and String this set is ordered. More...

#include <Set.h>

Inheritance diagram for Util::Set< T >:

Public Member Functions

 Set (const T &singleElement)
 Constructs a set with a single element. More...
 
QList< T > toList () const
 converts the set to a list. The order is random More...
 
bool isEmpty () const
 
first () const
 get copy of first element More...
 
bool contains (const T &value) const
 check, if set contains a specific value More...
 
void remove (const T &value)
 removes every item that matches value More...
 
Util::Set< T > & operator<< (const T &t)
 
template<template< typename > class A>
Util::Set< T > & operator<< (const A< T > &container)
 
int count () const
 

Detailed Description

template<typename T>
class Util::Set< T >

A set structure. Inherited from std::set with some useful methods. For integer and String this set is ordered.

Constructor & Destructor Documentation

◆ Set()

template<typename T >
Util::Set< T >::Set ( const T &  singleElement)
inline

Constructs a set with a single element.

Parameters
singleElementthe first element

Member Function Documentation

◆ contains()

template<typename T >
bool Util::Set< T >::contains ( const T &  value) const
inline

check, if set contains a specific value

Parameters
value
Returns

◆ first()

template<typename T >
T Util::Set< T >::first ( ) const
inline

get copy of first element

Returns
first element

◆ isEmpty()

template<typename T >
bool Util::Set< T >::isEmpty ( ) const
inline
Returns
true, if set is empty

◆ remove()

template<typename T >
void Util::Set< T >::remove ( const T &  value)
inline

removes every item that matches value

Parameters
value

◆ toList()

template<typename T >
QList< T > Util::Set< T >::toList ( ) const
inline

converts the set to a list. The order is random

Returns
list