YAPOG  0.0.1
Yet Another Pokemon Online Game
DatabaseManager.cpp
Go to the documentation of this file.
3 
4 namespace yap
5 {
7  : dl_ (nullptr)
8  {
9  }
10 
12  {
13  }
14 
16  {
17  try
18  {
20  "dbname=yapog "
21  "user=postgres "
22  "password=COUCOU "
23  "port=5432");
24  }
25  catch (pgs::pg_excpt e)
26  {
27  std::cerr << e.full_error_txt ();
28  }
29  }
30 
32  {
33  if (dl_ != nullptr)
34  YAPOG_THROW("The log stream is already set !");
35 
36  dl_ = new DatabaseLogger (os);
37  }
38 
40  {
41  return connection_;
42  }
43 
45  {
46  return *dl_;
47  }
48 
49 } // namespace yap