The Battle for Wesnoth  1.15.1+dev
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
persist_context Class Referenceabstract

#include <persist_context.hpp>

Inheritance diagram for persist_context:
Inheritance graph

Classes

struct  name_space
 

Public Member Functions

virtual ~persist_context ()
 
virtual bool clear_var (const std::string &, bool immediate=false)=0
 
virtual config get_var (const std::string &) const =0
 
virtual bool set_var (const std::string &, const config &, bool immediate=false)=0
 
virtual bool start_transaction ()=0
 
virtual bool end_transaction ()=0
 
virtual bool cancel_transaction ()=0
 
std::string get_node () const
 
void set_node (const std::string &)
 
bool valid () const
 
bool dirty () const
 
 operator bool () const
 

Protected Member Functions

 persist_context ()
 
 persist_context (const std::string &name_space)
 
configget_node (config &cfg, name_space &ns, bool force=false)
 
const configget_node (const config &cfg, const name_space &ns) const
 

Protected Attributes

config cfg_
 
name_space namespace_
 
bool valid_
 
bool in_transaction_
 

Detailed Description

Definition at line 24 of file persist_context.hpp.

Constructor & Destructor Documentation

◆ ~persist_context()

virtual persist_context::~persist_context ( )
inlinevirtual

Definition at line 27 of file persist_context.hpp.

◆ persist_context() [1/2]

persist_context::persist_context ( )
inlineprotected

Definition at line 107 of file persist_context.hpp.

◆ persist_context() [2/2]

persist_context::persist_context ( const std::string &  name_space)
inlineprotected

Definition at line 114 of file persist_context.hpp.

Member Function Documentation

◆ cancel_transaction()

virtual bool persist_context::cancel_transaction ( )
pure virtual

Implemented in persist_file_context.

Referenced by get_node().

◆ clear_var()

virtual bool persist_context::clear_var ( const std::string &  ,
bool  immediate = false 
)
pure virtual

Implemented in persist_file_context.

Referenced by clear_global_variable(), and get_node().

◆ dirty()

bool persist_context::dirty ( ) const
inline

Definition at line 157 of file persist_context.hpp.

◆ end_transaction()

virtual bool persist_context::end_transaction ( )
pure virtual

Implemented in persist_file_context.

Referenced by get_node().

◆ get_node() [1/3]

config* persist_context::get_node ( config cfg,
name_space ns,
bool  force = false 
)
inlineprotected

◆ get_node() [2/3]

const config* persist_context::get_node ( const config cfg,
const name_space ns 
) const
inlineprotected

◆ get_node() [3/3]

std::string persist_context::get_node ( ) const

◆ get_var()

virtual config persist_context::get_var ( const std::string &  ) const
pure virtual

Implemented in persist_file_context.

Referenced by get_node(), and persist_choice::query_user().

◆ operator bool()

persist_context::operator bool ( ) const
inline

Definition at line 160 of file persist_context.hpp.

References persist_context::name_space::valid_.

◆ set_node()

void persist_context::set_node ( const std::string &  name)

Definition at line 244 of file persist_context.cpp.

References namespace_, and persist_context::name_space::root_.

Referenced by persist_manager::get_context(), and get_node().

◆ set_var()

virtual bool persist_context::set_var ( const std::string &  ,
const config ,
bool  immediate = false 
)
pure virtual

Implemented in persist_file_context.

Referenced by get_node(), and set_global_variable().

◆ start_transaction()

virtual bool persist_context::start_transaction ( )
pure virtual

Implemented in persist_file_context.

Referenced by get_node().

◆ valid()

bool persist_context::valid ( ) const
inline

Member Data Documentation

◆ cfg_

config persist_context::cfg_
protected

◆ in_transaction_

bool persist_context::in_transaction_
protected

◆ namespace_

name_space persist_context::namespace_
protected

◆ valid_

bool persist_context::valid_
protected

Definition at line 104 of file persist_context.hpp.


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