author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Wed, 09 Apr 2008 17:35:18 -0700 | |
changeset 2937 | fc048c358357 |
parent 2715 | cc2eb4718176 |
child 2938 | 621b23d5be5b |
permissions | -rw-r--r-- |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
/* |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
3 |
* Copyright (c) 2007 INRIA, Gustavo Carneiro |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
4 |
* |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
* |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
* |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
* Authors: Gustavo Carneiro <gjcarneiro@gmail.com>, |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
* Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
*/ |
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
21 |
#ifndef OBJECT_H |
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
22 |
#define OBJECT_H |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
|
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
#include <stdint.h> |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
25 |
#include <string> |
2542
a9b88fdc09d6
kill TraceResolver et al.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2531
diff
changeset
|
26 |
#include <vector> |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
#include "ptr.h" |
2438
e2ac9f9aeeb9
value.h -> attribute.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
28 |
#include "attribute.h" |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
29 |
#include "object-base.h" |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2631
diff
changeset
|
30 |
#include "attribute-list.h" |
2246
3645f5e344a4
add NS_OBJECT_ENSURE_REGISTERED
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2244
diff
changeset
|
31 |
|
3645f5e344a4
add NS_OBJECT_ENSURE_REGISTERED
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2244
diff
changeset
|
32 |
|
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
33 |
namespace ns3 { |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
34 |
|
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
35 |
class Object; |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
36 |
class AttributeAccessor; |
2437
44e34ffee8e3
Value -> AttributeValue
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2436
diff
changeset
|
37 |
class AttributeValue; |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
38 |
class AttributeList; |
2463
c77e43117673
actually allow connection and disconnection to trace sources registered in TypeIds
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2460
diff
changeset
|
39 |
class TraceSourceAccessor; |
1336
de5a133ece8a
add Object::TraceConnect, TraceDisconnect, and GetTraceResolver methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1330
diff
changeset
|
40 |
|
718 | 41 |
/** |
42 |
* \brief a base class which provides memory management and object aggregation |
|
43 |
* |
|
44 |
*/ |
|
2370
5f7ad186b798
introduce ObjectBase
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
45 |
class Object : public ObjectBase |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
46 |
{ |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
47 |
public: |
2251
04963d8cca51
iid (void) -> GetTypeId (void)
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2250
diff
changeset
|
48 |
static TypeId GetTypeId (void); |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
49 |
|
2937
fc048c358357
iterate over aggregated objects dynamically.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2715
diff
changeset
|
50 |
class AggregateIterator |
fc048c358357
iterate over aggregated objects dynamically.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2715
diff
changeset
|
51 |
{ |
fc048c358357
iterate over aggregated objects dynamically.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2715
diff
changeset
|
52 |
public: |
fc048c358357
iterate over aggregated objects dynamically.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2715
diff
changeset
|
53 |
AggregateIterator (); |
fc048c358357
iterate over aggregated objects dynamically.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2715
diff
changeset
|
54 |
|
fc048c358357
iterate over aggregated objects dynamically.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2715
diff
changeset
|
55 |
bool HasNext (void) const; |
fc048c358357
iterate over aggregated objects dynamically.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2715
diff
changeset
|
56 |
Ptr<const Object> Next (void); |
fc048c358357
iterate over aggregated objects dynamically.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2715
diff
changeset
|
57 |
private: |
fc048c358357
iterate over aggregated objects dynamically.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2715
diff
changeset
|
58 |
friend class Object; |
fc048c358357
iterate over aggregated objects dynamically.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2715
diff
changeset
|
59 |
AggregateIterator (Ptr<const Object> first); |
fc048c358357
iterate over aggregated objects dynamically.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2715
diff
changeset
|
60 |
Ptr<const Object> m_first; |
fc048c358357
iterate over aggregated objects dynamically.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2715
diff
changeset
|
61 |
Ptr<const Object> m_current; |
fc048c358357
iterate over aggregated objects dynamically.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2715
diff
changeset
|
62 |
}; |
fc048c358357
iterate over aggregated objects dynamically.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2715
diff
changeset
|
63 |
|
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
64 |
Object (); |
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
65 |
virtual ~Object (); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
66 |
|
2670
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
67 |
/* |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
68 |
* Implement the GetInstanceTypeId method defined in ObjectBase. |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
69 |
*/ |
2634
44a92f1d3728
introduce ObjectBase::GetInstanceTypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
70 |
virtual TypeId GetInstanceTypeId (void) const; |
44a92f1d3728
introduce ObjectBase::GetInstanceTypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
71 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
72 |
/** |
718 | 73 |
* Increment the reference count. This method should not be called |
74 |
* by user code. Object instances are expected to be used in conjunction |
|
75 |
* of the Ptr template which would make calling Ref unecessary and |
|
76 |
* dangerous. |
|
77 |
*/ |
|
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
78 |
inline void Ref (void) const; |
718 | 79 |
/** |
80 |
* Decrement the reference count. This method should not be called |
|
81 |
* by user code. Object instances are expected to be used in conjunction |
|
82 |
* of the Ptr template which would make calling Ref unecessary and |
|
83 |
* dangerous. |
|
84 |
*/ |
|
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
85 |
inline void Unref (void) const; |
718 | 86 |
/** |
87 |
* \returns a pointer to the requested interface or zero if it could not be found. |
|
2231
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
88 |
*/ |
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
89 |
template <typename T> |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
90 |
Ptr<T> GetObject (void) const; |
2231
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
91 |
/** |
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
92 |
* \param tid the interface id of the requested interface |
2231
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
93 |
* \returns a pointer to the requested interface or zero if it could not be found. |
718 | 94 |
*/ |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
95 |
template <typename T> |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
96 |
Ptr<T> GetObject (TypeId tid) const; |
718 | 97 |
/** |
98 |
* Run the DoDispose methods of this object and all the |
|
99 |
* objects aggregated to it. |
|
100 |
* After calling this method, the object is expected to be |
|
101 |
* totally unusable except for the Ref and Unref methods. |
|
102 |
* It is an error to call Dispose twice on the same object |
|
2715 | 103 |
* instance. |
104 |
* |
|
105 |
* This method is typically used to break reference cycles. |
|
718 | 106 |
*/ |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
107 |
void Dispose (void); |
718 | 108 |
/** |
109 |
* \param other another object pointer |
|
110 |
* |
|
111 |
* This method aggregates the two objects together: after this |
|
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
112 |
* method returns, it becomes possible to call GetObject |
718 | 113 |
* on one to get the other, and vice-versa. |
114 |
*/ |
|
2258
666099a753e0
AddInterface -> AggregateObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2257
diff
changeset
|
115 |
void AggregateObject (Ptr<Object> other); |
1330
d67fce6d56f8
add refcounting to TraceResolver
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
718
diff
changeset
|
116 |
|
2937
fc048c358357
iterate over aggregated objects dynamically.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2715
diff
changeset
|
117 |
AggregateIterator GetAggregateIterator (void) const; |
fc048c358357
iterate over aggregated objects dynamically.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2715
diff
changeset
|
118 |
|
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
119 |
protected: |
718 | 120 |
/** |
2715 | 121 |
* This method is called by Object::Dispose or by the object's |
122 |
* destructor, whichever comes first. |
|
123 |
* |
|
124 |
* Subclasses are expected to implement their real destruction |
|
125 |
* code in an overriden version of this method and chain |
|
2230
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
126 |
* up to their parent's implementation once they are done. |
2715 | 127 |
* i.e., for simplicity, the destructor of every subclass should |
128 |
* be empty and its content should be moved to the associated |
|
129 |
* DoDispose method. |
|
2230
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
130 |
*/ |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
131 |
virtual void DoDispose (void); |
2667
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
132 |
/** |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
133 |
* \param o the object to copy. |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
134 |
* |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
135 |
* Allow subclasses to implement a copy constructor. |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
136 |
* While it is technically possible to implement a copy |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
137 |
* constructor in a subclass, we strongly discourage you |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
138 |
* to do so. If you really want to do it anyway, you have |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
139 |
* to understand that this copy constructor will _not_ |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
140 |
* copy aggregated objects. i.e., if your object instance |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
141 |
* is already aggregated to another object and if you invoke |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
142 |
* this copy constructor, the new object instance will be |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
143 |
* a pristine standlone object instance not aggregated to |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
144 |
* any other object. It is thus _your_ responsability |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
145 |
* as a caller of this method to do what needs to be done |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
146 |
* (if it is needed) to ensure that the object stays in a |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
147 |
* valid state. |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
148 |
*/ |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
149 |
Object (const Object &o); |
2230
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
150 |
private: |
2667
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
151 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
152 |
template <typename T> |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
153 |
friend Ptr<T> CreateObject (const AttributeList &attributes); |
2607
8dd96726ef24
add CopyObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
154 |
template <typename T> |
8dd96726ef24
add CopyObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
155 |
friend Ptr<T> CopyObject (Ptr<T> object); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
156 |
|
2631
365595f1f9a8
replace TypeId::CreateObject with TypeId::GetConstructor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2607
diff
changeset
|
157 |
friend class ObjectFactory; |
2937
fc048c358357
iterate over aggregated objects dynamically.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2715
diff
changeset
|
158 |
friend class AggregateIterator; |
2631
365595f1f9a8
replace TypeId::CreateObject with TypeId::GetConstructor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2607
diff
changeset
|
159 |
|
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
160 |
Ptr<Object> DoGetObject (TypeId tid) const; |
2230
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
161 |
bool Check (void) const; |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
162 |
bool CheckLoose (void) const; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
163 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
164 |
* Attempt to delete this object. This method iterates |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
165 |
* over all aggregated objects to check if they all |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
166 |
* have a zero refcount. If yes, the object and all |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
167 |
* its aggregates are deleted. If not, nothing is done. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
168 |
*/ |
2230
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
169 |
void MaybeDelete (void) const; |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
170 |
/** |
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
171 |
* \param tid an TypeId |
718 | 172 |
* |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
173 |
* Invoked from ns3::CreateObject only. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
174 |
* Initialize the m_tid member variable to |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
175 |
* keep track of the type of this object instance. |
718 | 176 |
*/ |
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
177 |
void SetTypeId (TypeId tid); |
2637
ac94e4889027
move attribute code to ObjectBase.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2635
diff
changeset
|
178 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
179 |
* \param attributes the attribute values used to initialize |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
180 |
* the member variables of this object's instance. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
181 |
* |
2637
ac94e4889027
move attribute code to ObjectBase.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2635
diff
changeset
|
182 |
* Invoked from ns3::ObjectFactory::Create and ns3::CreateObject only. |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
183 |
* Initialize all the member variables which were |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
184 |
* registered with the associated TypeId. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
185 |
*/ |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
186 |
void Construct (const AttributeList &attributes); |
2230
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
187 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
188 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
189 |
* The reference count for this object. Each aggregate |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
190 |
* has an individual reference count. When the global |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
191 |
* reference count (the sum of all reference counts) |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
192 |
* reaches zero, the object and all its aggregates is |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
193 |
* deleted. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
194 |
*/ |
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
195 |
mutable uint32_t m_count; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
196 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
197 |
* Identifies the type of this object instance. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
198 |
*/ |
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
199 |
TypeId m_tid; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
200 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
201 |
* Set to true when the DoDispose method of the object |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
202 |
* has run, false otherwise. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
203 |
*/ |
713
c3c745a80610
add a m_disposed field and check it
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
712
diff
changeset
|
204 |
bool m_disposed; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
205 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
206 |
* A pointer to the next aggregate object. This is a circular |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
207 |
* linked list of aggregated objects: the last one points |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
208 |
* back to the first one. If an object is not aggregated to |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
209 |
* any other object, the value of this field is equal to the |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
210 |
* value of the 'this' pointer. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
211 |
*/ |
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
212 |
Object *m_next; |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
213 |
}; |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
214 |
|
2670
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
215 |
/** |
2688
cf03845fc7ca
fix dox warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
216 |
* \param object a pointer to the object to copy. |
2670
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
217 |
* \returns a copy of the input object. |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
218 |
* |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
219 |
* This method invoke the copy constructor of the input object |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
220 |
* and returns the new instance. |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
221 |
*/ |
2667
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
222 |
template <typename T> |
2688
cf03845fc7ca
fix dox warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
223 |
Ptr<T> CopyObject (Ptr<T> object); |
2667
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
224 |
|
2670
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
225 |
/** |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
226 |
* \param attributes a list of attributes to set on the |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
227 |
* object during construction. |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
228 |
* \returns a pointer to a newly allocated object. |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
229 |
* |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
230 |
* This allocates an object on the heap and initializes |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
231 |
* it with a set of attributes. |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
232 |
*/ |
2667
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
233 |
template <typename T> |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
234 |
Ptr<T> CreateObject (const AttributeList &attributes); |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
235 |
|
2670
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
236 |
/** |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
237 |
* \param n1 name of attribute |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
238 |
* \param v1 value of attribute |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
239 |
* \param n2 name of attribute |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
240 |
* \param v2 value of attribute |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
241 |
* \param n3 name of attribute |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
242 |
* \param v3 value of attribute |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
243 |
* \param n4 name of attribute |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
244 |
* \param v4 value of attribute |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
245 |
* \param n5 name of attribute |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
246 |
* \param v5 value of attribute |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
247 |
* \param n6 name of attribute |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
248 |
* \param v6 value of attribute |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
249 |
* \param n7 name of attribute |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
250 |
* \param v7 value of attribute |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
251 |
* \param n8 name of attribute |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
252 |
* \param v8 value of attribute |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
253 |
* \param n9 name of attribute |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
254 |
* \param v9 value of attribute |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
255 |
* \returns a pointer to a newly allocated object. |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
256 |
* |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
257 |
* This allocates an object on the heap and initializes |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
258 |
* it with a set of attributes. |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2667
diff
changeset
|
259 |
*/ |
2667
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
260 |
template <typename T> |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
261 |
Ptr<T> |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
262 |
CreateObject (std::string n1 = "", Attribute v1 = Attribute (), |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
263 |
std::string n2 = "", Attribute v2 = Attribute (), |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
264 |
std::string n3 = "", Attribute v3 = Attribute (), |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
265 |
std::string n4 = "", Attribute v4 = Attribute (), |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
266 |
std::string n5 = "", Attribute v5 = Attribute (), |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
267 |
std::string n6 = "", Attribute v6 = Attribute (), |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
268 |
std::string n7 = "", Attribute v7 = Attribute (), |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
269 |
std::string n8 = "", Attribute v8 = Attribute (), |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
270 |
std::string n9 = "", Attribute v9 = Attribute ()); |
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
271 |
|
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
272 |
|
2324032b8f90
Add an explicit copy constructor. Bug reported by Raj.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
273 |
|
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
274 |
} // namespace ns3 |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
275 |
|
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
276 |
namespace ns3 { |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
277 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
278 |
/************************************************************************* |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
279 |
* The Object implementation which depends on templates |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
280 |
*************************************************************************/ |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
281 |
|
701
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
282 |
void |
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
283 |
Object::Ref (void) const |
701
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
284 |
{ |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
285 |
m_count++; |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
286 |
} |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
287 |
void |
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
288 |
Object::Unref (void) const |
701
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
289 |
{ |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
290 |
NS_ASSERT (Check ()); |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
291 |
m_count--; |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
292 |
if (m_count == 0) |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
293 |
{ |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
294 |
MaybeDelete (); |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
295 |
} |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
296 |
} |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
297 |
|
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
298 |
template <typename T> |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
299 |
Ptr<T> |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
300 |
Object::GetObject () const |
2231
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
301 |
{ |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
302 |
Ptr<Object> found = DoGetObject (T::GetTypeId ()); |
2231
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
303 |
if (found != 0) |
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
304 |
{ |
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
305 |
return Ptr<T> (dynamic_cast<T *> (PeekPointer (found))); |
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
306 |
} |
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
307 |
return 0; |
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
308 |
} |
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
309 |
|
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
310 |
template <typename T> |
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
311 |
Ptr<T> |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
312 |
Object::GetObject (TypeId tid) const |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
313 |
{ |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
314 |
Ptr<Object> found = DoGetObject (tid); |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
315 |
if (found != 0) |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
316 |
{ |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
317 |
return Ptr<T> (dynamic_cast<T *> (PeekPointer (found))); |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
318 |
} |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
319 |
return 0; |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
320 |
} |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
321 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
322 |
/************************************************************************* |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
323 |
* The helper functions which need templates. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
324 |
*************************************************************************/ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
325 |
|
2607
8dd96726ef24
add CopyObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
326 |
template <typename T> |
2688
cf03845fc7ca
fix dox warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
327 |
Ptr<T> CopyObject (Ptr<T> object) |
2607
8dd96726ef24
add CopyObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
328 |
{ |
2690
ce92d0b2f602
fix the build, again.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2688
diff
changeset
|
329 |
Ptr<T> p = Ptr<T> (new T (*PeekPointer (object)), false); |
ce92d0b2f602
fix the build, again.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2688
diff
changeset
|
330 |
NS_ASSERT (p->m_tid == object->m_tid); |
2607
8dd96726ef24
add CopyObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
331 |
return p; |
8dd96726ef24
add CopyObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
332 |
} |
8dd96726ef24
add CopyObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
333 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
334 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
335 |
template <typename T> |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
336 |
Ptr<T> CreateObject (const AttributeList &attributes) |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
337 |
{ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
338 |
Ptr<T> p = Ptr<T> (new T (), false); |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
339 |
p->SetTypeId (T::GetTypeId ()); |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
340 |
p->Object::Construct (attributes); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
341 |
return p; |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
342 |
} |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
343 |
|
2230
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
344 |
template <typename T> |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
345 |
Ptr<T> |
2592
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2591
diff
changeset
|
346 |
CreateObject (std::string n1 = "", Attribute v1 = Attribute (), |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2591
diff
changeset
|
347 |
std::string n2 = "", Attribute v2 = Attribute (), |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2591
diff
changeset
|
348 |
std::string n3 = "", Attribute v3 = Attribute (), |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2591
diff
changeset
|
349 |
std::string n4 = "", Attribute v4 = Attribute (), |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2591
diff
changeset
|
350 |
std::string n5 = "", Attribute v5 = Attribute (), |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2591
diff
changeset
|
351 |
std::string n6 = "", Attribute v6 = Attribute (), |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2591
diff
changeset
|
352 |
std::string n7 = "", Attribute v7 = Attribute (), |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2591
diff
changeset
|
353 |
std::string n8 = "", Attribute v8 = Attribute (), |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2591
diff
changeset
|
354 |
std::string n9 = "", Attribute v9 = Attribute ()) |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2591
diff
changeset
|
355 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
356 |
{ |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
357 |
AttributeList attributes; |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
358 |
if (n1 == "") |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
359 |
{ |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
360 |
goto end; |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
361 |
} |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
362 |
attributes.SetWithTid (T::GetTypeId (), n1, v1); |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
363 |
if (n2 == "") |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
364 |
{ |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
365 |
goto end; |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
366 |
} |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
367 |
attributes.SetWithTid (T::GetTypeId (), n2, v2); |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
368 |
if (n3 == "") |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
369 |
{ |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
370 |
goto end; |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
371 |
} |
2489
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
372 |
attributes.SetWithTid (T::GetTypeId (), n3, v3); |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
373 |
if (n4 == "") |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
374 |
{ |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
375 |
goto end; |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
376 |
} |
2489
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
377 |
attributes.SetWithTid (T::GetTypeId (), n4, v4); |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
378 |
if (n5 == "") |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
379 |
{ |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
380 |
goto end; |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
381 |
} |
2489
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
382 |
attributes.SetWithTid (T::GetTypeId (), n5, v5); |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
383 |
if (n6 == "") |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
384 |
{ |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
385 |
goto end; |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
386 |
} |
2489
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
387 |
attributes.SetWithTid (T::GetTypeId (), n6, v6); |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
388 |
if (n7 == "") |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
389 |
{ |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
390 |
goto end; |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
391 |
} |
2489
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
392 |
attributes.SetWithTid (T::GetTypeId (), n7, v7); |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
393 |
if (n8 == "") |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
394 |
{ |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
395 |
goto end; |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
396 |
} |
2489
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
397 |
attributes.SetWithTid (T::GetTypeId (), n8, v8); |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
398 |
if (n9 == "") |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
399 |
{ |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
400 |
goto end; |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
401 |
} |
2489
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
402 |
attributes.SetWithTid (T::GetTypeId (), n9, v9); |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
403 |
end: |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
404 |
return CreateObject<T> (attributes); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
405 |
} |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
406 |
|
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
407 |
} // namespace ns3 |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
408 |
|
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
409 |
#endif /* OBJECT_H */ |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
410 |