YAPOG  0.0.1
Yet Another Pokemon Online Game
NetworkHandler.cpp
Go to the documentation of this file.
4 
5 namespace yap
6 {
8  : socket_ (socket)
9  , packets_ ()
10  {
11  }
12 
14  {
15  while (true)
16  {
17  PacketPtrType packet (new Packet ());
18 
19  if (!packet->CreateFromSocket (socket_))
20  break;
21 
22  packets_.Enqueue (packet);
23  }
24  }
25 
27  {
28  return packets_.IsEmpty ();
29  }
30 
32  {
33  PacketPtrType packet;
34 
35  return packets_.Dequeue (packet);
36  }
37 } // namespace yap