equal
deleted
inserted
replaced
1 #ifndef MTAG_LIST_H |
|
2 #define MTAG_LIST_H |
|
3 |
|
4 #include <stdint.h> |
|
5 #include "ns3/type-id.h" |
|
6 #include "mtag-buffer.h" |
|
7 |
|
8 namespace ns3 { |
|
9 |
|
10 class TagList |
|
11 { |
|
12 public: |
|
13 |
|
14 class Iterator |
|
15 { |
|
16 public: |
|
17 struct Item |
|
18 { |
|
19 TypeId tid; |
|
20 uint32_t size; |
|
21 uint32_t start; |
|
22 uint32_t end; |
|
23 TagBuffer buf; |
|
24 private: |
|
25 friend class TagList; |
|
26 Item (TagBuffer buf); |
|
27 }; |
|
28 bool HasNext (void) const; |
|
29 struct TagList::Iterator::Item Next (void); |
|
30 uint32_t GetOffsetStart (void) const; |
|
31 private: |
|
32 friend class TagList; |
|
33 Iterator (uint8_t *start, uint8_t *end, uint32_t offsetStart, uint32_t offsetEnd); |
|
34 void PrepareForNext (void); |
|
35 uint8_t *m_current; |
|
36 uint8_t *m_end; |
|
37 uint32_t m_offsetStart; |
|
38 uint32_t m_offsetEnd; |
|
39 }; |
|
40 |
|
41 TagList (); |
|
42 TagList (const TagList &o); |
|
43 TagList &operator = (const TagList &o); |
|
44 ~TagList (); |
|
45 |
|
46 TagBuffer Add (TypeId tid, uint32_t bufferSize, uint32_t start, uint32_t end); |
|
47 |
|
48 void Add (const TagList &o); |
|
49 |
|
50 void Remove (const Iterator &i); |
|
51 void RemoveAll (void); |
|
52 |
|
53 TagList::Iterator Begin (uint32_t offsetStart, uint32_t offsetEnd) const; |
|
54 |
|
55 void AddAtEnd (int32_t adjustment, uint32_t appendOffset); |
|
56 void AddAtStart (int32_t adjustment, uint32_t prependOffset); |
|
57 |
|
58 private: |
|
59 bool IsDirtyAtEnd (uint32_t appendOffset); |
|
60 bool IsDirtyAtStart (uint32_t prependOffset); |
|
61 uint8_t *m_buffer; |
|
62 uint32_t m_size; |
|
63 }; |
|
64 |
|
65 } // namespace ns3 |
|
66 |
|
67 #endif /* MTAG_LIST_H */ |
|