Envision
A visual programming IDE for object-oriented languages
List of all members | Public Member Functions | Private Types | Private Attributes
InformationScripting::Optional< ValueType > Class Template Reference

Class inspired by std::experimental::optional, but it additionally contains an error/warning message. More...

Public Member Functions

 Optional (const Optional &other)
 
 Optional (const QString &errorMessage)
 
 Optional (const ValueType &v, const QString &warning={})
 
 Optional (Optional &&other)
 
 Optional (QString &&errorMessage)
 
 Optional (ValueType &&v, const QString &warning={})
 
void addWarnings (const QStringList &warnings)
 
QStringList errors () const
 
bool hasErrors () const
 
bool hasWarnings () const
 
 operator bool () const
 
Optionaloperator= (const Optional &other)
 
Optionaloperator= (Optional &&other)
 
ValueType & value () &
 
ValueType && value () &&
 
const ValueType & value () const &
 
const ValueType && value () const &&
 
QStringList warnings () const
 

Private Types

enum class  Type : int { Value , Warning , Error }
 

Private Attributes

QStringList errors_
 
Types type_ {Type::Value}
 
ValueType value_ {}
 
QStringList warnings_
 

Detailed Description

template<typename ValueType>
class InformationScripting::Optional< ValueType >

Class inspired by std::experimental::optional, but it additionally contains an error/warning message.

Member Enumeration Documentation

◆ Type

template<typename ValueType >
enum InformationScripting::Optional::Type : int
strongprivate
Enumerator
Value 
Warning 
Error 

Constructor & Destructor Documentation

◆ Optional() [1/6]

template<typename ValueType >
InformationScripting::Optional< ValueType >::Optional ( const ValueType &  v,
const QString &  warning = {} 
)
inline

◆ Optional() [2/6]

template<typename ValueType >
InformationScripting::Optional< ValueType >::Optional ( ValueType &&  v,
const QString &  warning = {} 
)
inline

◆ Optional() [3/6]

template<typename ValueType >
InformationScripting::Optional< ValueType >::Optional ( const QString &  errorMessage)
inline

◆ Optional() [4/6]

template<typename ValueType >
InformationScripting::Optional< ValueType >::Optional ( QString &&  errorMessage)
inline

◆ Optional() [5/6]

template<typename ValueType >
InformationScripting::Optional< ValueType >::Optional ( const Optional< ValueType > &  other)
inline

◆ Optional() [6/6]

template<typename ValueType >
InformationScripting::Optional< ValueType >::Optional ( Optional< ValueType > &&  other)
inline

Member Function Documentation

◆ addWarnings()

template<typename ValueType >
void InformationScripting::Optional< ValueType >::addWarnings ( const QStringList &  warnings)
inline

◆ errors()

template<typename ValueType >
QStringList InformationScripting::Optional< ValueType >::errors
inline

◆ hasErrors()

template<typename ValueType >
bool InformationScripting::Optional< ValueType >::hasErrors
inline

◆ hasWarnings()

template<typename ValueType >
bool InformationScripting::Optional< ValueType >::hasWarnings
inline

◆ operator bool()

template<typename ValueType >
InformationScripting::Optional< ValueType >::operator bool
inlineexplicit

◆ operator=() [1/2]

template<typename ValueType >
Optional< ValueType > & InformationScripting::Optional< ValueType >::operator= ( const Optional< ValueType > &  other)

◆ operator=() [2/2]

template<typename ValueType >
Optional< ValueType > & InformationScripting::Optional< ValueType >::operator= ( Optional< ValueType > &&  other)

◆ value() [1/4]

template<typename ValueType >
ValueType & InformationScripting::Optional< ValueType >::value ( ) &
inline

◆ value() [2/4]

template<typename ValueType >
ValueType && InformationScripting::Optional< ValueType >::value ( ) &&
inline

◆ value() [3/4]

template<typename ValueType >
const ValueType & InformationScripting::Optional< ValueType >::value ( ) const &
inline

◆ value() [4/4]

template<typename ValueType >
const ValueType&& InformationScripting::Optional< ValueType >::value ( ) const &&

◆ warnings()

template<typename ValueType >
QStringList InformationScripting::Optional< ValueType >::warnings
inline

Member Data Documentation

◆ errors_

template<typename ValueType >
QStringList InformationScripting::Optional< ValueType >::errors_
private

◆ type_

template<typename ValueType >
Types InformationScripting::Optional< ValueType >::type_ {Type::Value}
private

◆ value_

template<typename ValueType >
ValueType InformationScripting::Optional< ValueType >::value_ {}
private

◆ warnings_

template<typename ValueType >
QStringList InformationScripting::Optional< ValueType >::warnings_
private