swift
Loading...
Searching...
No Matches
swift::misc::TSettingTrait< T > Struct Template Reference

Base class for traits to be used as template argument to swift::misc::CSetting. More...

#include <settingscache.h>

Public Types

using type = T
 Data type of the value.

Public Member Functions

 TSettingTrait ()=delete
 Deleted default constructor.
 TSettingTrait (const TSettingTrait &)=delete
 Deleted copy constructor.
TSettingTrait & operator= (const TSettingTrait &)=delete
 Deleted copy assignment operator.

Static Public Member Functions

static const char * key ()
 Key string of the value. Reimplemented in derived class.
static const QString & humanReadable ()
 Optional human readable name.
static bool isValid (const T &value, QString &reason)
 Validator function. Return true if the argument is valid, false otherwise. Default implementation just returns true. Reimplemented in derived class to support validation of the value.
static const T & defaultValue ()
 Return the value to use in case the supplied value does not satisfy the validator. Default implementation returns a default-constructed value.

Detailed Description

template<typename T>
struct swift::misc::TSettingTrait< T >

Base class for traits to be used as template argument to swift::misc::CSetting.

Definition at line 133 of file settingscache.h.

Member Typedef Documentation

◆ type

template<typename T>
using swift::misc::TSettingTrait< T >::type = T

Data type of the value.

Definition at line 136 of file settingscache.h.

Member Function Documentation

◆ defaultValue()

template<typename T>
const T & swift::misc::TSettingTrait< T >::defaultValue ( )
inlinestatic

Return the value to use in case the supplied value does not satisfy the validator. Default implementation returns a default-constructed value.

Definition at line 163 of file settingscache.h.

◆ humanReadable()

template<typename T>
const QString & swift::misc::TSettingTrait< T >::humanReadable ( )
inlinestatic

Optional human readable name.

Definition at line 146 of file settingscache.h.

◆ isValid()

template<typename T>
bool swift::misc::TSettingTrait< T >::isValid ( const T & value,
QString & reason )
inlinestatic

Validator function. Return true if the argument is valid, false otherwise. Default implementation just returns true. Reimplemented in derived class to support validation of the value.

Definition at line 154 of file settingscache.h.

◆ key()

template<typename T>
const char * swift::misc::TSettingTrait< T >::key ( )
inlinestatic

Key string of the value. Reimplemented in derived class.

Definition at line 139 of file settingscache.h.


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