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 
25  protected:
26  typedef std::map<std::string, std::unique_ptr<persist_context>> context_map;
27 
30  public:
31  bool start_transaction();
32  bool end_transaction();
33  bool cancel_transaction();
34 
36  virtual ~persist_manager();
37 
38  persist_context &get_context(const std::string &ns);
39 };
context_map contexts_
std::map< std::string, std::unique_ptr< persist_context > > context_map
persist_context & get_context(const std::string &ns)
virtual ~persist_manager()