Pyrogenesis  trunk
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CGUISimpleSetting< T > Class Template Reference

Wraps a T. More...

#include <CGUISetting.h>

Inheritance diagram for CGUISimpleSetting< T >:
Inheritance graph
[legend]
Collaboration diagram for CGUISimpleSetting< T >:
Collaboration graph
[legend]

Public Member Functions

template<typename... Args>
 CGUISimpleSetting (IGUIObject *pObject, const CStr &Name, Args &&... args)
 
 NONCOPYABLE (CGUISimpleSetting)
 
 MOVABLE (CGUISimpleSetting)
 
 operator const T & () const
 
const Toperator* () const
 
const Toperator-> () const
 
TGetMutable ()
 'Uglified' getter when you want direct access without triggering messages. More...
 
void Set (T value, bool sendMessage)
 'Uglified' operator=, so that SendMessage is explicit. More...
 
- Public Member Functions inherited from IGUISetting
 NONCOPYABLE (IGUISetting)
 
 IGUISetting (const CStr &name, IGUIObject *owner)
 
bool FromString (const CStrW &value, const bool sendMessage)
 Parses the given string and assigns to the setting value. More...
 
bool FromJSVal (const ScriptRequest &rq, JS::HandleValue value, const bool sendMessage)
 Parses the given JS::Value using Script::FromJSVal and assigns it to the setting data. More...
 

Protected Member Functions

CStr GetName () const override
 Return the name of the setting, from JS. More...
 
bool DoFromString (const CStrW &value) override
 
bool DoFromJSVal (const ScriptRequest &rq, JS::HandleValue value) override
 
void ToJSVal (const ScriptRequest &rq, JS::MutableHandleValue value) override
 Converts the setting data to a JS::Value using Script::ToJSVal. More...
 
- Protected Member Functions inherited from IGUISetting
 IGUISetting (IGUISetting &&o)
 
virtual ~IGUISetting ()=default
 
virtual void OnSettingChange (const CStr &setting, bool sendMessage)
 Triggers the IGUIObject logic when a setting changes. More...
 

Protected Attributes

const CStr m_Name
 
T m_Setting
 
- Protected Attributes inherited from IGUISetting
IGUIObjectm_pObject
 The object that stores this setting. More...
 

Detailed Description

template<typename T>
class CGUISimpleSetting< T >

Wraps a T.

Makes sure the appropriate setting functions are called when modifying T, and likewise makes sure that JS/xml settings affect T appropriately, while being as transparent as possible to use from C++ code.

Constructor & Destructor Documentation

◆ CGUISimpleSetting()

template<typename T>
template<typename... Args>
CGUISimpleSetting< T >::CGUISimpleSetting ( IGUIObject pObject,
const CStr &  Name,
Args &&...  args 
)
inline

Member Function Documentation

◆ DoFromJSVal()

template<typename T >
bool CGUISimpleSetting< T >::DoFromJSVal ( const ScriptRequest rq,
JS::HandleValue  value 
)
overrideprotectedvirtual

Implements IGUISetting.

◆ DoFromString()

template<typename T >
bool CGUISimpleSetting< T >::DoFromString ( const CStrW &  value)
overrideprotectedvirtual

Implements IGUISetting.

◆ GetMutable()

template<typename T>
T& CGUISimpleSetting< T >::GetMutable ( )
inline

'Uglified' getter when you want direct access without triggering messages.

◆ GetName()

template<typename T>
CStr CGUISimpleSetting< T >::GetName ( ) const
inlineoverrideprotectedvirtual

Return the name of the setting, from JS.

Implements IGUISetting.

◆ MOVABLE()

template<typename T>
CGUISimpleSetting< T >::MOVABLE ( CGUISimpleSetting< T )

◆ NONCOPYABLE()

template<typename T>
CGUISimpleSetting< T >::NONCOPYABLE ( CGUISimpleSetting< T )

◆ operator const T &()

template<typename T>
CGUISimpleSetting< T >::operator const T & ( ) const
inline

◆ operator*()

template<typename T>
const T& CGUISimpleSetting< T >::operator* ( ) const
inline

◆ operator->()

template<typename T>
const T* CGUISimpleSetting< T >::operator-> ( ) const
inline

◆ Set()

template<typename T>
void CGUISimpleSetting< T >::Set ( T  value,
bool  sendMessage 
)
inline

'Uglified' operator=, so that SendMessage is explicit.

◆ ToJSVal()

template<typename T >
void CGUISimpleSetting< T >::ToJSVal ( const ScriptRequest rq,
JS::MutableHandleValue  value 
)
overrideprotectedvirtual

Converts the setting data to a JS::Value using Script::ToJSVal.

Implements IGUISetting.

Member Data Documentation

◆ m_Name

template<typename T>
const CStr CGUISimpleSetting< T >::m_Name
protected

◆ m_Setting

template<typename T>
T CGUISimpleSetting< T >::m_Setting
protected

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