equal
deleted
inserted
replaced
45 class Object : public ObjectBase |
45 class Object : public ObjectBase |
46 { |
46 { |
47 public: |
47 public: |
48 static TypeId GetTypeId (void); |
48 static TypeId GetTypeId (void); |
49 |
49 |
|
50 /** |
|
51 * \brief Iterate over the objects aggregated to an ns3::Object. |
|
52 * |
|
53 * This iterator does not allow you to iterate over the initial |
|
54 * object used to call Object::GetAggregateIterator. |
|
55 * |
|
56 * Note: this is a java-style iterator. |
|
57 */ |
50 class AggregateIterator |
58 class AggregateIterator |
51 { |
59 { |
52 public: |
60 public: |
53 AggregateIterator (); |
61 AggregateIterator (); |
54 |
62 |
|
63 /** |
|
64 * \returns true if HasNext can be called and return a non-null |
|
65 * pointer, false otherwise. |
|
66 */ |
55 bool HasNext (void) const; |
67 bool HasNext (void) const; |
|
68 |
|
69 /** |
|
70 * \returns the next aggregated object. |
|
71 */ |
56 Ptr<const Object> Next (void); |
72 Ptr<const Object> Next (void); |
57 private: |
73 private: |
58 friend class Object; |
74 friend class Object; |
59 AggregateIterator (Ptr<const Object> first); |
75 AggregateIterator (Ptr<const Object> first); |
60 Ptr<const Object> m_first; |
76 Ptr<const Object> m_first; |
112 * method returns, it becomes possible to call GetObject |
128 * method returns, it becomes possible to call GetObject |
113 * on one to get the other, and vice-versa. |
129 * on one to get the other, and vice-versa. |
114 */ |
130 */ |
115 void AggregateObject (Ptr<Object> other); |
131 void AggregateObject (Ptr<Object> other); |
116 |
132 |
|
133 /** |
|
134 * \returns an iterator to the first object aggregated to this |
|
135 * object. |
|
136 * |
|
137 * If no objects are aggregated to this object, then, the returned |
|
138 * iterator will be empty and AggregateIterator::HasNext will |
|
139 * always return false. |
|
140 */ |
117 AggregateIterator GetAggregateIterator (void) const; |
141 AggregateIterator GetAggregateIterator (void) const; |
118 |
142 |
119 protected: |
143 protected: |
120 /** |
144 /** |
121 * This method is called by Object::Dispose or by the object's |
145 * This method is called by Object::Dispose or by the object's |