persist manager: move ctor, dtor out of header
This allows to remove an unnecessary inclusion. Because the persist manager is included directly by the play controller header, this eliminates unnecessary inclusions in many files.
This commit is contained in:
parent
3ff112831a
commit
ba094eff71
2 changed files with 18 additions and 7 deletions
|
@ -17,6 +17,17 @@
|
|||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
persist_manager::persist_manager()
|
||||
: in_transaction_(false)
|
||||
, contexts_()
|
||||
{}
|
||||
|
||||
persist_manager::~persist_manager() {
|
||||
cancel_transaction();
|
||||
for (context_map::iterator i = contexts_.begin(); i != contexts_.end(); ++i)
|
||||
delete (i->second);
|
||||
}
|
||||
|
||||
persist_context &persist_manager::get_context(const std::string &ns)
|
||||
{
|
||||
persist_context::name_space name(ns,true);
|
||||
|
|
|
@ -15,7 +15,10 @@
|
|||
#ifndef PERSIST_MANAGER_HPP_INCLUDED
|
||||
#define PERSIST_MANAGER_HPP_INCLUDED
|
||||
|
||||
#include "persist_context.hpp"
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
class persist_context;
|
||||
|
||||
class persist_manager {
|
||||
protected:
|
||||
|
@ -28,12 +31,9 @@ class persist_manager {
|
|||
bool end_transaction();
|
||||
bool cancel_transaction();
|
||||
|
||||
persist_manager() : in_transaction_(false),contexts_() {}
|
||||
virtual ~persist_manager() {
|
||||
cancel_transaction();
|
||||
for (context_map::iterator i = contexts_.begin(); i != contexts_.end(); ++i)
|
||||
delete (i->second);
|
||||
}
|
||||
persist_manager();
|
||||
virtual ~persist_manager();
|
||||
|
||||
persist_context &get_context(const std::string &ns);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue