V-Gears 0
Free Final Fantasy VII engine.
ConfigVar Class Reference

A configuration variable. More...

#include <ConfigVar.h>

Collaboration diagram for ConfigVar:

Public Member Functions

 ConfigVar (const Ogre::String &name, const Ogre::String &description, const Ogre::String &default_value)
 Constructor. More...
 
int GetI () const
 Retrieves the value of the variable in integer form. More...
 
float GetF () const
 Retrieves the value of the variable in float form. More...
 
bool GetB () const
 Retrieves the value of the variable in boolean form. More...
 
Ogre::String GetS () const
 Retrieves the value of the variable in string form. More...
 
void SetI (int value)
 Sets the integer value of the variable. More...
 
void SetF (float value)
 Sets the float value of the variable. More...
 
void SetB (bool value)
 Sets the boolean value of the variable. More...
 
void SetS (const Ogre::String &value)
 Sets the string value of the variable. More...
 
const Ogre::String & GetName () const
 Retrieves the variable name. More...
 
const Ogre::String & GetDescription () const
 Retrieves the variable description. More...
 
const Ogre::String & GetDefaultValue () const
 Retrieves the variable default value. More...
 
void UpdateVariables ()
 Updates the integer and float values from the string value. More...
 

Private Member Functions

 ConfigVar (const ConfigVar &)=delete
 Forbidden copy constructor. More...
 
ConfigVaroperator= (const ConfigVar &)=delete
 Forbidden copy constructor. More...
 

Private Attributes

Ogre::String name_
 The variable name. More...
 
Ogre::String description_
 The variable description. More...
 
Ogre::String default_value_
 The variable default value. More...
 
int value_i_
 Variable value, integer format. More...
 
float value_f_
 Variable value, float format. More...
 
bool value_b_
 Variable value, integer format. More...
 
Ogre::String value_s_
 Variable value, string format. More...
 
ConfigVarprevious_
 

Static Private Attributes

static ConfigVarstatic_config_var_list_ = nullptr
 

Friends

class ConfigVarHandler
 

Detailed Description

A configuration variable.

Constructor & Destructor Documentation

◆ ConfigVar() [1/2]

ConfigVar::ConfigVar ( const Ogre::String &  name,
const Ogre::String &  description,
const Ogre::String &  default_value 
)

Constructor.

Parameters
[in]nameThe variable name.
[in]descriptionA human-friendly description for the variable.
[in]default_valueThe default value for the variable.

◆ ConfigVar() [2/2]

ConfigVar::ConfigVar ( const ConfigVar )
privatedelete

Forbidden copy constructor.

Member Function Documentation

◆ GetB()

bool ConfigVar::GetB ( ) const

Retrieves the value of the variable in boolean form.

Returns
The variable value.

◆ GetDefaultValue()

const Ogre::String & ConfigVar::GetDefaultValue ( ) const

Retrieves the variable default value.

Returns
The variable default value.

◆ GetDescription()

const Ogre::String & ConfigVar::GetDescription ( ) const

Retrieves the variable description.

Returns
The variable description.

◆ GetF()

float ConfigVar::GetF ( ) const

Retrieves the value of the variable in float form.

Returns
The variable value.

◆ GetI()

int ConfigVar::GetI ( ) const

Retrieves the value of the variable in integer form.

Returns
The variable value.

◆ GetName()

const Ogre::String & ConfigVar::GetName ( ) const

Retrieves the variable name.

Returns
The variable name.

◆ GetS()

Ogre::String ConfigVar::GetS ( ) const

Retrieves the value of the variable in string form.

Returns
The variable value.

◆ operator=()

ConfigVar & ConfigVar::operator= ( const ConfigVar )
privatedelete

Forbidden copy constructor.

◆ SetB()

void ConfigVar::SetB ( bool  value)

Sets the boolean value of the variable.

Parameters
[in]valueThe variable value.

◆ SetF()

void ConfigVar::SetF ( float  value)

Sets the float value of the variable.

Parameters
[in]valueThe variable value.

◆ SetI()

void ConfigVar::SetI ( int  value)

Sets the integer value of the variable.

Parameters
[in]valueThe variable value.

◆ SetS()

void ConfigVar::SetS ( const Ogre::String &  value)

Sets the string value of the variable.

Parameters
[in]valueThe variable value.

◆ UpdateVariables()

void ConfigVar::UpdateVariables ( )

Updates the integer and float values from the string value.

Friends And Related Function Documentation

◆ ConfigVarHandler

friend class ConfigVarHandler
friend

Member Data Documentation

◆ default_value_

Ogre::String ConfigVar::default_value_
private

The variable default value.

◆ description_

Ogre::String ConfigVar::description_
private

The variable description.

◆ name_

Ogre::String ConfigVar::name_
private

The variable name.

◆ previous_

ConfigVar* ConfigVar::previous_
private
Todo:
Understand and document.

◆ static_config_var_list_

ConfigVar * ConfigVar::static_config_var_list_ = nullptr
staticprivate
Todo:
Understand and document.

◆ value_b_

bool ConfigVar::value_b_
private

Variable value, integer format.

◆ value_f_

float ConfigVar::value_f_
private

Variable value, float format.

◆ value_i_

int ConfigVar::value_i_
private

Variable value, integer format.

◆ value_s_

Ogre::String ConfigVar::value_s_
private

Variable value, string format.


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