author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Thu, 24 Apr 2008 14:52:59 -0700 | |
changeset 3035 | 644bfc099992 |
child 3037 | b0f12f3a75b3 |
permissions | -rw-r--r-- |
3035
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
1 |
#ifndef MTAG_BUFFER_H |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
#define MTAG_BUFFER_H |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
3 |
|
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
4 |
#include <stdint.h> |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
5 |
|
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
6 |
namespace ns3 { |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
|
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
class MtagBuffer |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
{ |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
public: |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
MtagBuffer (uint8_t *start, uint8_t *end); |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
void TrimAtEnd (uint32_t trim); |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
|
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
14 |
void WriteU8 (uint8_t v); |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
void WriteU16 (uint16_t v); |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
16 |
void WriteU32 (uint32_t v); |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
void WriteU64 (uint64_t v); |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
uint8_t ReadU8 (void); |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
uint16_t ReadU16 (void); |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
uint32_t ReadU32 (void); |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
21 |
uint64_t ReadU64 (void); |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
|
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
void CopyFrom (MtagBuffer o); |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
private: |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
25 |
|
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
uint8_t *m_current; |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
uint8_t *m_end; |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
28 |
}; |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
29 |
|
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
30 |
} // namespace ns3 |
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
31 |
|
644bfc099992
a new tag implementation: Mtag
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
32 |
#endif /* MTAG_BUFFER_H */ |