forest-net
an overlay networks for large-scale virtual worlds
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
PacketStoreTs.h
Go to the documentation of this file.
1
9
#ifndef PACKETSTORETS_H
10
#define PACKETSTORETS_H
11
12
#include "
Forest.h
"
13
#include "List.h"
14
#include "
Packet.h
"
15
16
namespace
forest {
17
18
19
typedef
int
pktx;
20
30
class
PacketStoreTs
{
31
public
:
32
PacketStoreTs
(
int
=10000);
33
~
PacketStoreTs
();
34
35
// getters
36
Packet
&
getPacket
(pktx)
const
;
37
//buffer_t& getBuffer(pktx) const;
38
//uint32_t* getPayload(pktx) const;
39
40
// allocate/free packets
41
pktx
alloc
();
42
void
free
(pktx);
43
pktx
fullCopy
(pktx);
44
45
// pack/unpack header fields to/from buffer
46
void
unpack(pktx);
47
void
pack(pktx);
48
49
// error checking
50
//bool hdrErrCheck(packet);
51
//bool payErrCheck(packet);
52
//void hdrErrUpdate(packet);
53
//void payErrUpdate(packet);
54
55
private
:
56
int
N
;
57
int
n
;
58
59
Packet
*
pkt
;
60
buffer_t *
buff
;
61
62
List *
freePkts
;
63
64
pthread_mutex_t
lock
;
65
};
66
71
inline
Packet
&
PacketStoreTs::getPacket
(pktx px)
const
{
72
return
pkt
[px];
73
}
74
137
}
// ends namespace
138
139
#endif
forest-net
cpp
include
PacketStoreTs.h
Generated on Mon Aug 4 2014 11:13:35 for forest-net by
1.8.4