YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
NetworkHandler.cpp
Go to the documentation of this file.
1
#include "
YAPOG/System/Network/NetworkHandler.hpp
"
2
#include "
YAPOG/System/Network/Packet.hpp
"
3
#include "
YAPOG/System/Network/ClientSocket.hpp
"
4
5
namespace
yap
6
{
7
NetworkHandler::NetworkHandler
(
ClientSocket
& socket)
8
:
socket_
(socket)
9
, packets_ ()
10
{
11
}
12
13
void
NetworkHandler::Refresh
()
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
26
bool
NetworkHandler::IsEmpty
()
const
27
{
28
return
packets_
.
IsEmpty
();
29
}
30
31
PacketPtrType
NetworkHandler::GetPacket
()
32
{
33
PacketPtrType
packet;
34
35
return
packets_
.
Dequeue
(packet);
36
}
37
}
// namespace yap
YAPOG
src
YAPOG
System
Network
NetworkHandler.cpp
Generated on Mon Sep 17 2012 22:24:26 for YAPOG by
1.8.1.1