Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2013 Mohammed J.F. Alenazi | 3 * Copyright (c) 2013 Mohammed J.F. Alenazi |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 29 matching lines...) Expand all Loading... | |
40 namespace Epidemic { | 40 namespace Epidemic { |
41 /** | 41 /** |
42 * Tag used by epidemic implementation | 42 * Tag used by epidemic implementation |
43 * \ingroup epidemic | 43 * \ingroup epidemic |
44 * Tag used to differentiate between locally generated packets | 44 * Tag used to differentiate between locally generated packets |
45 * and incoming packets in RoutingProtocol::RouteInput() function. | 45 * and incoming packets in RoutingProtocol::RouteInput() function. |
46 */ | 46 */ |
47 | 47 |
48 | 48 |
49 | 49 |
50 class EpidemicTag : public Tag | 50 class ControlTag : public Tag |
Peter Barnes
2015/02/03 01:25:48
Since this is already in namespace Epidemic, I sug
mjf.alenazi
2015/04/26 22:56:10
Done.
| |
51 { | 51 { |
52 | 52 |
53 public: | 53 public: |
54 /// TagType enum, two types for epidemic tags | 54 /// TagType enum, two types for epidemic tags |
55 enum TagType | 55 enum TagType |
56 { | 56 { |
57 CONTROL, //!< Tagged as control message | 57 CONTROL, //!< Tagged as control message |
58 NOT_SET, //!< Tag is not set | 58 NOT_SET, //!< Tag is not set |
Peter Barnes
2015/02/03 01:25:48
Align comments
mjf.alenazi
2015/04/26 22:56:09
Done.
| |
59 }; | 59 }; |
60 | 60 |
61 /// Constructor | 61 /// Constructor |
62 EpidemicTag (TagType o = NOT_SET) : Tag (), | 62 ControlTag (TagType o = NOT_SET) : Tag (), |
63 m_tag (o) | 63 m_tag (o) |
64 { | 64 { |
65 } | 65 } |
66 | 66 |
67 /// Get TypeId | 67 /** |
68 * Get the registered TypeId for this class. | |
69 * \return The object TypeId. | |
70 */ | |
68 static TypeId GetTypeId (); | 71 static TypeId GetTypeId (); |
Peter Barnes
2015/02/03 01:25:48
/**
* Get the registered TypeId for this class
mjf.alenazi
2015/04/26 22:56:09
Done.
| |
69 /// Get instanceTypeId | 72 // Inherited |
70 TypeId GetInstanceTypeId () const; | 73 TypeId GetInstanceTypeId () const; |
Peter Barnes
2015/02/03 01:25:48
Inherited, no docs here.
mjf.alenazi
2015/04/26 22:56:09
Done.
| |
71 | 74 |
72 /// Get epidemic tag | 75 /// \returns control tag type |
73 TagType GetTagType () const; | 76 TagType GetTagType () const; |
Peter Barnes
2015/02/03 01:25:48
Document return value.
mjf.alenazi
2015/04/26 22:56:10
Done.
| |
74 | 77 |
75 /** | 78 /** |
76 * Check if this EpidemicTag is of the indicated TagType. | 79 * Check if this ControlTag is of the indicated TagType. |
77 * | 80 * |
78 * \param type The expected TagType | 81 * \param type The expected TagType |
79 * \return true if \p type matches the TagType of this EpidemicTag. | 82 * \returns true if \p type matches the TagType of this ControlTag. |
80 */ | 83 */ |
81 bool IsTagType (const TagType type) const; | 84 bool IsTagType (const TagType type) const; |
82 | 85 |
83 | 86 |
84 | 87 |
85 /// Set epidemic tag | 88 /// Set epidemic tag by \p tag |
86 void SetTagType (const TagType tag); | 89 void SetTagType (const TagType tag); |
Peter Barnes
2015/02/03 01:25:48
Document argument.
mjf.alenazi
2015/04/26 22:56:09
Done.
|
Peter Barnes
2015/04/28 23:42:33
Explicitly document arguments:
* \param tag …
mjf.alenazi
2017/05/13 23:57:16
Done.
|
87 | 90 // Inherited |
88 /// Get size | |
89 uint32_t GetSerializedSize () const; | 91 uint32_t GetSerializedSize () const; |
Peter Barnes
2015/02/03 01:25:48
Inherited, no docs here.
mjf.alenazi
2015/04/26 22:56:09
Done.
| |
90 | |
91 /// Serialize | |
92 void Serialize (TagBuffer i) const; | 92 void Serialize (TagBuffer i) const; |
Peter Barnes
2015/02/03 01:25:48
Inherited, no docs here.
mjf.alenazi
2015/04/26 22:56:09
Done.
| |
93 ///Deserialize | |
94 void Deserialize (TagBuffer i); | 93 void Deserialize (TagBuffer i); |
Peter Barnes
2015/02/03 01:25:48
Inherited, no docs here.
mjf.alenazi
2015/04/26 22:56:09
Done.
| |
95 /// Print | |
96 void Print (std::ostream &os) const; | 94 void Print (std::ostream &os) const; |
Peter Barnes
2015/02/03 01:25:48
Inherited, no docs here.
mjf.alenazi
2015/04/26 22:56:09
Done.
| |
97 | 95 |
98 private: | 96 private: |
99 /// epidemic tag | 97 /// epidemic tag |
100 TagType m_tag; | 98 TagType m_tag; |
101 }; | 99 }; |
102 | 100 |
103 | 101 |
104 | 102 |
105 | 103 |
106 | 104 |
107 } //end namespace epidemic | 105 } //end namespace epidemic |
108 } //end namespace ns3 | 106 } //end namespace ns3 |
109 #endif | 107 #endif |
LEFT | RIGHT |