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

The class of the ttk any module. More...

#include <ttkany.h>

Classes

struct  _Base
 
struct  _Derived
 

Public Member Functions

 TTKAny () noexcept
 
 TTKAny (const TTKAny &other) noexcept
 
 TTKAny (TTKAny &&other) noexcept
 
template<typename T , typename = typename std::enable_if<!std::is_same<typename std::decay<T>::type, TTKAny>::value, T>::type>
 TTKAny (T &&t) noexcept
 
bool isNull () const noexcept
 
template<typename T >
bool isSame () const noexcept
 
template<typename T >
Tcast ()
 
template<typename T >
const Tcast () const
 
TTKAnyoperator= (const TTKAny &other) noexcept
 
void swap (TTKAny &other) noexcept
 

Private Types

using _BasePtr = std::unique_ptr< _Base >
 

Private Member Functions

_BasePtr clone () const noexcept
 

Private Attributes

_BasePtr m_ptr
 
std::type_index m_type
 

Detailed Description

The class of the ttk any module.

Author
Greedysky greed.nosp@m.ysky.nosp@m.@163..nosp@m.com

Definition at line 30 of file ttkany.h.

Member Typedef Documentation

using TTKAny::_BasePtr = std::unique_ptr<_Base>
private

Definition at line 102 of file ttkany.h.

Constructor & Destructor Documentation

TTKAny::TTKAny ( )
noexcept

Object constructor.

Definition at line 3 of file ttkany.cpp.

TTKAny::TTKAny ( const TTKAny other)
noexcept

Definition at line 9 of file ttkany.cpp.

TTKAny::TTKAny ( TTKAny &&  other)
noexcept

Definition at line 16 of file ttkany.cpp.

template<typename T , typename = typename std::enable_if<!std::is_same<typename std::decay<T>::type, TTKAny>::value, T>::type>
TTKAny::TTKAny ( T &&  t)
inlinenoexcept

Definition at line 42 of file ttkany.h.

Member Function Documentation

template<typename T >
T& TTKAny::cast ( )
inline

Cast value by type T.

Definition at line 67 of file ttkany.h.

References T, TTKConstCast, and TTKStaticCast.

Referenced by TTK::any_cast().

template<typename T >
const T& TTKAny::cast ( ) const
inline

Cast value by type T.

Definition at line 76 of file ttkany.h.

References TTKDynamicCast.

_BasePtr TTKAny::clone ( ) const
inlineprivatenoexcept

Clone data from this.

Definition at line 131 of file ttkany.h.

References clone().

Referenced by clone(), and operator=().

bool TTKAny::isNull ( ) const
noexcept

Current container is null or not.

Definition at line 23 of file ttkany.cpp.

References m_ptr.

template<typename T >
bool TTKAny::isSame ( ) const
inlinenoexcept

Current container is same or not by type T.

Definition at line 58 of file ttkany.h.

References T.

Referenced by TTK::any_cast().

TTKAny & TTKAny::operator= ( const TTKAny other)
noexcept

Copy object from other.

Definition at line 28 of file ttkany.cpp.

References clone().

void TTKAny::swap ( TTKAny other)
inlinenoexcept

Swap object from other.

Definition at line 95 of file ttkany.h.

References std::exchange().

Member Data Documentation

_BasePtr TTKAny::m_ptr
private

Definition at line 136 of file ttkany.h.

Referenced by isNull().

std::type_index TTKAny::m_type
private

Definition at line 137 of file ttkany.h.


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