XII Release 0.1.0
Loading...
Searching...
No Matches
xiiTypedCVar< Type, CVarType > Class Template Reference

[internal] Helper class to implement xiiCVarInt, xiiCVarFlag, xiiCVarBool and xiiCVarString. More...

#include <CVar.h>

Inheritance diagram for xiiTypedCVar< Type, CVarType >:
[legend]

Public Member Functions

 xiiTypedCVar (xiiStringView sName, const Type &value, xiiBitflags< xiiCVarFlags > flags, xiiStringView sDescription)
 Copyright (c) Theophilus Eriata. All Rights Reserved.
 operator const Type & () const
 Returns the 'current' value of the CVar. Same as 'GetValue(xiiCVarValue::Current)'.
const Type & GetValue (xiiCVarValue::Enum val=xiiCVarValue::Current) const
 Returns the internal values of the CVar.
void operator= (const Type &value)
virtual xiiCVarType::Enum GetType () const override
 Returns the type of the CVar.
virtual void SetToDelayedSyncValue () override
bool HasDelayedSyncValueChanged () const
 Checks whether a new value was set and now won't be visible until SetToDelayedSyncValue() is called.
Public Member Functions inherited from xiiCVar
xiiStringView GetName () const
 Returns the (display) name of the CVar.
xiiStringView GetDescription () const
 Returns the description of the CVar.
xiiBitflags< xiiCVarFlags > GetFlags () const
 Returns all the CVar flags.
xiiStringView GetPluginName () const
 Returns the name of the plugin which this CVar is declared in.

Friends

class xiiCVar

Additional Inherited Members

Public Types inherited from xiiCVar
using CVarEvents = xiiEvent<const xiiCVarEvent&, xiiMutex, xiiStaticAllocatorWrapper>
Static Public Member Functions inherited from xiiCVar
static void SetStorageFolder (xiiStringView sFolder)
static xiiCVar * FindCVarByName (xiiStringView sName)
 Searches all CVars for one with the given name. Returns nullptr if no CVar could be found. The name is case-insensitive.
static void SaveCVars ()
static void SaveCVarsToFile (xiiStringView sPath, bool bIgnoreSaveFlag=false)
static void LoadCVars (bool bOnlyNewOnes=true, bool bSetAsCurrentValue=true)
 Calls LoadCVarsFromCommandLine() and then LoadCVarsFromFile().
static void LoadCVarsFromFile (bool bOnlyNewOnes=true, bool bSetAsCurrentValue=true, xiiDynamicArray< xiiCVar * > *pOutCVars=nullptr)
static void LoadCVarsFromFile (xiiStringView sPath, bool bOnlyNewOnes=true, bool bSetAsCurrentValue=true, bool bIgnoreSaveFlag=false, xiiDynamicArray< xiiCVar * > *pOutCVars=nullptr)
static void LoadCVarsFromCommandLine (bool bOnlyNewOnes=true, bool bSetAsCurrentValue=true, xiiDynamicArray< xiiCVar * > *pOutCVars=nullptr)
static void ListOfCVarsChanged (xiiStringView sSetPluginNameTo)
Static Public Member Functions inherited from xiiNoBase
static const xiiRTTI * GetStaticRTTI ()
Public Attributes inherited from xiiCVar
CVarEvents m_CVarEvents
 Code that needs to be execute whenever a cvar is changed can register itself here to be notified of such events.
Static Public Attributes inherited from xiiCVar
static xiiEvent< const xiiCVarEvent & > s_AllCVarEvents
 Broadcasts changes to ANY CVar. Thus code that needs to update when any one of them changes can use this to be notified.
Protected Member Functions inherited from xiiCVar
 xiiCVar (xiiStringView sName, xiiBitflags< xiiCVarFlags > Flags, xiiStringView sDescription)
Protected Attributes inherited from xiiEnumerable< xiiCVar >
xiiEnumerable * m_pNextInstance

Detailed Description

template<typename Type, xiiCVarType::Enum CVarType>
class xiiTypedCVar< Type, CVarType >

[internal] Helper class to implement xiiCVarInt, xiiCVarFlag, xiiCVarBool and xiiCVarString.

Member Function Documentation

◆ GetType()

template<typename Type, xiiCVarType::Enum CVarType>
xiiCVarType::Enum xiiTypedCVar< Type, CVarType >::GetType ( ) const
overridevirtual

Returns the type of the CVar.

Implements xiiCVar.

◆ operator=()

template<typename Type, xiiCVarType::Enum CVarType>
void xiiTypedCVar< Type, CVarType >::operator= ( const Type & value)

Changes the CVar's value and broadcasts the proper events.

Usually the 'Current' value is changed, unless the 'RequiresDelayedSync' flag is set. In that case only the 'DelayedSync' value is modified.

◆ SetToDelayedSyncValue()

template<typename Type, xiiCVarType::Enum CVarType>
void xiiTypedCVar< Type, CVarType >::SetToDelayedSyncValue ( )
overridevirtual

Copies the 'DelayedSync' value into the 'Current' value.

This change will not trigger a 'delayed sync value changed' event, but it might trigger a 'current value changed' event. Code that uses a CVar that is flagged as 'RequiresDelayedSync' for its initialization (and which is the reason, that that CVar is flagged as such) should always call this BEFORE it uses the CVar value.

Implements xiiCVar.


The documentation for this class was generated from the following files:
  • /home/runner/work/XII/XII/Source/Engine/Foundation/Configuration/CVar.h
  • /home/runner/work/XII/XII/Source/Engine/Foundation/Configuration/Implementation/CVar_inl.h