author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Wed, 19 Nov 2008 14:19:10 +0100 | |
changeset 3870 | a77d35844233 |
parent 3531 | e5c71362e669 |
child 3871 | c6f693de286d |
permissions | -rw-r--r-- |
2671
7fa114622a4d
add missing license headers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
7fa114622a4d
add missing license headers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
2 |
/* |
7fa114622a4d
add missing license headers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
3 |
* Copyright (c) 2008 INRIA |
7fa114622a4d
add missing license headers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
4 |
* |
7fa114622a4d
add missing license headers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
7fa114622a4d
add missing license headers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
7fa114622a4d
add missing license headers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
7 |
* published by the Free Software Foundation; |
7fa114622a4d
add missing license headers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
8 |
* |
7fa114622a4d
add missing license headers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
7fa114622a4d
add missing license headers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
7fa114622a4d
add missing license headers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7fa114622a4d
add missing license headers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
12 |
* GNU General Public License for more details. |
7fa114622a4d
add missing license headers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
13 |
* |
7fa114622a4d
add missing license headers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
7fa114622a4d
add missing license headers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
7fa114622a4d
add missing license headers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
7fa114622a4d
add missing license headers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
17 |
* |
7fa114622a4d
add missing license headers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
7fa114622a4d
add missing license headers.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2670
diff
changeset
|
19 |
*/ |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
#ifndef TYPE_ID_H |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
21 |
#define TYPE_ID_H |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
#include "attribute.h" |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
#include "attribute-accessor-helper.h" |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
25 |
#include "attribute-helper.h" |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
#include "callback.h" |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
#include <string> |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
28 |
#include <stdint.h> |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
29 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
30 |
namespace ns3 { |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
31 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
32 |
class ObjectBase; |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
33 |
class TraceSourceAccessor; |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
34 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
35 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
36 |
* \brief a unique identifier for an interface. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
37 |
* |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
38 |
* This class records a lot of meta-information about a |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
39 |
* subclass of the Object base class: |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
40 |
* - the base class of the subclass |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
41 |
* - the set of accessible constructors in the subclass |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
42 |
* - the set of 'attributes' accessible in the subclass |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
43 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
44 |
class TypeId |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
45 |
{ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
46 |
public: |
3368
95bbf601167d
avoid pygccxml warning.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3094
diff
changeset
|
47 |
enum AttributeFlag { |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
48 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
49 |
* The attribute can be read |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
50 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
51 |
ATTR_GET = 1<<0, |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
52 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
53 |
* The attribute can be written |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
54 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
55 |
ATTR_SET = 1<<1, |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
56 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
57 |
* The attribute can be written at construction-time. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
58 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
59 |
ATTR_CONSTRUCT = 1<<2, |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
60 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
61 |
* The attribute can be read, and written at any time. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
62 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
63 |
ATTR_SGC = ATTR_GET | ATTR_SET | ATTR_CONSTRUCT, |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
64 |
}; |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
65 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
66 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
67 |
* \param name the name of the requested TypeId |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
68 |
* \returns the unique id associated with the requested |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
69 |
* name. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
70 |
* |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
71 |
* This method cannot fail: it will crash if the input |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
72 |
* name is not a valid TypeId name. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
73 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
74 |
static TypeId LookupByName (std::string name); |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
75 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
76 |
* \param name the name of the requested TypeId |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
77 |
* \param tid a pointer to the TypeId instance where the |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
78 |
* result of this function should be stored. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
79 |
* \returns true if the requested name was found, false otherwise. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
80 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
81 |
static bool LookupByNameFailSafe (std::string name, TypeId *tid); |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
82 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
83 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
84 |
* \returns the number of TypeId instances registered. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
85 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
86 |
static uint32_t GetRegisteredN (void); |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
87 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
88 |
* \param i index |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
89 |
* \returns the TypeId instance whose index is i. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
90 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
91 |
static TypeId GetRegistered (uint32_t i); |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
92 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
93 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
94 |
* \param name the name of the interface to construct. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
95 |
* |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
96 |
* No two instances can share the same name. The name is expected to be |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
97 |
* the full c++ typename of associated c++ object. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
98 |
*/ |
3531
e5c71362e669
Make TypeId(const char * name) explicit (bug 281)
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
3368
diff
changeset
|
99 |
explicit TypeId (const char * name); |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
100 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
101 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
102 |
* \returns the parent of this TypeId |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
103 |
* |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
104 |
* This method cannot fail. It will return itself |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
105 |
* if this TypeId has no parent. i.e., it is at the top |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
106 |
* of the TypeId hierarchy. Currently, this is the |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
107 |
* case for the TypeId associated to the Object class |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
108 |
* only. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
109 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
110 |
TypeId GetParent (void) const; |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
111 |
|
3070
45d8e899c535
add missing TypeId::HasParent method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2969
diff
changeset
|
112 |
bool HasParent (void) const; |
45d8e899c535
add missing TypeId::HasParent method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2969
diff
changeset
|
113 |
|
2648
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
114 |
/** |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
115 |
* \param other a parent TypeId |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
116 |
* \returns true if the input TypeId is really a parent |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
117 |
* of this TypeId, false otherwise. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
118 |
* |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
119 |
* Calling this method is roughly similar to calling dynamic_cast |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
120 |
* except that you do not need object instances: you can do the check |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
121 |
* with TypeId instances instead. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
122 |
*/ |
2641
0bc8caf4f355
add TypeId::IsChildOf
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
123 |
bool IsChildOf (TypeId other) const; |
0bc8caf4f355
add TypeId::IsChildOf
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2638
diff
changeset
|
124 |
|
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
125 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
126 |
* \returns the name of the group associated to this TypeId. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
127 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
128 |
std::string GetGroupName (void) const; |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
129 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
130 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
131 |
* \returns the name of this interface. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
132 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
133 |
std::string GetName (void) const; |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
134 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
135 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
136 |
* \returns true if this TypeId has a constructor |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
137 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
138 |
bool HasConstructor (void) const; |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
139 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
140 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
141 |
* \returns the number of attributes associated to this TypeId |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
142 |
*/ |
2693
56e28e34e109
TypeId::GetAttributeListN -> TypeId::GetAttributeN
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2671
diff
changeset
|
143 |
uint32_t GetAttributeN (void) const; |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
144 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
145 |
* \param i index into attribute array |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
146 |
* \returns the name associated to the attribute whose |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
147 |
* index is i. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
148 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
149 |
std::string GetAttributeName (uint32_t i) const; |
2648
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
150 |
/** |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
151 |
* \param i index into attribute array. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
152 |
* \returns the help text associated to the attribute whose |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
153 |
* index is i. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
154 |
*/ |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
155 |
std::string GetAttributeHelp (uint32_t i) const; |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
156 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
157 |
* \param i index into attribute array |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
158 |
* \returns the full name associated to the attribute whose |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
159 |
* index is i. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
160 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
161 |
std::string GetAttributeFullName (uint32_t i) const; |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
162 |
|
2648
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
163 |
/** |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
164 |
* \param i index into attribute array. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
165 |
* \returns the value with which the associated attribute |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
166 |
* is initialized. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
167 |
*/ |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2939
diff
changeset
|
168 |
Ptr<const AttributeValue> GetAttributeInitialValue (uint32_t i) const; |
2648
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
169 |
/** |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
170 |
* \param i index into attribute array. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
171 |
* \returns the flags associated to the requested attribute. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
172 |
*/ |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
173 |
uint32_t GetAttributeFlags (uint32_t i) const; |
2648
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
174 |
/** |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
175 |
* \param i index into attribute array. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
176 |
* \returns the checker associated to the requested attribute. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
177 |
*/ |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
178 |
Ptr<const AttributeChecker> GetAttributeChecker (uint32_t i) const; |
2648
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
179 |
/** |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
180 |
* \param i index into attribute array. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
181 |
* \returns the accessor associated to the requested attribute. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
182 |
*/ |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
183 |
Ptr<const AttributeAccessor> GetAttributeAccessor (uint32_t i) const; |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
184 |
|
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
185 |
/** |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
186 |
* \returns a callback which can be used to instanciate an object |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
187 |
* of this type. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
188 |
*/ |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
189 |
Callback<ObjectBase *> GetConstructor (void) const; |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
190 |
|
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
191 |
/** |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
192 |
* \returns true if this TypeId should be hidden from the user, |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
193 |
* false otherwise. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
194 |
*/ |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
195 |
bool MustHideFromDocumentation (void) const; |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
196 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
197 |
|
2648
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
198 |
/** |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
199 |
* \returns the number of trace sources defined in this TypeId. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
200 |
*/ |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
201 |
uint32_t GetTraceSourceN (void) const; |
2648
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
202 |
/** |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
203 |
* \param i index into trace source array. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
204 |
* \returns the name of the requested trace source. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
205 |
*/ |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
206 |
std::string GetTraceSourceName (uint32_t i) const; |
2648
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
207 |
/** |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
208 |
* \param i index into trace source array. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
209 |
* \returns the help text of the requested trace source. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
210 |
*/ |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
211 |
std::string GetTraceSourceHelp (uint32_t i) const; |
2648
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
212 |
/** |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
213 |
* \param i index into trace source array. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
214 |
* \returns the accessor used to get access to the requested |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
215 |
* trace source. |
736213ce179d
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2644
diff
changeset
|
216 |
*/ |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
217 |
Ptr<const TraceSourceAccessor> GetTraceSourceAccessor (uint32_t i) const; |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
218 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
219 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
220 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
221 |
* \param tid the TypeId of the base class. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
222 |
* \return this TypeId instance. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
223 |
* |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
224 |
* Record in this TypeId which TypeId is the TypeId |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
225 |
* of the base class of the subclass. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
226 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
227 |
TypeId SetParent (TypeId tid); |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
228 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
229 |
* \return this TypeId instance. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
230 |
* |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
231 |
* Record in this TypeId which TypeId is the TypeId |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
232 |
* of the base class of the subclass. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
233 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
234 |
template <typename T> |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
235 |
TypeId SetParent (void); |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
236 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
237 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
238 |
* \param groupName the name of the group this TypeId belongs to. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
239 |
* \returns this TypeId instance. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
240 |
* |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
241 |
* The group name is purely an advisory information used to |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
242 |
* group together types according to a user-specific grouping |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
243 |
* scheme. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
244 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
245 |
TypeId SetGroupName (std::string groupName); |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
246 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
247 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
248 |
* \returns this TypeId instance |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
249 |
* |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
250 |
* Record in this TypeId the fact that the default constructor |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
251 |
* is accessible. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
252 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
253 |
template <typename T> |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
254 |
TypeId AddConstructor (void); |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
255 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
256 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
257 |
* \param name the name of the new attribute |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
258 |
* \param help some help text which describes the purpose of this |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
259 |
* attribute. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
260 |
* \param initialValue the initial value for this attribute. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
261 |
* \param accessor an instance of the associated AttributeAccessor subclass. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
262 |
* \param checker an instance of the associated AttributeChecker subclass. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
263 |
* \returns this TypeId instance |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
264 |
* |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
265 |
* Record in this TypeId the fact that a new attribute exists. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
266 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
267 |
TypeId AddAttribute (std::string name, |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
268 |
std::string help, |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2939
diff
changeset
|
269 |
const AttributeValue &initialValue, |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
270 |
Ptr<const AttributeAccessor> accessor, |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
271 |
Ptr<const AttributeChecker> checker); |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
272 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
273 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
274 |
* \param name the name of the new attribute |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
275 |
* \param help some help text which describes the purpose of this |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
276 |
* attribute |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
277 |
* \param flags flags which describe how this attribute can be read and/or written. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
278 |
* \param initialValue the initial value for this attribute. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
279 |
* \param accessor an instance of the associated AttributeAccessor subclass. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
280 |
* \param checker an instance of the associated AttributeChecker subclass. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
281 |
* \returns this TypeId instance |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
282 |
* |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
283 |
* Record in this TypeId the fact that a new attribute exists. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
284 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
285 |
TypeId AddAttribute (std::string name, |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
286 |
std::string help, |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
287 |
uint32_t flags, |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2939
diff
changeset
|
288 |
const AttributeValue &initialValue, |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
289 |
Ptr<const AttributeAccessor> accessor, |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
290 |
Ptr<const AttributeChecker> checker); |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
291 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
292 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
293 |
* \param name the name of the new trace source |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
294 |
* \param help some help text which describes the purpose of this |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
295 |
* trace source. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
296 |
* \param accessor a pointer to a TraceSourceAccessor which can be |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
297 |
* used to connect/disconnect sinks to this trace source. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
298 |
* \returns this TypeId instance. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
299 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
300 |
TypeId AddTraceSource (std::string name, |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
301 |
std::string help, |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
302 |
Ptr<const TraceSourceAccessor> accessor); |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
303 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
304 |
TypeId HideFromDocumentation (void); |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
305 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
306 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
307 |
* \brief store together a set of attribute properties. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
308 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
309 |
struct AttributeInfo { |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
310 |
// The accessor associated to the attribute. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
311 |
Ptr<const AttributeAccessor> accessor; |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
312 |
// The initial value associated to the attribute. |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2939
diff
changeset
|
313 |
Ptr<const AttributeValue> initialValue; |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
314 |
// The set of access control flags associated to the attribute. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
315 |
uint32_t flags; |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
316 |
// The checker associated to the attribute. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
317 |
Ptr<const AttributeChecker> checker; |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
318 |
}; |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
319 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
320 |
* \param name the name of the requested attribute |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
321 |
* \param info a pointer to the TypeId::AttributeInfo data structure |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
322 |
* where the result value of this method will be stored. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
323 |
* \returns true if the requested attribute could be found, false otherwise. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
324 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
325 |
bool LookupAttributeByName (std::string name, struct AttributeInfo *info) const; |
2719
6688934b493a
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2693
diff
changeset
|
326 |
/** |
6688934b493a
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2693
diff
changeset
|
327 |
* \param name the name of the requested trace source |
6688934b493a
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2693
diff
changeset
|
328 |
* \returns the trace source accessor which can be used to connect and disconnect |
6688934b493a
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2693
diff
changeset
|
329 |
* trace sinks with the requested trace source on an object instance. |
6688934b493a
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2693
diff
changeset
|
330 |
* |
6688934b493a
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2693
diff
changeset
|
331 |
* If no matching trace source is found, this method returns zero. |
6688934b493a
improve doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2693
diff
changeset
|
332 |
*/ |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
333 |
Ptr<const TraceSourceAccessor> LookupTraceSourceByName (std::string name) const; |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
334 |
|
2670
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2648
diff
changeset
|
335 |
/** |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2648
diff
changeset
|
336 |
* \returns the internal integer which uniquely identifies this |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2648
diff
changeset
|
337 |
* TypeId. |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2648
diff
changeset
|
338 |
* |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2648
diff
changeset
|
339 |
* This is really an internal method which users are not expected |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2648
diff
changeset
|
340 |
* to use. |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2648
diff
changeset
|
341 |
*/ |
2644
b50c3f20ab88
add TypeId::SetUid/GetUid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2641
diff
changeset
|
342 |
uint16_t GetUid (void) const; |
2670
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2648
diff
changeset
|
343 |
/** |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2648
diff
changeset
|
344 |
* \param tid the internal integer which uniquely identifies |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2648
diff
changeset
|
345 |
* this TypeId. |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2648
diff
changeset
|
346 |
* |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2648
diff
changeset
|
347 |
* This method is even more internal than TypeId::GetUid. Use |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2648
diff
changeset
|
348 |
* at your own risk and don't be surprised that it eats raw |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2648
diff
changeset
|
349 |
* babies on full-moon nights. |
6e5ee56bed72
some doxygen work.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2648
diff
changeset
|
350 |
*/ |
2644
b50c3f20ab88
add TypeId::SetUid/GetUid
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2641
diff
changeset
|
351 |
void SetUid (uint16_t tid); |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
352 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
353 |
// construct an invalid TypeId. |
3870
a77d35844233
5% cpu optimization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3531
diff
changeset
|
354 |
inline TypeId (); |
a77d35844233
5% cpu optimization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3531
diff
changeset
|
355 |
inline TypeId (const TypeId &o); |
a77d35844233
5% cpu optimization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3531
diff
changeset
|
356 |
inline TypeId &operator = (const TypeId &o); |
a77d35844233
5% cpu optimization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3531
diff
changeset
|
357 |
inline ~TypeId (); |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
358 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
359 |
private: |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
360 |
friend class AttributeList; |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
361 |
friend bool operator == (TypeId a, TypeId b); |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
362 |
friend bool operator != (TypeId a, TypeId b); |
2939
3cff8627a284
make IsChildOf not return true for test against self. Add operator < for TypeId.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2834
diff
changeset
|
363 |
friend bool operator < (TypeId a, TypeId b); |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
364 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
365 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
366 |
/** |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
367 |
* \param fullName the full name of the requested attribute |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
368 |
* \param info a pointer to the TypeId::AttributeInfo data structure |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
369 |
* where the result value of this method will be stored. |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
370 |
* \returns the Accessor associated to the requested attribute |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
371 |
*/ |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
372 |
static bool LookupAttributeByFullName (std::string fullName, struct AttributeInfo *info); |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
373 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
374 |
explicit TypeId (uint16_t tid); |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
375 |
void DoAddConstructor (Callback<ObjectBase *> callback); |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
376 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
377 |
uint16_t m_tid; |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
378 |
}; |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
379 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
380 |
std::ostream & operator << (std::ostream &os, TypeId tid); |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
381 |
std::istream & operator >> (std::istream &is, TypeId &tid); |
2939
3cff8627a284
make IsChildOf not return true for test against self. Add operator < for TypeId.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2834
diff
changeset
|
382 |
bool operator == (TypeId a, TypeId b); |
3cff8627a284
make IsChildOf not return true for test against self. Add operator < for TypeId.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2834
diff
changeset
|
383 |
bool operator != (TypeId a, TypeId b); |
3cff8627a284
make IsChildOf not return true for test against self. Add operator < for TypeId.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2834
diff
changeset
|
384 |
bool operator < (TypeId a, TypeId b); |
3cff8627a284
make IsChildOf not return true for test against self. Add operator < for TypeId.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2834
diff
changeset
|
385 |
|
2969
9d05d2a95dfa
improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
386 |
/** |
9d05d2a95dfa
improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
387 |
* \class ns3::TypeIdValue |
9d05d2a95dfa
improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
388 |
* \brief hold objects of type ns3::TypeId |
9d05d2a95dfa
improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
389 |
*/ |
9d05d2a95dfa
improve the auto-generated doxygen output.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2965
diff
changeset
|
390 |
|
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
391 |
|
3094
6e787ec9c8aa
ATTRIBUTE_HELPER_HEADER_2 -> ATTRIBUTE_HELPER_HEADER
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3093
diff
changeset
|
392 |
ATTRIBUTE_HELPER_HEADER (TypeId); |
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
393 |
|
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
394 |
} // namespace ns3 |
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
395 |
|
2638
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
396 |
namespace ns3 { |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
397 |
|
3870
a77d35844233
5% cpu optimization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3531
diff
changeset
|
398 |
TypeId::TypeId () |
a77d35844233
5% cpu optimization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3531
diff
changeset
|
399 |
: m_tid (0) {} |
a77d35844233
5% cpu optimization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3531
diff
changeset
|
400 |
TypeId::TypeId (const TypeId &o) |
a77d35844233
5% cpu optimization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3531
diff
changeset
|
401 |
: m_tid (o.m_tid) {} |
a77d35844233
5% cpu optimization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3531
diff
changeset
|
402 |
TypeId &TypeId::operator = (const TypeId &o) |
a77d35844233
5% cpu optimization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3531
diff
changeset
|
403 |
{ |
a77d35844233
5% cpu optimization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3531
diff
changeset
|
404 |
m_tid = o.m_tid; |
a77d35844233
5% cpu optimization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3531
diff
changeset
|
405 |
return *this; |
a77d35844233
5% cpu optimization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3531
diff
changeset
|
406 |
} |
a77d35844233
5% cpu optimization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3531
diff
changeset
|
407 |
TypeId::~TypeId () |
a77d35844233
5% cpu optimization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3531
diff
changeset
|
408 |
{} |
a77d35844233
5% cpu optimization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3531
diff
changeset
|
409 |
|
a77d35844233
5% cpu optimization
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3531
diff
changeset
|
410 |
|
2638
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
411 |
/************************************************************************* |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
412 |
* The TypeId implementation which depends on templates |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
413 |
*************************************************************************/ |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
414 |
|
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
415 |
template <typename T> |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
416 |
TypeId |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
417 |
TypeId::SetParent (void) |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
418 |
{ |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
419 |
return SetParent (T::GetTypeId ()); |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
420 |
} |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
421 |
|
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
422 |
template <typename T> |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
423 |
TypeId |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
424 |
TypeId::AddConstructor (void) |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
425 |
{ |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
426 |
struct Maker { |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
427 |
static ObjectBase * Create () { |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
428 |
ObjectBase * base = new T (); |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
429 |
return base; |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
430 |
} |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
431 |
}; |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
432 |
Callback<ObjectBase *> cb = MakeCallback (&Maker::Create); |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
433 |
DoAddConstructor (cb); |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
434 |
return *this; |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
435 |
} |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
436 |
|
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
437 |
} // namespace ns3 |
00bd5081ee68
move more code around
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2633
diff
changeset
|
438 |
|
2633
a0639de8cd8b
split code from object.h/object.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
439 |
#endif /* TYPE_ID_H */ |