Last change
on this file since 346 was
346,
checked in by rgrieder, 16 years ago
|
- adjusted the entire source to compile under windows visual studio too:
- added some ugly conversions
- changed some illegal code pieces (gcc however accepted it)
- added a few files from reto's framework to evade linker errors (no more dynamic linking)
- inserted some 'return true' to justify the return type
- excluded the levelLoader in the orxonox.cc (couldn't make it work, parsing error)
- wrote about 5 code #branches to compensate for missing usleep() under windows
|
File size:
634 bytes
|
Line | |
---|
1 | #include "PacketBuffer.h" |
---|
2 | #include "PacketBuffer.cc" |
---|
3 | #include <iostream> |
---|
4 | #include <string> |
---|
5 | |
---|
6 | using namespace network; |
---|
7 | |
---|
8 | int main(int argc, char **argv[]){ |
---|
9 | PacketBuffer test = PacketBuffer(); |
---|
10 | PacketEnvelope p={8, 5}; |
---|
11 | if(test.isEmpty()) |
---|
12 | std::cout << "empty buffer" << std::endl; |
---|
13 | for(int i=0; i<10; i++){ |
---|
14 | p.data=i*i; |
---|
15 | std::cout << i << ": pushing " << p.data << std::endl; |
---|
16 | test.push((ENetEvent*)&p); |
---|
17 | } |
---|
18 | std::cout << std::endl << "queue.print()" << std::endl; |
---|
19 | test.print(); |
---|
20 | while(!test.isEmpty()){ |
---|
21 | int i = (int)test.pop()->data; |
---|
22 | std::cout << "We popped the value " << i << std::endl; |
---|
23 | } |
---|
24 | return 0; |
---|
25 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.