YAPOG  0.0.1
Yet Another Pokemon Online Game
DatabaseStream.hxx
Go to the documentation of this file.
1 #ifndef YAPOG_DATABASESTREAM_HXX
2 # define YAPOG_DATABASESTREAM_HXX
3 
5 
6 namespace yap
7 {
8  template <typename T>
9  inline void DatabaseStream::WriteData (const T& data)
10  {
11  try
12  {
13  pgStream_ << data;
14  }
15  catch (pgs::pg_excpt& e)
16  {
17  throw DatabaseException (e.full_error_txt ());
18  }
19  }
20 
21  template <typename T>
23  {
24  T data;
25  pgStream_ >> data;
26  return data;
27  }
28 } // namespace yap
29 
30 #endif // YAPOG_DATABASESTREAM_HXX