aboutsummaryrefslogtreecommitdiff
path: root/common/session/custom/session.cxx
blob: f8cd10207b45c9144b62361351e75df872ff271c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// file      : common/session/custom/session.cxx
// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC
// license   : GNU GPL v2; see accompanying LICENSE file

#include <cassert>

#include "session.hxx"

session* session::current;

session::
session ()
{
  assert (current == 0);
  current = this;
}

session::
~session ()
{
  assert (current == this);
  current = 0;
}

void session::
flush (odb::database& db)
{
  for (type_map::iterator i (map_.begin ()), e (map_.end ()); i != e; ++i)
    i->second->flush (db);
}

void session::
mark ()
{
  for (type_map::iterator i (map_.begin ()), e (map_.end ()); i != e; ++i)
    i->second->mark ();
}