The Battle for Wesnoth
1.19.5+dev
persist_manager.hpp
Go to the documentation of this file.
1
/*
2
Copyright (C) 2010 - 2024
3
by Jody Northup
4
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY.
12
13
See the COPYING file for more details.
14
*/
15
16
#pragma once
17
18
#include <map>
19
#include <memory>
20
#include <string>
21
22
class
persist_context
;
23
24
class
persist_manager
{
25
protected
:
26
typedef
std::map<std::string, std::unique_ptr<persist_context>>
context_map
;
27
28
bool
in_transaction_
;
29
context_map
contexts_
;
30
public
:
31
bool
start_transaction
();
32
bool
end_transaction
();
33
bool
cancel_transaction
();
34
35
persist_manager
();
36
virtual
~persist_manager
();
37
38
persist_context
&
get_context
(
const
std::string &ns);
39
};
persist_context
Definition:
persist_context.hpp:25
persist_manager
Definition:
persist_manager.hpp:24
persist_manager::contexts_
context_map contexts_
Definition:
persist_manager.hpp:29
persist_manager::context_map
std::map< std::string, std::unique_ptr< persist_context > > context_map
Definition:
persist_manager.hpp:26
persist_manager::start_transaction
bool start_transaction()
Definition:
persist_manager.cpp:44
persist_manager::in_transaction_
bool in_transaction_
Definition:
persist_manager.hpp:28
persist_manager::get_context
persist_context & get_context(const std::string &ns)
Definition:
persist_manager.cpp:28
persist_manager::persist_manager
persist_manager()
Definition:
persist_manager.cpp:19
persist_manager::end_transaction
bool end_transaction()
Definition:
persist_manager.cpp:54
persist_manager::~persist_manager
virtual ~persist_manager()
Definition:
persist_manager.cpp:24
persist_manager::cancel_transaction
bool cancel_transaction()
Definition:
persist_manager.cpp:64
Generated by
1.9.1