A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
flow-id-tag.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7 */
8#ifndef FLOW_ID_TAG_H
9#define FLOW_ID_TAG_H
10
11#include "ns3/tag.h"
12
13namespace ns3
14{
15
16class FlowIdTag : public Tag
17{
18 public:
19 /**
20 * \brief Get the type ID.
21 * \return the object TypeId
22 */
23 static TypeId GetTypeId();
24 TypeId GetInstanceTypeId() const override;
25 uint32_t GetSerializedSize() const override;
26 void Serialize(TagBuffer buf) const override;
27 void Deserialize(TagBuffer buf) override;
28 void Print(std::ostream& os) const override;
29 FlowIdTag();
30
31 /**
32 * Constructs a FlowIdTag with the given flow id
33 *
34 * \param flowId Id to use for the tag
35 */
36 FlowIdTag(uint32_t flowId);
37 /**
38 * Sets the flow id for the tag
39 * \param flowId Id to assign to the tag
40 */
41 void SetFlowId(uint32_t flowId);
42 /**
43 * Gets the flow id for the tag
44 * \returns current flow id for this tag
45 */
46 uint32_t GetFlowId() const;
47 /**
48 * Uses a static variable to generate sequential flow id
49 * \returns flow id allocated
50 */
51 static uint32_t AllocateFlowId();
52
53 private:
54 uint32_t m_flowId; //!< Flow ID
55};
56
57} // namespace ns3
58
59#endif /* FLOW_ID_TAG_H */
void Deserialize(TagBuffer buf) override
uint32_t GetFlowId() const
Gets the flow id for the tag.
void Serialize(TagBuffer buf) const override
void SetFlowId(uint32_t flowId)
Sets the flow id for the tag.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
static TypeId GetTypeId()
Get the type ID.
void Print(std::ostream &os) const override
uint32_t m_flowId
Flow ID.
Definition flow-id-tag.h:54
static uint32_t AllocateFlowId()
Uses a static variable to generate sequential flow id.
uint32_t GetSerializedSize() const override
read and write tag data
Definition tag-buffer.h:41
tag a set of bytes in a packet
Definition tag.h:28
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.