author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Thu, 21 Feb 2008 19:31:17 +0100 | |
changeset 2459 | 91662d921a83 |
parent 2458 | e8f7c4960576 |
child 2460 | 7f5679184b79 |
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> |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
#include "ptr.h" |
1371
bebf690257c9
replace TraceResolver::PrintAvailable with TraceResolver::CollectSources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1368
diff
changeset
|
27 |
#include "trace-resolver.h" |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
28 |
#include "callback.h" |
2438
e2ac9f9aeeb9
value.h -> attribute.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2437
diff
changeset
|
29 |
#include "attribute.h" |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
30 |
#include "object-base.h" |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
31 |
|
2246
3645f5e344a4
add NS_OBJECT_ENSURE_REGISTERED
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2244
diff
changeset
|
32 |
#define NS_OBJECT_ENSURE_REGISTERED(type) \ |
3645f5e344a4
add NS_OBJECT_ENSURE_REGISTERED
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2244
diff
changeset
|
33 |
static struct X##type##RegistrationClass \ |
3645f5e344a4
add NS_OBJECT_ENSURE_REGISTERED
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2244
diff
changeset
|
34 |
{ \ |
3645f5e344a4
add NS_OBJECT_ENSURE_REGISTERED
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2244
diff
changeset
|
35 |
X##type##RegistrationClass () { \ |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
36 |
ns3::TypeId tid = type::GetTypeId (); \ |
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
37 |
tid.GetParent (); \ |
2246
3645f5e344a4
add NS_OBJECT_ENSURE_REGISTERED
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2244
diff
changeset
|
38 |
} \ |
3645f5e344a4
add NS_OBJECT_ENSURE_REGISTERED
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2244
diff
changeset
|
39 |
} x_##type##RegistrationVariable |
3645f5e344a4
add NS_OBJECT_ENSURE_REGISTERED
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2244
diff
changeset
|
40 |
|
3645f5e344a4
add NS_OBJECT_ENSURE_REGISTERED
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2244
diff
changeset
|
41 |
|
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
42 |
namespace ns3 { |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
43 |
|
1340
a8d774560c2b
remove const keyword and add a TraceConnect method which takes a TraceContext argument
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1336
diff
changeset
|
44 |
class TraceContext; |
1336
de5a133ece8a
add Object::TraceConnect, TraceDisconnect, and GetTraceResolver methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1330
diff
changeset
|
45 |
class CallbackBase; |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
46 |
class Object; |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
47 |
class AttributeAccessor; |
2437
44e34ffee8e3
Value -> AttributeValue
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2436
diff
changeset
|
48 |
class AttributeValue; |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
49 |
class AttributeList; |
1336
de5a133ece8a
add Object::TraceConnect, TraceDisconnect, and GetTraceResolver methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1330
diff
changeset
|
50 |
|
718 | 51 |
/** |
52 |
* \brief a unique identifier for an interface. |
|
53 |
* |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
54 |
* This class records a lot of meta-information about a |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
55 |
* subclass of the Object base class: |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
56 |
* - the base class of the subclass |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
57 |
* - the set of accessible constructors in the subclass |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
58 |
* - the set of 'attributes' accessible in the subclass |
718 | 59 |
*/ |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
60 |
class TypeId |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
61 |
{ |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
62 |
public: |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
63 |
enum { |
2432
b946f13bc8cb
PARAM -> ATTR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2427
diff
changeset
|
64 |
ATTR_GET = 1<<0, |
b946f13bc8cb
PARAM -> ATTR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2427
diff
changeset
|
65 |
ATTR_SET = 1<<1, |
b946f13bc8cb
PARAM -> ATTR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2427
diff
changeset
|
66 |
ATTR_CONSTRUCT = 1<<2, |
b946f13bc8cb
PARAM -> ATTR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2427
diff
changeset
|
67 |
ATTR_SGC = ATTR_GET | ATTR_SET | ATTR_CONSTRUCT, |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
68 |
}; |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
69 |
|
718 | 70 |
/** |
71 |
* \param name the name of the requested interface |
|
72 |
* \returns the unique id associated with the requested |
|
73 |
* name. |
|
74 |
* |
|
75 |
* This method cannot fail: it will crash if the input |
|
76 |
* name is not a valid interface name. |
|
77 |
*/ |
|
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
78 |
static TypeId LookupByName (std::string name); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
79 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
80 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
81 |
* \returns the number of TypeId instances constructed |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
82 |
*/ |
2239
b500773d7eae
add support to browse the list of existing InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2238
diff
changeset
|
83 |
static uint32_t GetRegisteredN (void); |
718 | 84 |
/** |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
85 |
* \param i index |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
86 |
* \returns the TypeId instance whose index is \i. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
87 |
*/ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
88 |
static TypeId GetRegistered (uint32_t i); |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
89 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
90 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
91 |
* \param name the name of the interface to construct. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
92 |
* |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
93 |
* No two instances can share the same name. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
94 |
*/ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
95 |
TypeId (std::string name); |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
96 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
97 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
98 |
* \returns the parent of this TypeId |
718 | 99 |
* |
100 |
* This method cannot fail: it will crash if the input |
|
101 |
* id is not a valid interface id. |
|
102 |
*/ |
|
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
103 |
TypeId GetParent (void) const; |
1371
bebf690257c9
replace TraceResolver::PrintAvailable with TraceResolver::CollectSources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1368
diff
changeset
|
104 |
|
bebf690257c9
replace TraceResolver::PrintAvailable with TraceResolver::CollectSources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1368
diff
changeset
|
105 |
/** |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
106 |
* \returns the name of the group associated to this TypeId. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
107 |
*/ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
108 |
std::string GetGroupName (void) const; |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
109 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
110 |
* \returns the fully-qualified C++ typename of this TypeId. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
111 |
*/ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
112 |
std::string GetTypeName (void) const; |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
113 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
114 |
/** |
1371
bebf690257c9
replace TraceResolver::PrintAvailable with TraceResolver::CollectSources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1368
diff
changeset
|
115 |
* \returns the name of this interface. |
bebf690257c9
replace TraceResolver::PrintAvailable with TraceResolver::CollectSources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1368
diff
changeset
|
116 |
*/ |
bebf690257c9
replace TraceResolver::PrintAvailable with TraceResolver::CollectSources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1368
diff
changeset
|
117 |
std::string GetName (void) const; |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
118 |
|
2241
daef67e18b79
add InterfaceId::HasConstructor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2240
diff
changeset
|
119 |
/** |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
120 |
* \returns true if this TypeId has a constructor |
2241
daef67e18b79
add InterfaceId::HasConstructor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2240
diff
changeset
|
121 |
*/ |
daef67e18b79
add InterfaceId::HasConstructor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2240
diff
changeset
|
122 |
bool HasConstructor (void) const; |
daef67e18b79
add InterfaceId::HasConstructor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2240
diff
changeset
|
123 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
124 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
125 |
* \returns the number of attributes associated to this TypeId |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
126 |
*/ |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
127 |
uint32_t GetAttributeListN (void) const; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
128 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
129 |
* \param i index into attribute array |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
130 |
* \returns the name associated to the attribute whose |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
131 |
* index is \i i. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
132 |
*/ |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
133 |
std::string GetAttributeName (uint32_t i) const; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
134 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
135 |
* \param i index into attribute array |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
136 |
* \returns the full name associated to the attribute whose |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
137 |
* index is \i i. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
138 |
*/ |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
139 |
std::string GetAttributeFullName (uint32_t i) const; |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
140 |
|
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
141 |
Attribute GetAttributeInitialValue (uint32_t i) const; |
2424
217a447122a6
split initial value from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2420
diff
changeset
|
142 |
|
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
143 |
Ptr<Object> CreateObject (const AttributeList &attributes) const; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
144 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
145 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
146 |
Ptr<Object> CreateObject (void) const; |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
147 |
template <typename T1> |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
148 |
Ptr<Object> CreateObject (T1 a1) const; |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
149 |
template <typename T1, typename T2> |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
150 |
Ptr<Object> CreateObject (T1 a1, T2 a2) const; |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
151 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
152 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
153 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
154 |
* \param tid the TypeId of the base class. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
155 |
* \return this TypeId instance. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
156 |
* |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
157 |
* Record in this TypeId which TypeId is the TypeId |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
158 |
* of the base class of the subclass. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
159 |
*/ |
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
160 |
TypeId SetParent (TypeId tid); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
161 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
162 |
* \return this TypeId instance. |
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 |
* Record in this TypeId which TypeId is the TypeId |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
165 |
* of the base class of the subclass. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
166 |
*/ |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
167 |
template <typename T> |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
168 |
TypeId SetParent (void); |
2238
05affd9d0dc1
get rid of MakeInterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2237
diff
changeset
|
169 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
170 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
171 |
* \param groupName the name of the group this TypeId belongs to. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
172 |
* \returns this TypeId instance. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
173 |
* |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
174 |
* The group name is purely an advisory information used to |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
175 |
* group together types according to a user-specific grouping |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
176 |
* scheme. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
177 |
*/ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
178 |
TypeId SetGroupName (std::string groupName); |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
179 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
180 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
181 |
* \param typeName the fully-qualified C++ typename of this TypeId. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
182 |
* \returns this TypeId instance. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
183 |
*/ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
184 |
TypeId SetTypeName (std::string typeName); |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
185 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
186 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
187 |
* \returns this TypeId instance |
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 |
* Record in this TypeId the fact that the default constructor |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
190 |
* is accessible. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
191 |
*/ |
2238
05affd9d0dc1
get rid of MakeInterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2237
diff
changeset
|
192 |
template <typename T> |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
193 |
TypeId AddConstructor (void); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
194 |
|
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
195 |
template <typename T, typename T1> |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
196 |
TypeId AddConstructor (void); |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
197 |
|
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
198 |
template <typename T, typename T1, typename T2> |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
199 |
TypeId AddConstructor (void); |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
200 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
201 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
202 |
* \param name the name of the new attribute |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
203 |
* \param help some help text which describes the purpose of this |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
204 |
* attribute |
2435
3128175f5866
ParamSpec -> Accessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2433
diff
changeset
|
205 |
* \param param an instance of the associated Accessor subclass |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
206 |
* \returns this TypeId instance |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
207 |
* |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
208 |
* Record in this TypeId the fact that a new attribute exists. |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
209 |
*/ |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
210 |
TypeId AddAttribute (std::string name, |
2424
217a447122a6
split initial value from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2420
diff
changeset
|
211 |
std::string help, |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2432
diff
changeset
|
212 |
Attribute initialValue, |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
213 |
Ptr<const AttributeAccessor> spec, |
2427
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2426
diff
changeset
|
214 |
Ptr<const AttributeChecker> checker); |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
215 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
216 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
217 |
* \param name the name of the new attribute |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
218 |
* \param help some help text which describes the purpose of this |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
219 |
* attribute |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
220 |
* \param flags flags which describe how this attribute can be read and/or written. |
2435
3128175f5866
ParamSpec -> Accessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2433
diff
changeset
|
221 |
* \param param an instance of the associated Accessor subclass |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
222 |
* \returns this TypeId instance |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
223 |
* |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
224 |
* Record in this TypeId the fact that a new attribute exists. |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
225 |
*/ |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
226 |
TypeId AddAttribute (std::string name, |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
227 |
std::string help, |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
228 |
uint32_t flags, |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2432
diff
changeset
|
229 |
Attribute initialValue, |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
230 |
Ptr<const AttributeAccessor> spec, |
2427
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2426
diff
changeset
|
231 |
Ptr<const AttributeChecker> checker); |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
232 |
|
2394
bc7abfdb0748
add a default constructor for the TypeId class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2382
diff
changeset
|
233 |
// construct an invalid TypeId. |
bc7abfdb0748
add a default constructor for the TypeId class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2382
diff
changeset
|
234 |
TypeId (); |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
235 |
~TypeId (); |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
236 |
private: |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
237 |
friend class Object; |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
238 |
friend class AttributeList; |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
239 |
friend bool operator == (TypeId a, TypeId b); |
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
240 |
friend bool operator != (TypeId a, TypeId b); |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
241 |
|
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
242 |
struct AttributeInfo { |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
243 |
Ptr<const AttributeAccessor> accessor; |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2432
diff
changeset
|
244 |
Attribute initialValue; |
2382
b05c2d0bcd23
enforce TypeId::PARAM_* flags
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2374
diff
changeset
|
245 |
uint32_t flags; |
2427
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2426
diff
changeset
|
246 |
Ptr<const AttributeChecker> checker; |
2382
b05c2d0bcd23
enforce TypeId::PARAM_* flags
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2374
diff
changeset
|
247 |
}; |
b05c2d0bcd23
enforce TypeId::PARAM_* flags
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2374
diff
changeset
|
248 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
249 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
250 |
* \param name the name of the requested attribute |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
251 |
* \returns the Accessor associated to the requested attribute |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
252 |
*/ |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
253 |
bool LookupAttributeByName (std::string name, struct AttributeInfo *info) const; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
254 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
255 |
* \param i the position of the requested attribute |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
256 |
* \returns the Accessor associated to the requested attribute |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
257 |
*/ |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
258 |
bool LookupAttributeByPosition (uint32_t i, struct AttributeInfo *info) const; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
259 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
260 |
* \param fullName the full name of the requested attribute |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
261 |
* \returns the Accessor associated to the requested attribute |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
262 |
*/ |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
263 |
static bool LookupAttributeByFullName (std::string fullName, struct AttributeInfo *info); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
264 |
|
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
265 |
explicit TypeId (uint16_t tid); |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
266 |
void DoAddConstructor (CallbackBase callback, uint32_t nArguments); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
267 |
CallbackBase LookupConstructor (uint32_t nArguments) const; |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
268 |
Ptr<const AttributeAccessor> GetAttributeAccessor (uint32_t i) const; |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
269 |
uint32_t GetAttributeFlags (uint32_t i) const; |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
270 |
Ptr<const AttributeChecker> GetAttributeChecker (uint32_t i) const; |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
271 |
|
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
272 |
uint16_t m_tid; |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
273 |
}; |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
274 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
275 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
276 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
277 |
* \brief a container of attributes to be used during object's construction |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
278 |
* and in ns3::Object::Set. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
279 |
* |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
280 |
*/ |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
281 |
class AttributeList |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
282 |
{ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
283 |
public: |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
284 |
AttributeList (); |
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
285 |
AttributeList (const AttributeList &o); |
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
286 |
AttributeList &operator = (const AttributeList &o); |
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
287 |
~AttributeList (); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
288 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
289 |
* \param name the name of the attribute to set |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
290 |
* \param value the value to set |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
291 |
* |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
292 |
* This method checks that a attribute with the requested |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
293 |
* name exists and that the value specified is an acceptable |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
294 |
* value of that attribute. If any of these checks fails, |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
295 |
* the program terminates with a message. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
296 |
*/ |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2432
diff
changeset
|
297 |
bool Set (std::string name, Attribute value); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
298 |
|
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2432
diff
changeset
|
299 |
void SetWithTid (TypeId tid, std::string name, Attribute value); |
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2432
diff
changeset
|
300 |
void SetWithTid (TypeId tid, uint32_t position, Attribute value); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
301 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
302 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
303 |
* Clear the content of this instance. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
304 |
*/ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
305 |
void Reset (void); |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
306 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
307 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
308 |
* \returns the global attribute container |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
309 |
* |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
310 |
* The global attribute container can be used to specify |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
311 |
* a set of attribute values without having to re-specify |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
312 |
* them for each object when it is created. This container |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
313 |
* is checked only during object construction and |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
314 |
* it is always checked last, after any per-object |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
315 |
* container is checked. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
316 |
*/ |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
317 |
static AttributeList *GetGlobal (void); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
318 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
319 |
std::string SerializeToString (void) const; |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
320 |
bool DeserializeFromString (std::string value); |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
321 |
private: |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
322 |
friend class Object; |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
323 |
struct Attr { |
2427
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2426
diff
changeset
|
324 |
Ptr<const AttributeChecker> checker; |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2432
diff
changeset
|
325 |
Attribute value; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
326 |
}; |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
327 |
typedef std::vector<struct Attr> Attrs; |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
328 |
typedef Attrs::iterator Iterator; |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
329 |
typedef Attrs::const_iterator CIterator; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
330 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
331 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
332 |
|
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
333 |
bool DoSet (struct TypeId::AttributeInfo *info, Attribute param); |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2432
diff
changeset
|
334 |
void DoSetOne (Ptr<const AttributeChecker> checker, Attribute param); |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
335 |
std::string LookupAttributeFullNameByChecker (Ptr<const AttributeChecker> checker) const; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
336 |
|
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
337 |
Attrs m_attributes; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
338 |
}; |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
339 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
340 |
|
718 | 341 |
/** |
342 |
* \brief a base class which provides memory management and object aggregation |
|
343 |
* |
|
344 |
*/ |
|
2370
5f7ad186b798
introduce ObjectBase
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
345 |
class Object : public ObjectBase |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
346 |
{ |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
347 |
public: |
2251
04963d8cca51
iid (void) -> GetTypeId (void)
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2250
diff
changeset
|
348 |
static TypeId GetTypeId (void); |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
349 |
|
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
350 |
Object (); |
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
351 |
virtual ~Object (); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
352 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
353 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
354 |
* \param name the name of the attribute to set |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
355 |
* \param value the name of the attribute to set |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
356 |
* |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
357 |
* Set a single attribute. |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
358 |
*/ |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2432
diff
changeset
|
359 |
bool Set (std::string name, Attribute value); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
360 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
361 |
* \param name the name of the attribute to read |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
362 |
* \param value a reference to the string where the value of the |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
363 |
* attribute should be stored. |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
364 |
* \returns true if the requested attribute was found, false otherwise. |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
365 |
*/ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
366 |
bool Get (std::string name, std::string &value) const; |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
367 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
368 |
* \param name the name of the attribute to read |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
369 |
* \param value a reference to the object where the value of the |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
370 |
* attribute should be stored. |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
371 |
* \returns true if the requested attribute was found, false otherwise. |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
372 |
*/ |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2432
diff
changeset
|
373 |
Attribute Get (std::string name) const; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
374 |
|
718 | 375 |
/** |
376 |
* Increment the reference count. This method should not be called |
|
377 |
* by user code. Object instances are expected to be used in conjunction |
|
378 |
* of the Ptr template which would make calling Ref unecessary and |
|
379 |
* dangerous. |
|
380 |
*/ |
|
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
381 |
inline void Ref (void) const; |
718 | 382 |
/** |
383 |
* Decrement the reference count. This method should not be called |
|
384 |
* by user code. Object instances are expected to be used in conjunction |
|
385 |
* of the Ptr template which would make calling Ref unecessary and |
|
386 |
* dangerous. |
|
387 |
*/ |
|
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
388 |
inline void Unref (void) const; |
718 | 389 |
/** |
390 |
* \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
|
391 |
*/ |
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
392 |
template <typename T> |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
393 |
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
|
394 |
/** |
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
395 |
* \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
|
396 |
* \returns a pointer to the requested interface or zero if it could not be found. |
718 | 397 |
*/ |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
398 |
template <typename T> |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
399 |
Ptr<T> GetObject (TypeId tid) const; |
718 | 400 |
/** |
401 |
* Run the DoDispose methods of this object and all the |
|
402 |
* objects aggregated to it. |
|
403 |
* After calling this method, the object is expected to be |
|
404 |
* totally unusable except for the Ref and Unref methods. |
|
405 |
* It is an error to call Dispose twice on the same object |
|
406 |
* instance |
|
407 |
*/ |
|
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
408 |
void Dispose (void); |
718 | 409 |
/** |
410 |
* \param other another object pointer |
|
411 |
* |
|
412 |
* This method aggregates the two objects together: after this |
|
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
413 |
* method returns, it becomes possible to call GetObject |
718 | 414 |
* on one to get the other, and vice-versa. |
415 |
*/ |
|
2258
666099a753e0
AddInterface -> AggregateObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2257
diff
changeset
|
416 |
void AggregateObject (Ptr<Object> other); |
1330
d67fce6d56f8
add refcounting to TraceResolver
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
718
diff
changeset
|
417 |
|
1380
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
418 |
/** |
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
419 |
* \param path the path to match for the callback |
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
420 |
* \param cb callback to connect |
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
421 |
* |
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
422 |
* Connect the input callback to all trace sources which |
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
423 |
* match the input path. |
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
424 |
* |
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
425 |
*/ |
1383 | 426 |
void TraceConnect (std::string path, const CallbackBase &cb) const; |
1380
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
427 |
/** |
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
428 |
* \param path the path to match for the callback |
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
429 |
* \param cb callback to disconnect |
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
430 |
* |
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
431 |
* Disconnect the input callback from all trace sources which |
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
432 |
* match the input path. |
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
433 |
*/ |
1383 | 434 |
void TraceDisconnect (std::string path, const CallbackBase &cb) const; |
1380
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
435 |
/** |
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
436 |
* \returns the trace resolver associated to this object. |
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
437 |
* |
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
438 |
* This method should be rarely called by users. |
799617173a45
api doxygen for Object base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1374
diff
changeset
|
439 |
*/ |
1383 | 440 |
virtual Ptr<TraceResolver> GetTraceResolver (void) const; |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
441 |
protected: |
718 | 442 |
/** |
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
|
443 |
* This method is called by Object::Dispose. |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
444 |
* Subclasses are expected to override this method and chain |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
445 |
* up to their parent's implementation once they are done. |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
446 |
*/ |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
447 |
virtual void DoDispose (void); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
448 |
virtual void NotifyConstructionCompleted (void); |
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
|
449 |
private: |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
450 |
friend class TypeIdTraceResolver; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
451 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
452 |
template <typename T> |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
453 |
friend 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
|
454 |
|
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
|
455 |
template <typename T> |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
456 |
friend Ptr<T> CreateObject (void); |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
457 |
template <typename T, typename T1> |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
458 |
friend Ptr<T> CreateObject (T1 a1); |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
459 |
template <typename T, typename T1, typename T2> |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
460 |
friend Ptr<T> CreateObject (T1 a1, T2 a2); |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
461 |
template <typename T, typename T1, typename T2, typename T3> |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
462 |
friend Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3); |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
463 |
template <typename T, typename T1, typename T2, typename T3, typename T4> |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
464 |
friend Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4); |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
465 |
template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5> |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
466 |
friend Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5); |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
467 |
template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
468 |
friend Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6); |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
469 |
template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
470 |
friend Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7); |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
471 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
472 |
|
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
473 |
bool DoSet (Ptr<const AttributeAccessor> spec, Attribute intialValue, |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2432
diff
changeset
|
474 |
Ptr<const AttributeChecker> checker, Attribute value); |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
475 |
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
|
476 |
void DoCollectSources (std::string path, const TraceContext &context, |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
477 |
TraceResolver::SourceCollection *collection) 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
|
478 |
void DoTraceAll (std::ostream &os, const TraceContext &context) 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
|
479 |
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
|
480 |
bool CheckLoose (void) const; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
481 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
482 |
* 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
|
483 |
* 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
|
484 |
* 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
|
485 |
* 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
|
486 |
*/ |
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
|
487 |
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
|
488 |
/** |
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
489 |
* \param tid an TypeId |
718 | 490 |
* |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
491 |
* Invoked from ns3::CreateObject only. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
492 |
* 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
|
493 |
* keep track of the type of this object instance. |
718 | 494 |
*/ |
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
495 |
void SetTypeId (TypeId tid); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
496 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
497 |
* \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
|
498 |
* 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
|
499 |
* |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
500 |
* Invoked from ns3::CreateObject only. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
501 |
* 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
|
502 |
* registered with the associated TypeId. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
503 |
*/ |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
504 |
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
|
505 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
506 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
507 |
* 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
|
508 |
* 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
|
509 |
* 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
|
510 |
* 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
|
511 |
* deleted. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
512 |
*/ |
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
513 |
mutable uint32_t m_count; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
514 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
515 |
* 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
|
516 |
*/ |
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
517 |
TypeId m_tid; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
518 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
519 |
* 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
|
520 |
* has run, false otherwise. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
521 |
*/ |
713
c3c745a80610
add a m_disposed field and check it
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
712
diff
changeset
|
522 |
bool m_disposed; |
1383 | 523 |
mutable bool m_collecting; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
524 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
525 |
* 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
|
526 |
* 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
|
527 |
* 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
|
528 |
* 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
|
529 |
* value of the 'this' pointer. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
530 |
*/ |
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
531 |
Object *m_next; |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
532 |
}; |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
533 |
|
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
534 |
} // namespace ns3 |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
535 |
|
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
536 |
namespace ns3 { |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
537 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
538 |
/************************************************************************* |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
539 |
* The TypeId implementation which depends on templates |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
540 |
*************************************************************************/ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
541 |
|
2238
05affd9d0dc1
get rid of MakeInterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2237
diff
changeset
|
542 |
template <typename T> |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
543 |
TypeId |
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
544 |
TypeId::SetParent (void) |
2238
05affd9d0dc1
get rid of MakeInterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2237
diff
changeset
|
545 |
{ |
2251
04963d8cca51
iid (void) -> GetTypeId (void)
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2250
diff
changeset
|
546 |
return SetParent (T::GetTypeId ()); |
2238
05affd9d0dc1
get rid of MakeInterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2237
diff
changeset
|
547 |
} |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
548 |
|
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
549 |
template <typename T> |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
550 |
TypeId |
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
551 |
TypeId::AddConstructor (void) |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
552 |
{ |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
553 |
struct Maker { |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
554 |
static Ptr<Object> Create (const AttributeList &attributes) { |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
555 |
return ns3::CreateObject<T> (attributes); |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
556 |
} |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
557 |
}; |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
558 |
CallbackBase cb = MakeCallback (&Maker::Create); |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
559 |
DoAddConstructor (cb, 0); |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
560 |
return *this; |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
561 |
} |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
562 |
template <typename T, typename T1> |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
563 |
TypeId |
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
564 |
TypeId::AddConstructor (void) |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
565 |
{ |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
566 |
struct Maker { |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
567 |
static Ptr<Object> Create (T1 a1) { |
2244
614282ded8ba
work around weird compiler warning/error.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2241
diff
changeset
|
568 |
return ns3::CreateObject<T,T1> (a1); |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
569 |
} |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
570 |
}; |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
571 |
CallbackBase cb = MakeCallback (&Maker::Create); |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
572 |
DoAddConstructor (cb, 1); |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
573 |
return *this; |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
574 |
} |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
575 |
template <typename T, typename T1, typename T2> |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
576 |
TypeId |
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
577 |
TypeId::AddConstructor (void) |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
578 |
{ |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
579 |
struct Maker { |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
580 |
static Ptr<Object> Create (T1 a1, T2 a2) { |
2244
614282ded8ba
work around weird compiler warning/error.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2241
diff
changeset
|
581 |
return ns3::CreateObject<T,T1,T2> (a1, a2); |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
582 |
} |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
583 |
}; |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
584 |
CallbackBase cb = MakeCallback (&Maker::Create); |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
585 |
DoAddConstructor (cb, 2); |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
586 |
return *this; |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
587 |
} |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
588 |
template <typename T1> |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
589 |
Ptr<Object> |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
590 |
TypeId::CreateObject (T1 a1) const |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
591 |
{ |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
592 |
CallbackBase cb = LookupConstructor (1); |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
593 |
Callback<Ptr<Object>,T1> realCb; |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
594 |
realCb.Assign (cb); |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
595 |
Ptr<Object> object = realCb (a1); |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
596 |
return object; |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
597 |
} |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
598 |
template <typename T1, typename T2> |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
599 |
Ptr<Object> |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
600 |
TypeId::CreateObject (T1 a1, T2 a2) const |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
601 |
{ |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
602 |
CallbackBase cb = LookupConstructor (2); |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
603 |
Callback<Ptr<Object>,T1,T2> realCb; |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
604 |
realCb.Assign (cb); |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
605 |
Ptr<Object> object = realCb (a1,a2); |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
606 |
return object; |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
607 |
} |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
608 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
609 |
/************************************************************************* |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
610 |
* 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
|
611 |
*************************************************************************/ |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
612 |
|
701
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
613 |
void |
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
614 |
Object::Ref (void) const |
701
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
615 |
{ |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
616 |
m_count++; |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
617 |
} |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
618 |
void |
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
619 |
Object::Unref (void) const |
701
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
620 |
{ |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
621 |
NS_ASSERT (Check ()); |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
622 |
m_count--; |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
623 |
if (m_count == 0) |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
624 |
{ |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
625 |
MaybeDelete (); |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
626 |
} |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
627 |
} |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
628 |
|
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
629 |
template <typename T> |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
630 |
Ptr<T> |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
631 |
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
|
632 |
{ |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
633 |
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
|
634 |
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
|
635 |
{ |
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
636 |
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
|
637 |
} |
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
638 |
return 0; |
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
639 |
} |
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
640 |
|
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
641 |
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
|
642 |
Ptr<T> |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
643 |
Object::GetObject (TypeId tid) const |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
644 |
{ |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
645 |
Ptr<Object> found = DoGetObject (tid); |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
646 |
if (found != 0) |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
647 |
{ |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
648 |
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
|
649 |
} |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
650 |
return 0; |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
651 |
} |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
652 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
653 |
/************************************************************************* |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
654 |
* The helper functions which need templates. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
655 |
*************************************************************************/ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
656 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
657 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
658 |
template <typename T> |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
659 |
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
|
660 |
{ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
661 |
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
|
662 |
p->SetTypeId (T::GetTypeId ()); |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
663 |
p->Object::Construct (attributes); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
664 |
return p; |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
665 |
} |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
666 |
|
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
|
667 |
template <typename T> |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
668 |
Ptr<T> CreateObject (void) |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
669 |
{ |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
670 |
Ptr<T> p = Ptr<T> (new T (), false); |
2251
04963d8cca51
iid (void) -> GetTypeId (void)
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2250
diff
changeset
|
671 |
p->SetTypeId (T::GetTypeId ()); |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
672 |
p->Object::Construct (AttributeList ()); |
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
|
673 |
return p; |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
674 |
} |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
675 |
|
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
676 |
template <typename T, typename T1> |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
677 |
Ptr<T> CreateObject (T1 a1) |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
678 |
{ |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
679 |
Ptr<T> p = Ptr<T> (new T (a1), false); |
2251
04963d8cca51
iid (void) -> GetTypeId (void)
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2250
diff
changeset
|
680 |
p->SetTypeId (T::GetTypeId ()); |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
681 |
p->Object::Construct (AttributeList ()); |
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
|
682 |
return p; |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
683 |
} |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
684 |
|
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
685 |
template <typename T, typename T1, typename T2> |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
686 |
Ptr<T> CreateObject (T1 a1, T2 a2) |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
687 |
{ |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
688 |
Ptr<T> p = Ptr<T> (new T (a1, a2), false); |
2251
04963d8cca51
iid (void) -> GetTypeId (void)
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2250
diff
changeset
|
689 |
p->SetTypeId (T::GetTypeId ()); |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
690 |
p->Object::Construct (AttributeList ()); |
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
|
691 |
return p; |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
692 |
} |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
693 |
template <typename T, typename T1, typename T2, typename T3> |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
694 |
Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3) |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
695 |
{ |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
696 |
Ptr<T> p = Ptr<T> (new T (a1, a2, a3), false); |
2251
04963d8cca51
iid (void) -> GetTypeId (void)
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2250
diff
changeset
|
697 |
p->SetTypeId (T::GetTypeId ()); |
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
|
698 |
return p; |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
699 |
} |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
700 |
|
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
701 |
template <typename T, typename T1, typename T2, typename T3, typename T4> |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
702 |
Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4) |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
703 |
{ |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
704 |
Ptr<T> p = Ptr<T> (new T (a1, a2, a3, a4), false); |
2251
04963d8cca51
iid (void) -> GetTypeId (void)
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2250
diff
changeset
|
705 |
p->SetTypeId (T::GetTypeId ()); |
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
|
706 |
return p; |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
707 |
} |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
708 |
|
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
709 |
template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5> |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
710 |
Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
711 |
{ |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
712 |
Ptr<T> p = Ptr<T> (new T (a1, a2, a3, a4, a5), false); |
2251
04963d8cca51
iid (void) -> GetTypeId (void)
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2250
diff
changeset
|
713 |
p->SetTypeId (T::GetTypeId ()); |
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
|
714 |
return p; |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
715 |
} |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
716 |
|
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
717 |
template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
718 |
Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6) |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
719 |
{ |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
720 |
Ptr<T> p = Ptr<T> (new T (a1, a2, a3, a4, a5, a6), false); |
2251
04963d8cca51
iid (void) -> GetTypeId (void)
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2250
diff
changeset
|
721 |
p->SetTypeId (T::GetTypeId ()); |
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
|
722 |
return p; |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
723 |
} |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
724 |
|
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
725 |
template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
726 |
Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7) |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
727 |
{ |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
728 |
Ptr<T> p = Ptr<T> (new T (a1, a2, a3, a4, a5, a6, a7), false); |
2251
04963d8cca51
iid (void) -> GetTypeId (void)
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2250
diff
changeset
|
729 |
p->SetTypeId (T::GetTypeId ()); |
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
|
730 |
return p; |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
731 |
} |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
732 |
|
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
733 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
734 |
template <typename T> |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
735 |
Ptr<T> |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2432
diff
changeset
|
736 |
CreateObjectWith (std::string n1, Attribute v1, |
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2432
diff
changeset
|
737 |
std::string n2 = "", Attribute v2 = Attribute ()) |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
738 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
739 |
{ |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
740 |
AttributeList attributes; |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
741 |
attributes.SetWithTid (T::GetTypeId (), n1, v1); |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
742 |
attributes.SetWithTid (T::GetTypeId (), n2, v2); |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
743 |
return CreateObject<T> (attributes); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
744 |
} |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
745 |
|
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
746 |
} // namespace ns3 |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
747 |
|
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
748 |
#endif /* OBJECT_H */ |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
749 |