author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Tue, 11 Mar 2008 11:35:26 -0700 | |
changeset 2591 | 83a605082fb6 |
parent 2589 | 38274d42d73b |
child 2592 | 3ebf97150166 |
permissions | -rw-r--r-- |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
/* |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
3 |
* Copyright (c) 2007 INRIA, Gustavo Carneiro |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
4 |
* |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
* |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
* |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
* Authors: Gustavo Carneiro <gjcarneiro@gmail.com>, |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
* Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
*/ |
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
21 |
#ifndef OBJECT_H |
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
22 |
#define OBJECT_H |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
|
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
#include <stdint.h> |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
25 |
#include <string> |
2542
a9b88fdc09d6
kill TraceResolver et al.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2531
diff
changeset
|
26 |
#include <vector> |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
#include "ptr.h" |
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" |
2489
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
31 |
#include "attribute-helper.h" |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
32 |
|
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
33 |
/** |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
34 |
* This macro should be invoked once for every class which |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
35 |
* defines a new GetTypeId method. |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
36 |
*/ |
2246
3645f5e344a4
add NS_OBJECT_ENSURE_REGISTERED
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2244
diff
changeset
|
37 |
#define NS_OBJECT_ENSURE_REGISTERED(type) \ |
3645f5e344a4
add NS_OBJECT_ENSURE_REGISTERED
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2244
diff
changeset
|
38 |
static struct X##type##RegistrationClass \ |
3645f5e344a4
add NS_OBJECT_ENSURE_REGISTERED
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2244
diff
changeset
|
39 |
{ \ |
3645f5e344a4
add NS_OBJECT_ENSURE_REGISTERED
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2244
diff
changeset
|
40 |
X##type##RegistrationClass () { \ |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
41 |
ns3::TypeId tid = type::GetTypeId (); \ |
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
42 |
tid.GetParent (); \ |
2246
3645f5e344a4
add NS_OBJECT_ENSURE_REGISTERED
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2244
diff
changeset
|
43 |
} \ |
3645f5e344a4
add NS_OBJECT_ENSURE_REGISTERED
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2244
diff
changeset
|
44 |
} x_##type##RegistrationVariable |
3645f5e344a4
add NS_OBJECT_ENSURE_REGISTERED
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2244
diff
changeset
|
45 |
|
3645f5e344a4
add NS_OBJECT_ENSURE_REGISTERED
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2244
diff
changeset
|
46 |
|
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
47 |
namespace ns3 { |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
48 |
|
1336
de5a133ece8a
add Object::TraceConnect, TraceDisconnect, and GetTraceResolver methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1330
diff
changeset
|
49 |
class CallbackBase; |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
50 |
class Object; |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
51 |
class AttributeAccessor; |
2437
44e34ffee8e3
Value -> AttributeValue
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2436
diff
changeset
|
52 |
class AttributeValue; |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
53 |
class AttributeList; |
2463
c77e43117673
actually allow connection and disconnection to trace sources registered in TypeIds
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2460
diff
changeset
|
54 |
class TraceSourceAccessor; |
1336
de5a133ece8a
add Object::TraceConnect, TraceDisconnect, and GetTraceResolver methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1330
diff
changeset
|
55 |
|
718 | 56 |
/** |
57 |
* \brief a unique identifier for an interface. |
|
58 |
* |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
59 |
* 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
|
60 |
* subclass of the Object base class: |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
61 |
* - the base class of the subclass |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
62 |
* - the set of accessible constructors in the subclass |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
63 |
* - the set of 'attributes' accessible in the subclass |
718 | 64 |
*/ |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
65 |
class TypeId |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
66 |
{ |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
67 |
public: |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
68 |
enum { |
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
69 |
/** |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
70 |
* The attribute can be read |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
71 |
*/ |
2432
b946f13bc8cb
PARAM -> ATTR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2427
diff
changeset
|
72 |
ATTR_GET = 1<<0, |
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
73 |
/** |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
74 |
* The attribute can be written |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
75 |
*/ |
2432
b946f13bc8cb
PARAM -> ATTR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2427
diff
changeset
|
76 |
ATTR_SET = 1<<1, |
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
77 |
/** |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
78 |
* The attribute can be written at construction-time. |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
79 |
*/ |
2432
b946f13bc8cb
PARAM -> ATTR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2427
diff
changeset
|
80 |
ATTR_CONSTRUCT = 1<<2, |
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
81 |
/** |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
82 |
* The attribute can be read, and written at any time. |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
83 |
*/ |
2432
b946f13bc8cb
PARAM -> ATTR
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2427
diff
changeset
|
84 |
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
|
85 |
}; |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
86 |
|
718 | 87 |
/** |
2570
15d5421022a1
add FailSafe versions of setters which could fail.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2569
diff
changeset
|
88 |
* \param name the name of the requested TypeId |
718 | 89 |
* \returns the unique id associated with the requested |
90 |
* name. |
|
91 |
* |
|
92 |
* This method cannot fail: it will crash if the input |
|
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
93 |
* name is not a valid TypeId name. |
718 | 94 |
*/ |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
95 |
static TypeId LookupByName (std::string name); |
2570
15d5421022a1
add FailSafe versions of setters which could fail.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2569
diff
changeset
|
96 |
/** |
15d5421022a1
add FailSafe versions of setters which could fail.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2569
diff
changeset
|
97 |
* \param name the name of the requested TypeId |
15d5421022a1
add FailSafe versions of setters which could fail.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2569
diff
changeset
|
98 |
* \param tid a pointer to the TypeId instance where the |
15d5421022a1
add FailSafe versions of setters which could fail.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2569
diff
changeset
|
99 |
* result of this function should be stored. |
15d5421022a1
add FailSafe versions of setters which could fail.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2569
diff
changeset
|
100 |
* \returns true if the requested name was found, false otherwise. |
15d5421022a1
add FailSafe versions of setters which could fail.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2569
diff
changeset
|
101 |
*/ |
15d5421022a1
add FailSafe versions of setters which could fail.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2569
diff
changeset
|
102 |
static bool LookupByNameFailSafe (std::string name, TypeId *tid); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
103 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
104 |
/** |
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
105 |
* \returns the number of TypeId instances registered. |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
106 |
*/ |
2239
b500773d7eae
add support to browse the list of existing InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2238
diff
changeset
|
107 |
static uint32_t GetRegisteredN (void); |
718 | 108 |
/** |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
109 |
* \param i index |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
110 |
* \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
|
111 |
*/ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
112 |
static TypeId GetRegistered (uint32_t i); |
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 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
115 |
* \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
|
116 |
* |
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
117 |
* No two instances can share the same name. The name is expected to be |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
118 |
* the full c++ typename of associated c++ object. |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
119 |
*/ |
2489
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
120 |
TypeId (const char * name); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
121 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
122 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
123 |
* \returns the parent of this TypeId |
718 | 124 |
* |
2339
0aee22966821
fix doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2258
diff
changeset
|
125 |
* This method cannot fail. It will return itself |
0aee22966821
fix doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2258
diff
changeset
|
126 |
* if this TypeId has no parent. i.e., it is at the top |
0aee22966821
fix doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2258
diff
changeset
|
127 |
* of the TypeId hierarchy. Currently, this is the |
0aee22966821
fix doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2258
diff
changeset
|
128 |
* case for the TypeId associated to the Object class |
0aee22966821
fix doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2258
diff
changeset
|
129 |
* only. |
718 | 130 |
*/ |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
131 |
TypeId GetParent (void) const; |
1371
bebf690257c9
replace TraceResolver::PrintAvailable with TraceResolver::CollectSources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1368
diff
changeset
|
132 |
|
bebf690257c9
replace TraceResolver::PrintAvailable with TraceResolver::CollectSources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1368
diff
changeset
|
133 |
/** |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
134 |
* \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
|
135 |
*/ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
136 |
std::string GetGroupName (void) const; |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
137 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
138 |
* \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
|
139 |
*/ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
140 |
std::string GetTypeName (void) const; |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
141 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
142 |
/** |
1371
bebf690257c9
replace TraceResolver::PrintAvailable with TraceResolver::CollectSources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1368
diff
changeset
|
143 |
* \returns the name of this interface. |
bebf690257c9
replace TraceResolver::PrintAvailable with TraceResolver::CollectSources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1368
diff
changeset
|
144 |
*/ |
bebf690257c9
replace TraceResolver::PrintAvailable with TraceResolver::CollectSources
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1368
diff
changeset
|
145 |
std::string GetName (void) const; |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
146 |
|
2241
daef67e18b79
add InterfaceId::HasConstructor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2240
diff
changeset
|
147 |
/** |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
148 |
* \returns true if this TypeId has a constructor |
2241
daef67e18b79
add InterfaceId::HasConstructor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2240
diff
changeset
|
149 |
*/ |
daef67e18b79
add InterfaceId::HasConstructor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2240
diff
changeset
|
150 |
bool HasConstructor (void) const; |
daef67e18b79
add InterfaceId::HasConstructor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2240
diff
changeset
|
151 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
152 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
153 |
* \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
|
154 |
*/ |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
155 |
uint32_t GetAttributeListN (void) const; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
156 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
157 |
* \param i index into attribute array |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
158 |
* \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
|
159 |
* index is \i i. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
160 |
*/ |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
161 |
std::string GetAttributeName (uint32_t i) const; |
2573
b45af20ffe2b
make GetAttributeFlags and GetAttributeChecker public. add GetAttributeHelp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2572
diff
changeset
|
162 |
std::string GetAttributeHelp (uint32_t i) const; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
163 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
164 |
* \param i index into attribute array |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
165 |
* \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
|
166 |
* index is \i i. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
167 |
*/ |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
168 |
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
|
169 |
|
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
170 |
Attribute GetAttributeInitialValue (uint32_t i) const; |
2573
b45af20ffe2b
make GetAttributeFlags and GetAttributeChecker public. add GetAttributeHelp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2572
diff
changeset
|
171 |
uint32_t GetAttributeFlags (uint32_t i) const; |
b45af20ffe2b
make GetAttributeFlags and GetAttributeChecker public. add GetAttributeHelp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2572
diff
changeset
|
172 |
Ptr<const AttributeChecker> GetAttributeChecker (uint32_t i) const; |
b45af20ffe2b
make GetAttributeFlags and GetAttributeChecker public. add GetAttributeHelp
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2572
diff
changeset
|
173 |
|
2424
217a447122a6
split initial value from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2420
diff
changeset
|
174 |
|
2463
c77e43117673
actually allow connection and disconnection to trace sources registered in TypeIds
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2460
diff
changeset
|
175 |
uint32_t GetTraceSourceN (void) const; |
c77e43117673
actually allow connection and disconnection to trace sources registered in TypeIds
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2460
diff
changeset
|
176 |
std::string GetTraceSourceName (uint32_t i) const; |
c77e43117673
actually allow connection and disconnection to trace sources registered in TypeIds
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2460
diff
changeset
|
177 |
std::string GetTraceSourceHelp (uint32_t i) const; |
c77e43117673
actually allow connection and disconnection to trace sources registered in TypeIds
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2460
diff
changeset
|
178 |
Ptr<const TraceSourceAccessor> GetTraceSourceAccessor (uint32_t i) const; |
c77e43117673
actually allow connection and disconnection to trace sources registered in TypeIds
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2460
diff
changeset
|
179 |
|
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
180 |
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
|
181 |
Ptr<Object> CreateObject (void) const; |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
182 |
|
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 |
* \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
|
185 |
* \return this TypeId instance. |
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 |
* 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
|
188 |
* 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
|
189 |
*/ |
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
190 |
TypeId SetParent (TypeId tid); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
191 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
192 |
* \return this TypeId instance. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
193 |
* |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
194 |
* 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
|
195 |
* 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
|
196 |
*/ |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
197 |
template <typename T> |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
198 |
TypeId SetParent (void); |
2238
05affd9d0dc1
get rid of MakeInterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2237
diff
changeset
|
199 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
200 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
201 |
* \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
|
202 |
* \returns this TypeId instance. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
203 |
* |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
204 |
* 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
|
205 |
* 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
|
206 |
* scheme. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
207 |
*/ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
208 |
TypeId SetGroupName (std::string groupName); |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
209 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
210 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
211 |
* \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
|
212 |
* \returns this TypeId instance. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
213 |
*/ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
214 |
TypeId SetTypeName (std::string typeName); |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
215 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
216 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
217 |
* \returns this TypeId instance |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
218 |
* |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
219 |
* 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
|
220 |
* is accessible. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
221 |
*/ |
2238
05affd9d0dc1
get rid of MakeInterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2237
diff
changeset
|
222 |
template <typename T> |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
223 |
TypeId AddConstructor (void); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
224 |
|
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 |
* \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
|
227 |
* \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
|
228 |
* attribute |
2435
3128175f5866
ParamSpec -> Accessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2433
diff
changeset
|
229 |
* \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
|
230 |
* \returns this TypeId instance |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
231 |
* |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
232 |
* 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
|
233 |
*/ |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
234 |
TypeId AddAttribute (std::string name, |
2424
217a447122a6
split initial value from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2420
diff
changeset
|
235 |
std::string help, |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2432
diff
changeset
|
236 |
Attribute initialValue, |
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
237 |
Ptr<const AttributeAccessor> spec, |
2427
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2426
diff
changeset
|
238 |
Ptr<const AttributeChecker> checker); |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
239 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
240 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
241 |
* \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
|
242 |
* \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
|
243 |
* attribute |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
244 |
* \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
|
245 |
* \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
|
246 |
* \returns this TypeId instance |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
247 |
* |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
248 |
* 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
|
249 |
*/ |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
250 |
TypeId AddAttribute (std::string name, |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
251 |
std::string help, |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
252 |
uint32_t flags, |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2432
diff
changeset
|
253 |
Attribute initialValue, |
2463
c77e43117673
actually allow connection and disconnection to trace sources registered in TypeIds
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2460
diff
changeset
|
254 |
Ptr<const AttributeAccessor> accessor, |
2427
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2426
diff
changeset
|
255 |
Ptr<const AttributeChecker> checker); |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
256 |
|
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
257 |
/** |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
258 |
* \param name the name of the new trace source |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
259 |
* \param help some help text which describes the purpose of this |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
260 |
* trace source. |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
261 |
* \param accessor a pointer to a TraceSourceAccessor which can be |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
262 |
* used to connect/disconnect sinks to this trace source. |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
263 |
* \returns this TypeId instance. |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
264 |
*/ |
2463
c77e43117673
actually allow connection and disconnection to trace sources registered in TypeIds
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2460
diff
changeset
|
265 |
TypeId AddTraceSource (std::string name, |
c77e43117673
actually allow connection and disconnection to trace sources registered in TypeIds
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2460
diff
changeset
|
266 |
std::string help, |
c77e43117673
actually allow connection and disconnection to trace sources registered in TypeIds
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2460
diff
changeset
|
267 |
Ptr<const TraceSourceAccessor> accessor); |
c77e43117673
actually allow connection and disconnection to trace sources registered in TypeIds
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2460
diff
changeset
|
268 |
|
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
269 |
/** |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
270 |
* \brief store together a set of attribute properties. |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
271 |
*/ |
2471
86f7ea794e83
add a few public methods for the Config code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2463
diff
changeset
|
272 |
struct AttributeInfo { |
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
273 |
// The accessor associated to the attribute. |
2471
86f7ea794e83
add a few public methods for the Config code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2463
diff
changeset
|
274 |
Ptr<const AttributeAccessor> accessor; |
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
275 |
// The initial value associated to the attribute. |
2471
86f7ea794e83
add a few public methods for the Config code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2463
diff
changeset
|
276 |
Attribute initialValue; |
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
277 |
// The set of access control flags associated to the attribute. |
2471
86f7ea794e83
add a few public methods for the Config code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2463
diff
changeset
|
278 |
uint32_t flags; |
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
279 |
// The checker associated to the attribute. |
2471
86f7ea794e83
add a few public methods for the Config code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2463
diff
changeset
|
280 |
Ptr<const AttributeChecker> checker; |
86f7ea794e83
add a few public methods for the Config code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2463
diff
changeset
|
281 |
}; |
86f7ea794e83
add a few public methods for the Config code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2463
diff
changeset
|
282 |
/** |
86f7ea794e83
add a few public methods for the Config code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2463
diff
changeset
|
283 |
* \param name the name of the requested attribute |
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
284 |
* \param info a pointer to the TypeId::AttributeInfo data structure |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
285 |
* where the result value of this method will be stored. |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
286 |
* \returns true if the requested attribute could be found, false otherwise. |
2471
86f7ea794e83
add a few public methods for the Config code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2463
diff
changeset
|
287 |
*/ |
86f7ea794e83
add a few public methods for the Config code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2463
diff
changeset
|
288 |
bool LookupAttributeByName (std::string name, struct AttributeInfo *info) const; |
86f7ea794e83
add a few public methods for the Config code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2463
diff
changeset
|
289 |
|
86f7ea794e83
add a few public methods for the Config code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2463
diff
changeset
|
290 |
|
2394
bc7abfdb0748
add a default constructor for the TypeId class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2382
diff
changeset
|
291 |
// construct an invalid TypeId. |
bc7abfdb0748
add a default constructor for the TypeId class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2382
diff
changeset
|
292 |
TypeId (); |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
293 |
~TypeId (); |
2489
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
294 |
|
2582
3e28107b870f
rename old VALUE leftovers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2573
diff
changeset
|
295 |
ATTRIBUTE_HELPER_HEADER_1 (TypeId); |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
296 |
private: |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
297 |
friend class Object; |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
298 |
friend class AttributeList; |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
299 |
friend bool operator == (TypeId a, TypeId b); |
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
300 |
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
|
301 |
|
2382
b05c2d0bcd23
enforce TypeId::PARAM_* flags
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2374
diff
changeset
|
302 |
|
2463
c77e43117673
actually allow connection and disconnection to trace sources registered in TypeIds
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2460
diff
changeset
|
303 |
Ptr<const TraceSourceAccessor> LookupTraceSourceByName (std::string name) const; |
c77e43117673
actually allow connection and disconnection to trace sources registered in TypeIds
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2460
diff
changeset
|
304 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
305 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
306 |
* \param fullName the full name of the requested attribute |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
307 |
* \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
|
308 |
*/ |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
309 |
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
|
310 |
|
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
311 |
explicit TypeId (uint16_t tid); |
2589
38274d42d73b
kill multiple constructors per TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2583
diff
changeset
|
312 |
void DoAddConstructor (CallbackBase callback); |
38274d42d73b
kill multiple constructors per TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2583
diff
changeset
|
313 |
CallbackBase LookupConstructor (void) const; |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
314 |
Ptr<const AttributeAccessor> GetAttributeAccessor (uint32_t i) const; |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
315 |
|
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
316 |
uint16_t m_tid; |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
317 |
}; |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
318 |
|
2489
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
319 |
std::ostream & operator << (std::ostream &os, TypeId tid); |
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
320 |
std::istream & operator >> (std::istream &is, TypeId &tid); |
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
321 |
|
2582
3e28107b870f
rename old VALUE leftovers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2573
diff
changeset
|
322 |
ATTRIBUTE_HELPER_HEADER_2 (TypeId); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
323 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
324 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
325 |
* \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
|
326 |
* and in ns3::Object::Set. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
327 |
* |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
328 |
*/ |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
329 |
class AttributeList |
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 |
public: |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
332 |
AttributeList (); |
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
333 |
AttributeList (const AttributeList &o); |
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
334 |
AttributeList &operator = (const AttributeList &o); |
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
335 |
~AttributeList (); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
336 |
/** |
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
337 |
* \param name the full 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
|
338 |
* \param value the value to set |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
339 |
* |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
340 |
* 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
|
341 |
* 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
|
342 |
* 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
|
343 |
* the program terminates with a message. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
344 |
*/ |
2570
15d5421022a1
add FailSafe versions of setters which could fail.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2569
diff
changeset
|
345 |
void Set (std::string name, Attribute value); |
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
346 |
/** |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
347 |
* \param name the full name of the attribute to set |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
348 |
* \param value the value to set |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
349 |
* \returns true if the requested attribute exists and could be |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
350 |
* stored, false otherwise. |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
351 |
*/ |
2570
15d5421022a1
add FailSafe versions of setters which could fail.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2569
diff
changeset
|
352 |
bool SetFailSafe (std::string name, Attribute value); |
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
353 |
/** |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
354 |
* \param tid the TypeId associated to this attribute |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
355 |
* \param name the name (not full!) of the attribute |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
356 |
* \param value the value to set |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
357 |
* |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
358 |
* This method checks that a attribute with the requested |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
359 |
* name exists and that the value specified is an acceptable |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
360 |
* value of that attribute. If any of these checks fails, |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
361 |
* the program terminates with a message. |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
362 |
*/ |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
363 |
void SetWithTid (TypeId tid, std::string name, Attribute value); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
364 |
|
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 |
* Clear the content of this instance. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
367 |
*/ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
368 |
void Reset (void); |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
369 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
370 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
371 |
* \returns the global attribute container |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
372 |
* |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
373 |
* The global attribute container can be used to specify |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
374 |
* 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
|
375 |
* 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
|
376 |
* 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
|
377 |
* 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
|
378 |
* container is checked. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
379 |
*/ |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
380 |
static AttributeList *GetGlobal (void); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
381 |
|
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
382 |
// XXX: untested. |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
383 |
std::string SerializeToString (void) const; |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
384 |
bool DeserializeFromString (std::string value); |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
385 |
private: |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
386 |
friend class Object; |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
387 |
struct Attr { |
2427
9245ec163111
split checker from ParamSpec.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2426
diff
changeset
|
388 |
Ptr<const AttributeChecker> checker; |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2432
diff
changeset
|
389 |
Attribute value; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
390 |
}; |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
391 |
typedef std::vector<struct Attr> Attrs; |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
392 |
typedef Attrs::iterator Iterator; |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
393 |
typedef Attrs::const_iterator CIterator; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
394 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
395 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
396 |
|
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
397 |
bool DoSet (struct TypeId::AttributeInfo *info, Attribute param); |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2432
diff
changeset
|
398 |
void DoSetOne (Ptr<const AttributeChecker> checker, Attribute param); |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
399 |
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
|
400 |
|
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
401 |
Attrs m_attributes; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
402 |
}; |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
403 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
404 |
|
718 | 405 |
/** |
406 |
* \brief a base class which provides memory management and object aggregation |
|
407 |
* |
|
408 |
*/ |
|
2370
5f7ad186b798
introduce ObjectBase
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
409 |
class Object : public ObjectBase |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
410 |
{ |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
411 |
public: |
2251
04963d8cca51
iid (void) -> GetTypeId (void)
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2250
diff
changeset
|
412 |
static TypeId GetTypeId (void); |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
413 |
|
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
414 |
Object (); |
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
415 |
virtual ~Object (); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
416 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
417 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
418 |
* \param name the name of the attribute to set |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
419 |
* \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
|
420 |
* |
2572
5f3bdaf2a77c
more FailSafe methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2570
diff
changeset
|
421 |
* Set a single attribute. This cannot fail: if the input is invalid, |
5f3bdaf2a77c
more FailSafe methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2570
diff
changeset
|
422 |
* it will crash immediately. |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
423 |
*/ |
2572
5f3bdaf2a77c
more FailSafe methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2570
diff
changeset
|
424 |
void SetAttribute (std::string name, Attribute value); |
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
425 |
/** |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
426 |
* \param name the name of the attribute to set |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
427 |
* \param value the name of the attribute to set |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
428 |
* \returns true if the requested attribute exists and could be set, |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
429 |
* false otherwise. |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
430 |
*/ |
2572
5f3bdaf2a77c
more FailSafe methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2570
diff
changeset
|
431 |
bool SetAttributeFailSafe (std::string name, Attribute value); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
432 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
433 |
* \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
|
434 |
* \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
|
435 |
* attribute should be stored. |
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
436 |
* \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
|
437 |
*/ |
2460
7f5679184b79
Object::Set/Get -> Object::SetAttribute/GetAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2459
diff
changeset
|
438 |
bool GetAttribute (std::string name, std::string &value) const; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
439 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
440 |
* \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
|
441 |
* \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
|
442 |
* attribute should be stored. |
2583
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
443 |
* |
c09faa6c90bf
doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2582
diff
changeset
|
444 |
* If the input attribute name does not exist, this method crashes. |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
445 |
*/ |
2460
7f5679184b79
Object::Set/Get -> Object::SetAttribute/GetAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2459
diff
changeset
|
446 |
Attribute GetAttribute (std::string name) const; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
447 |
|
2463
c77e43117673
actually allow connection and disconnection to trace sources registered in TypeIds
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2460
diff
changeset
|
448 |
bool TraceSourceConnect (std::string name, const CallbackBase &cb); |
2531
b451b5fc8b57
implement context-based trace connection
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2522
diff
changeset
|
449 |
bool TraceSourceConnectWithContext (std::string name, std::string context, const CallbackBase &cb); |
2463
c77e43117673
actually allow connection and disconnection to trace sources registered in TypeIds
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2460
diff
changeset
|
450 |
bool TraceSourceDisconnect (std::string name, const CallbackBase &cb); |
2569
d5cff2968984
make Disconnect work with trace contexts.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2542
diff
changeset
|
451 |
bool TraceSourceDisconnectWithContext (std::string name, std::string context, const CallbackBase &cb); |
2463
c77e43117673
actually allow connection and disconnection to trace sources registered in TypeIds
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2460
diff
changeset
|
452 |
|
2471
86f7ea794e83
add a few public methods for the Config code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2463
diff
changeset
|
453 |
TypeId GetRealTypeId (void) const; |
86f7ea794e83
add a few public methods for the Config code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2463
diff
changeset
|
454 |
|
718 | 455 |
/** |
456 |
* Increment the reference count. This method should not be called |
|
457 |
* by user code. Object instances are expected to be used in conjunction |
|
458 |
* of the Ptr template which would make calling Ref unecessary and |
|
459 |
* dangerous. |
|
460 |
*/ |
|
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
461 |
inline void Ref (void) const; |
718 | 462 |
/** |
463 |
* Decrement the reference count. This method should not be called |
|
464 |
* by user code. Object instances are expected to be used in conjunction |
|
465 |
* of the Ptr template which would make calling Ref unecessary and |
|
466 |
* dangerous. |
|
467 |
*/ |
|
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
468 |
inline void Unref (void) const; |
718 | 469 |
/** |
470 |
* \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
|
471 |
*/ |
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
472 |
template <typename T> |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
473 |
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
|
474 |
/** |
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
475 |
* \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
|
476 |
* \returns a pointer to the requested interface or zero if it could not be found. |
718 | 477 |
*/ |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
478 |
template <typename T> |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
479 |
Ptr<T> GetObject (TypeId tid) const; |
718 | 480 |
/** |
481 |
* Run the DoDispose methods of this object and all the |
|
482 |
* objects aggregated to it. |
|
483 |
* After calling this method, the object is expected to be |
|
484 |
* totally unusable except for the Ref and Unref methods. |
|
485 |
* It is an error to call Dispose twice on the same object |
|
486 |
* instance |
|
487 |
*/ |
|
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
488 |
void Dispose (void); |
718 | 489 |
/** |
490 |
* \param other another object pointer |
|
491 |
* |
|
492 |
* This method aggregates the two objects together: after this |
|
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
493 |
* method returns, it becomes possible to call GetObject |
718 | 494 |
* on one to get the other, and vice-versa. |
495 |
*/ |
|
2258
666099a753e0
AddInterface -> AggregateObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2257
diff
changeset
|
496 |
void AggregateObject (Ptr<Object> other); |
1330
d67fce6d56f8
add refcounting to TraceResolver
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
718
diff
changeset
|
497 |
|
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
498 |
protected: |
718 | 499 |
/** |
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
|
500 |
* 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
|
501 |
* 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
|
502 |
* 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
|
503 |
*/ |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
504 |
virtual void DoDispose (void); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
505 |
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
|
506 |
private: |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
507 |
template <typename T> |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
508 |
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
|
509 |
|
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
|
510 |
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
|
511 |
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
|
512 |
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
|
513 |
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
|
514 |
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
|
515 |
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
|
516 |
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
|
517 |
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
|
518 |
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
|
519 |
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
|
520 |
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
|
521 |
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
|
522 |
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
|
523 |
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
|
524 |
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
|
525 |
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
|
526 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
527 |
|
2436
23415bac7eaf
Accessor -> AttributeAccessor
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2435
diff
changeset
|
528 |
bool DoSet (Ptr<const AttributeAccessor> spec, Attribute intialValue, |
2433
3a98e1db7f80
PValue -> Attribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2432
diff
changeset
|
529 |
Ptr<const AttributeChecker> checker, Attribute value); |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
530 |
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
|
531 |
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
|
532 |
bool CheckLoose (void) const; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
533 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
534 |
* 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
|
535 |
* 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
|
536 |
* 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
|
537 |
* 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
|
538 |
*/ |
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
|
539 |
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
|
540 |
/** |
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
541 |
* \param tid an TypeId |
718 | 542 |
* |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
543 |
* Invoked from ns3::CreateObject only. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
544 |
* 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
|
545 |
* keep track of the type of this object instance. |
718 | 546 |
*/ |
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
547 |
void SetTypeId (TypeId tid); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
548 |
/** |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
549 |
* \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
|
550 |
* 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
|
551 |
* |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
552 |
* Invoked from ns3::CreateObject only. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
553 |
* 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
|
554 |
* registered with the associated TypeId. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
555 |
*/ |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
556 |
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
|
557 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
558 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
559 |
* 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
|
560 |
* 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
|
561 |
* 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
|
562 |
* 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
|
563 |
* deleted. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
564 |
*/ |
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
565 |
mutable uint32_t m_count; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
566 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
567 |
* 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
|
568 |
*/ |
2252
80595448707a
iid -> tid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
569 |
TypeId m_tid; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
570 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
571 |
* 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
|
572 |
* has run, false otherwise. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
573 |
*/ |
713
c3c745a80610
add a m_disposed field and check it
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
712
diff
changeset
|
574 |
bool m_disposed; |
1383 | 575 |
mutable bool m_collecting; |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
576 |
/** |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
577 |
* 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
|
578 |
* 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
|
579 |
* 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
|
580 |
* 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
|
581 |
* value of the 'this' pointer. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
582 |
*/ |
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
583 |
Object *m_next; |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
584 |
}; |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
585 |
|
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
586 |
} // namespace ns3 |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
587 |
|
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
588 |
namespace ns3 { |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
589 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
590 |
/************************************************************************* |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
591 |
* 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
|
592 |
*************************************************************************/ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
593 |
|
2238
05affd9d0dc1
get rid of MakeInterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2237
diff
changeset
|
594 |
template <typename T> |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
595 |
TypeId |
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
596 |
TypeId::SetParent (void) |
2238
05affd9d0dc1
get rid of MakeInterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2237
diff
changeset
|
597 |
{ |
2251
04963d8cca51
iid (void) -> GetTypeId (void)
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2250
diff
changeset
|
598 |
return SetParent (T::GetTypeId ()); |
2238
05affd9d0dc1
get rid of MakeInterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2237
diff
changeset
|
599 |
} |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
600 |
|
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
601 |
template <typename T> |
2250
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
602 |
TypeId |
18f432098389
InterfaceId -> TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2246
diff
changeset
|
603 |
TypeId::AddConstructor (void) |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
604 |
{ |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
605 |
struct Maker { |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
606 |
static Ptr<Object> Create (const AttributeList &attributes) { |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
607 |
return ns3::CreateObject<T> (attributes); |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
608 |
} |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
609 |
}; |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
610 |
CallbackBase cb = MakeCallback (&Maker::Create); |
2589
38274d42d73b
kill multiple constructors per TypeId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2583
diff
changeset
|
611 |
DoAddConstructor (cb); |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
612 |
return *this; |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
613 |
} |
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
614 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
615 |
/************************************************************************* |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
616 |
* 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
|
617 |
*************************************************************************/ |
2237
7745a8c76396
add 'factory' support to InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2235
diff
changeset
|
618 |
|
701
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
619 |
void |
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
620 |
Object::Ref (void) const |
701
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
621 |
{ |
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 |
} |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
624 |
void |
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
625 |
Object::Unref (void) const |
701
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 |
NS_ASSERT (Check ()); |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
628 |
m_count--; |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
629 |
if (m_count == 0) |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
630 |
{ |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
631 |
MaybeDelete (); |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
632 |
} |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
633 |
} |
aa179c876b22
optimization suggested by gustavo
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
699
diff
changeset
|
634 |
|
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
635 |
template <typename T> |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
636 |
Ptr<T> |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
637 |
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
|
638 |
{ |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
639 |
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
|
640 |
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
|
641 |
{ |
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
642 |
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
|
643 |
} |
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
644 |
return 0; |
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
645 |
} |
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
646 |
|
a5b898c1ee2c
fix bug 122: get rid of duplicate argument to QueryInterface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2230
diff
changeset
|
647 |
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
|
648 |
Ptr<T> |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
649 |
Object::GetObject (TypeId tid) const |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
650 |
{ |
2257
71a58e70c671
QueryInterface -> GetObject
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2252
diff
changeset
|
651 |
Ptr<Object> found = DoGetObject (tid); |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
652 |
if (found != 0) |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
653 |
{ |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
654 |
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
|
655 |
} |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
656 |
return 0; |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
657 |
} |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
658 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
659 |
/************************************************************************* |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
660 |
* The helper functions which need templates. |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
661 |
*************************************************************************/ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
662 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
663 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
664 |
template <typename T> |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
665 |
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
|
666 |
{ |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
667 |
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
|
668 |
p->SetTypeId (T::GetTypeId ()); |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
669 |
p->Object::Construct (attributes); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
670 |
return p; |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
671 |
} |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
672 |
|
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 |
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
|
674 |
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
|
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 |
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
|
677 |
p->SetTypeId (T::GetTypeId ()); |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
678 |
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
|
679 |
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
|
680 |
} |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
681 |
|
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 |
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
|
683 |
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
|
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 |
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
|
686 |
p->SetTypeId (T::GetTypeId ()); |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
687 |
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
|
688 |
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
|
689 |
} |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
690 |
|
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 |
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
|
692 |
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
|
693 |
{ |
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> 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
|
695 |
p->SetTypeId (T::GetTypeId ()); |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
696 |
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
|
697 |
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
|
698 |
} |
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 |
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
|
700 |
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
|
701 |
{ |
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> 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
|
703 |
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
|
704 |
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
|
705 |
} |
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 |
|
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 |
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
|
708 |
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
|
709 |
{ |
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> 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
|
711 |
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
|
712 |
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
|
713 |
} |
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 |
|
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 |
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
|
716 |
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
|
717 |
{ |
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> 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
|
719 |
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
|
720 |
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
|
721 |
} |
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 |
|
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 |
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
|
724 |
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
|
725 |
{ |
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> 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
|
727 |
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
|
728 |
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
|
729 |
} |
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 |
|
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 |
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
|
732 |
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
|
733 |
{ |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
734 |
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
|
735 |
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
|
736 |
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
|
737 |
} |
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
738 |
|
9f13ac3291e0
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1534
diff
changeset
|
739 |
|
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
740 |
template <typename T> |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
741 |
Ptr<T> |
2460
7f5679184b79
Object::Set/Get -> Object::SetAttribute/GetAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2459
diff
changeset
|
742 |
CreateObjectWith (std::string n1 = "", Attribute v1 = Attribute (), |
2489
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
743 |
std::string n2 = "", Attribute v2 = Attribute (), |
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
744 |
std::string n3 = "", Attribute v3 = Attribute (), |
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
745 |
std::string n4 = "", Attribute v4 = Attribute (), |
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
746 |
std::string n5 = "", Attribute v5 = Attribute (), |
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
747 |
std::string n6 = "", Attribute v6 = Attribute (), |
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
748 |
std::string n7 = "", Attribute v7 = Attribute (), |
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
749 |
std::string n8 = "", Attribute v8 = Attribute (), |
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
750 |
std::string n9 = "", Attribute v9 = Attribute ()) |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
751 |
|
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
752 |
{ |
2459
91662d921a83
Attributes -> AttributeList
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2458
diff
changeset
|
753 |
AttributeList attributes; |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
754 |
if (n1 == "") |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
755 |
{ |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
756 |
goto end; |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
757 |
} |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
758 |
attributes.SetWithTid (T::GetTypeId (), n1, v1); |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
759 |
if (n2 == "") |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
760 |
{ |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
761 |
goto end; |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
762 |
} |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
763 |
attributes.SetWithTid (T::GetTypeId (), n2, v2); |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
764 |
if (n3 == "") |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
765 |
{ |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
766 |
goto end; |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
767 |
} |
2489
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
768 |
attributes.SetWithTid (T::GetTypeId (), n3, v3); |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
769 |
if (n4 == "") |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
770 |
{ |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
771 |
goto end; |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
772 |
} |
2489
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
773 |
attributes.SetWithTid (T::GetTypeId (), n4, v4); |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
774 |
if (n5 == "") |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
775 |
{ |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
776 |
goto end; |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
777 |
} |
2489
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
778 |
attributes.SetWithTid (T::GetTypeId (), n5, v5); |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
779 |
if (n6 == "") |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
780 |
{ |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
781 |
goto end; |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
782 |
} |
2489
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
783 |
attributes.SetWithTid (T::GetTypeId (), n6, v6); |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
784 |
if (n7 == "") |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
785 |
{ |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
786 |
goto end; |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
787 |
} |
2489
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
788 |
attributes.SetWithTid (T::GetTypeId (), n7, v7); |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
789 |
if (n8 == "") |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
790 |
{ |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
791 |
goto end; |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
792 |
} |
2489
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
793 |
attributes.SetWithTid (T::GetTypeId (), n8, v8); |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
794 |
if (n9 == "") |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
795 |
{ |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
796 |
goto end; |
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
797 |
} |
2489
c3341ba4cbf8
do not use the private constructor to avoid overload resolution confusions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2471
diff
changeset
|
798 |
attributes.SetWithTid (T::GetTypeId (), n9, v9); |
2591
83a605082fb6
do not set attributes if they have their default value.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2589
diff
changeset
|
799 |
end: |
2458
e8f7c4960576
AddParameter -> AddAttribute
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2438
diff
changeset
|
800 |
return CreateObject<T> (attributes); |
2372
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
801 |
} |
bf4efb9359c6
attempt to perform correctly automatic conversions.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2370
diff
changeset
|
802 |
|
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
803 |
} // namespace ns3 |
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
804 |
|
706
8b0bf4623c9d
rename InterfaceObject to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
703
diff
changeset
|
805 |
#endif /* OBJECT_H */ |
699
956a76f5fd56
a replacement for the Interface base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
806 |