A Discrete-Event Network Simulator
API
flow-id-tag.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 INRIA
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18  */
19 #ifndef FLOW_ID_TAG_H
20 #define FLOW_ID_TAG_H
21 
22 #include "ns3/tag.h"
23 
24 namespace ns3
25 {
26 
27 class FlowIdTag : public Tag
28 {
29  public:
34  static TypeId GetTypeId();
35  TypeId GetInstanceTypeId() const override;
36  uint32_t GetSerializedSize() const override;
37  void Serialize(TagBuffer buf) const override;
38  void Deserialize(TagBuffer buf) override;
39  void Print(std::ostream& os) const override;
40  FlowIdTag();
41 
47  FlowIdTag(uint32_t flowId);
52  void SetFlowId(uint32_t flowId);
57  uint32_t GetFlowId() const;
62  static uint32_t AllocateFlowId();
63 
64  private:
65  uint32_t m_flowId;
66 };
67 
68 } // namespace ns3
69 
70 #endif /* FLOW_ID_TAG_H */
void Deserialize(TagBuffer buf) override
Definition: flow-id-tag.cc:61
uint32_t GetFlowId() const
Gets the flow id for the tag.
Definition: flow-id-tag.cc:95
void Serialize(TagBuffer buf) const override
Definition: flow-id-tag.cc:54
void SetFlowId(uint32_t flowId)
Sets the flow id for the tag.
Definition: flow-id-tag.cc:88
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition: flow-id-tag.cc:41
static TypeId GetTypeId()
Get the type ID.
Definition: flow-id-tag.cc:31
void Print(std::ostream &os) const override
Definition: flow-id-tag.cc:68
uint32_t m_flowId
Flow ID.
Definition: flow-id-tag.h:65
static uint32_t AllocateFlowId()
Uses a static variable to generate sequential flow id.
Definition: flow-id-tag.cc:102
uint32_t GetSerializedSize() const override
Definition: flow-id-tag.cc:47
read and write tag data
Definition: tag-buffer.h:52
tag a set of bytes in a packet
Definition: tag.h:39
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.