TTKMusicPlayer  4.1.3.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
Public Member Functions | Private Types | Private Attributes | List of all members
TTKVariant< Types > Class Template Reference

#include <ttkvariant.h>

Public Member Functions

 TTKVariant ()
 
 TTKVariant (TTKVariant< Types...> &&other)
 
 TTKVariant (const TTKVariant< Types...> &other)
 
template<class T , class = typename std::enable_if<Contains<typename std::remove_reference<T>::type, Types...>::value>::type>
 TTKVariant (T &&value)
 
 ~TTKVariant ()
 
TTKVariantoperator= (const TTKVariant &other)
 
TTKVariantoperator= (TTKVariant &&other)
 
bool operator== (const TTKVariant &other) const noexcept
 
bool operator< (const TTKVariant &other) const noexcept
 
template<typename T >
bool isSame () const noexcept
 
bool isEmpty () const noexcept
 
std::type_index type () const noexcept
 
template<typename T >
std::decay< T >::typeget ()
 
template<typename T >
int indexOf () const noexcept
 

Private Types

enum  { data_size = IntegerMax<sizeof(Types)...>::value, align_size = MaxAlign<Types...>::value }
 
typedef VariantHelper< Types...> Helper_t
 
using data_t = typename std::aligned_storage< data_size, align_size >::type
 

Private Attributes

data_t m_data
 
std::type_index m_type
 

Detailed Description

template<typename... Types>
class TTKVariant< Types >

Definition at line 108 of file ttkvariant.h.

Member Typedef Documentation

template<typename... Types>
using TTKVariant< Types >::data_t = typename std::aligned_storage<data_size, align_size>::type
private

Definition at line 117 of file ttkvariant.h.

template<typename... Types>
typedef VariantHelper<Types...> TTKVariant< Types >::Helper_t
private

Definition at line 116 of file ttkvariant.h.

Member Enumeration Documentation

template<typename... Types>
anonymous enum
private
Enumerator
data_size 
align_size 

Definition at line 110 of file ttkvariant.h.

Constructor & Destructor Documentation

template<typename... Types>
TTKVariant< Types >::TTKVariant ( )
inline

Object constructor.

Definition at line 123 of file ttkvariant.h.

template<typename... Types>
TTKVariant< Types >::TTKVariant ( TTKVariant< Types...> &&  other)
inline

Object constructor.

Definition at line 131 of file ttkvariant.h.

template<typename... Types>
TTKVariant< Types >::TTKVariant ( const TTKVariant< Types...> &  other)
inline

Object constructor.

Definition at line 140 of file ttkvariant.h.

References TTKVariant< Types >::m_data, and TTKVariant< Types >::m_type.

template<typename... Types>
template<class T , class = typename std::enable_if<Contains<typename std::remove_reference<T>::type, Types...>::value>::type>
TTKVariant< Types >::TTKVariant ( T &&  value)
inline

Object constructor.

Definition at line 151 of file ttkvariant.h.

References T.

template<typename... Types>
TTKVariant< Types >::~TTKVariant ( )
inline

Object destructor.

Definition at line 163 of file ttkvariant.h.

Member Function Documentation

template<typename... Types>
template<typename T >
std::decay<T>::type& TTKVariant< Types >::get ( )
inline

Definition at line 209 of file ttkvariant.h.

References name, and TTK_ERROR_STREAM.

template<typename... Types>
template<typename T >
int TTKVariant< Types >::indexOf ( ) const
inlinenoexcept

Definition at line 221 of file ttkvariant.h.

References T.

template<typename... Types>
bool TTKVariant< Types >::isEmpty ( ) const
inlinenoexcept

Definition at line 198 of file ttkvariant.h.

template<typename... Types>
template<typename T >
bool TTKVariant< Types >::isSame ( ) const
inlinenoexcept

Definition at line 193 of file ttkvariant.h.

References T.

template<typename... Types>
bool TTKVariant< Types >::operator< ( const TTKVariant< Types > &  other) const
inlinenoexcept

Definition at line 187 of file ttkvariant.h.

template<typename... Types>
TTKVariant& TTKVariant< Types >::operator= ( const TTKVariant< Types > &  other)
inline

Definition at line 168 of file ttkvariant.h.

References TTKVariant< Types >::m_data, and TTKVariant< Types >::m_type.

template<typename... Types>
TTKVariant& TTKVariant< Types >::operator= ( TTKVariant< Types > &&  other)
inline

Definition at line 175 of file ttkvariant.h.

template<typename... Types>
bool TTKVariant< Types >::operator== ( const TTKVariant< Types > &  other) const
inlinenoexcept

Definition at line 182 of file ttkvariant.h.

template<typename... Types>
std::type_index TTKVariant< Types >::type ( ) const
inlinenoexcept

Definition at line 203 of file ttkvariant.h.

Member Data Documentation

template<typename... Types>
data_t TTKVariant< Types >::m_data
private
template<typename... Types>
std::type_index TTKVariant< Types >::m_type
private

The documentation for this class was generated from the following file: