A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
type-id.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7 */
8#ifndef TYPE_ID_H
9#define TYPE_ID_H
10
12#include "attribute-helper.h"
13#include "attribute.h"
14#include "callback.h"
15#include "hash.h"
17
18#include <stdint.h>
19#include <string>
20
21/**
22 * \file
23 * \ingroup object
24 * ns3::TypeId declaration; inline and template implementations.
25 */
26
27namespace ns3
28{
29
30class ObjectBase;
31
32/**
33 * \ingroup object
34 * \brief a unique identifier for an interface.
35 *
36 * This class records a lot of meta-information about a
37 * subclass of the Object base class:
38 * - the base class of the subclass
39 * - the set of accessible constructors in the subclass
40 * - the set of 'attributes' accessible in the subclass
41 *
42 * \see attribute_TypeId
43 *
44 * \internal
45 * See the discussion in IidManager about hash chaining of TypeId's.
46 */
47class TypeId
48{
49 public:
50 /** Flags describing when a given attribute can be read or written. */
52 {
53 ATTR_GET = 1 << 0, /**< The attribute can be read */
54 ATTR_SET = 1 << 1, /**< The attribute can be written */
55 ATTR_CONSTRUCT = 1 << 2, /**< The attribute can be written at construction-time */
57 ATTR_CONSTRUCT, /**< The attribute can be read, and written at any time */
58 };
59
60 /** The level of support or deprecation for attributes or trace sources. */
62 {
63 SUPPORTED, /**< Attribute or trace source is currently used. */
64 DEPRECATED, /**< Attribute or trace source is deprecated; user is warned. */
65 OBSOLETE /**< Attribute or trace source is not used anymore; simulation fails. */
66 };
67
68 /** Attribute implementation. */
70 {
71 /** Attribute name. */
72 std::string name;
73 /** Attribute help string. */
74 std::string help;
75 /** AttributeFlags value. */
77 /** Default initial value. */
79 /** Configured initial value. */
81 /** Accessor object. */
83 /** Checker object. */
85 /** Support level/deprecation. */
87 /** Support message. */
88 std::string supportMsg;
89 };
90
91 /** TraceSource implementation. */
93 {
94 /** Trace name. */
95 std::string name;
96 /** Trace help string. */
97 std::string help;
98 /** Callback function signature type. */
99 std::string callback;
100 /** Trace accessor. */
102 /** Support level/deprecation. */
104 /** Support message. */
105 std::string supportMsg;
106 };
107
108 /** Type of hash values. */
110
111 /**
112 * Get a TypeId by name.
113 *
114 * \param [in] name The name of the requested TypeId
115 * \returns The unique id associated with the requested name.
116 *
117 * This method cannot fail: it will crash if the input
118 * name is not a valid TypeId name.
119 */
120 static TypeId LookupByName(std::string name);
121 /**
122 * Get a TypeId by name.
123 *
124 * \param [in] name The name of the requested TypeId
125 * \param [out] tid A pointer to the TypeId instance where the
126 * result of this function should be stored.
127 * \returns \c true if the requested name was found.
128 */
129 static bool LookupByNameFailSafe(std::string name, TypeId* tid);
130 /**
131 * Get a TypeId by hash.
132 *
133 * \param [in] hash The hash to lookup
134 * \returns The unique id associated with the requested hash.
135 *
136 * This method cannot fail: it will crash if the input
137 * hash does not match an existing TypeId.
138 */
139 static TypeId LookupByHash(hash_t hash);
140 /**
141 * Get a TypeId by hash.
142 *
143 * \param [in] hash The hash of the requested TypeId
144 * \param [out] tid A pointer to the TypeId instance where the
145 * result of this function should be stored.
146 * \returns \c true if the requested hash was found.
147 */
148 static bool LookupByHashFailSafe(hash_t hash, TypeId* tid);
149
150 /**
151 * Get the number of registered TypeIds.
152 *
153 * \returns The number of TypeId instances registered.
154 */
155 static uint16_t GetRegisteredN();
156 /**
157 * Get a TypeId by index.
158 *
159 * \param [in] i Index of the TypeId.
160 * \returns The TypeId instance whose index is \c i.
161 */
162 static TypeId GetRegistered(uint16_t i);
163
164 /**
165 * Constructor.
166 *
167 * \param [in] name The name of the interface to construct.
168 *
169 * No two instances can share the same name. The name is expected to be
170 * the full c++ typename of associated c++ object.
171 */
172 explicit TypeId(const std::string& name);
173
174 /**
175 * Add an deprecated name for a TypeId.
176 *
177 * \param [in] name The deprecated name.
178 * \return This TypeId instance.
179 *
180 * To allow for deprecations (such as moving a TypeId into a namespace
181 * but wishing to preserve the original string from namespace ns3),
182 * one additional deprecated name can be registered for a TypeId. This
183 * deprecated name is not retrievable by GetName(). A runtime warning is
184 * generated if the name is used, and only one deprecated name is supported.
185 */
186 TypeId AddDeprecatedName(const std::string& name);
187
188 /**
189 * Get the parent of this TypeId.
190 *
191 * \returns The parent of this TypeId
192 *
193 * This method cannot fail. It will return itself
194 * if this TypeId has no parent. i.e., it is at the top
195 * of the TypeId hierarchy. Currently, this is the
196 * case for the TypeId associated to the ns3::ObjectBase class
197 * only.
198 */
199 TypeId GetParent() const;
200
201 /**
202 * Check if this TypeId has a parent.
203 *
204 * \return \c true if this TypeId has a parent.
205 */
206 bool HasParent() const;
207
208 /**
209 * Check if this TypeId is a child of another.
210 *
211 * \param [in] other A parent TypeId
212 * \returns \c true if the input TypeId is really a parent of this TypeId.
213 *
214 * Calling this method is roughly similar to calling dynamic_cast
215 * except that you do not need object instances: you can do the check
216 * with TypeId instances instead.
217 */
218 bool IsChildOf(TypeId other) const;
219
220 /**
221 * Get the group name.
222 *
223 * \returns The name of the group associated to this TypeId.
224 */
225 std::string GetGroupName() const;
226
227 /**
228 * Get the name.
229 *
230 * \returns The name of this interface.
231 */
232 std::string GetName() const;
233
234 /**
235 * Get the hash.
236 *
237 * \returns The hash of this interface.
238 */
239 hash_t GetHash() const;
240
241 /**
242 * Get the size of this object.
243 *
244 * \returns The size of this interface.
245 */
246 std::size_t GetSize() const;
247
248 /**
249 * Check if this TypeId has a constructor.
250 *
251 * \returns \c true if this TypeId has a constructor
252 */
253 bool HasConstructor() const;
254
255 /**
256 * Get the number of attributes.
257 *
258 * \returns The number of attributes associated to this TypeId
259 */
260 std::size_t GetAttributeN() const;
261 /**
262 * Get Attribute information by index.
263 *
264 * \param [in] i Index into attribute array
265 * \returns The information associated to attribute whose index is \pname{i}.
266 */
267 TypeId::AttributeInformation GetAttribute(std::size_t i) const;
268 /**
269 * Get the Attribute name by index.
270 *
271 * \param [in] i Index into attribute array
272 * \returns The full name associated to the attribute whose index is \pname{i}.
273 */
274 std::string GetAttributeFullName(std::size_t i) const;
275
276 /**
277 * Get the constructor callback.
278 *
279 * \returns A callback which can be used to instantiate an object
280 * of this type.
281 */
283
284 /**
285 * Check if this TypeId should not be listed in documentation.
286 *
287 * \returns \c true if this TypeId should be hidden from the user.
288 */
289 bool MustHideFromDocumentation() const;
290
291 /**
292 * Get the number of Trace sources.
293 *
294 * \returns The number of trace sources defined in this TypeId.
295 */
296 std::size_t GetTraceSourceN() const;
297 /**
298 * Get the trace source by index.
299 *
300 * \param [in] i Index into trace source array.
301 * \returns Detailed information about the requested trace source.
302 */
304
305 /**
306 * Set the parent TypeId.
307 *
308 * \param [in] tid The TypeId of the base class.
309 * \return This TypeId instance.
310 *
311 * Record in this TypeId which TypeId is the TypeId
312 * of the base class of the subclass.
313 */
315 /**
316 * Set the parent TypeId.
317 *
318 * \tparam T \explicit The parent TypeID type.
319 * \return This TypeId instance.
320 *
321 * Record in this TypeId which TypeId is the TypeId
322 * of the base class of the subclass.
323 */
324 template <typename T>
326
327 /**
328 * Set the group name.
329 *
330 * \param [in] groupName The name of the group this TypeId belongs to.
331 * \returns This TypeId instance.
332 *
333 * The group name is purely an advisory information used to
334 * group together types according to a user-specific grouping
335 * scheme.
336 */
337 TypeId SetGroupName(std::string groupName);
338
339 /**
340 * Set the size of this type.
341 *
342 * Call this way:
343 * \code
344 * SetSize (sizeof (<typename>));
345 * \endcode
346 * This is done automatically by NS_LOG_ENSURE_REGISTERED()
347 * A ridiculously large reported size is a symptom that the
348 * type hasn't been registered.
349 *
350 * \param [in] size The size of the object, in bytes.
351 * \returns This TypeId instance.
352 */
353 TypeId SetSize(std::size_t size);
354
355 /**
356 * Record in this TypeId the fact that the default constructor
357 * is accessible.
358 *
359 * \tparam T \explicit The class name represented by this TypeId.
360 * \returns This TypeId instance
361 */
362 template <typename T>
364
365 /**
366 * Record in this TypeId the fact that a new attribute exists.
367 *
368 * \param [in] name The name of the new attribute
369 * \param [in] help Some help text which describes the purpose of this
370 * attribute.
371 * \param [in] initialValue The initial value for this attribute.
372 * \param [in] accessor An instance of the associated AttributeAccessor
373 * subclass.
374 * \param [in] checker An instance of the associated AttributeChecker
375 * subclass.
376 * \param [in] supportLevel Support/deprecation status of the attribute.
377 * \param [in] supportMsg Upgrade hint if this attribute is no longer
378 * supported. If the attribute is \c DEPRECATED the attribute
379 * behavior still exists, but user code should be updated
380 * following guidance in the hint.
381 * If the attribute is \c OBSOLETE, the hint should indicate
382 * which class the attribute functional has been moved to,
383 * or that the functionality is no longer supported.
384 * See test file type-id-test-suite.cc for examples.
385 * \returns This TypeId instance
386 */
387 TypeId AddAttribute(std::string name,
388 std::string help,
389 const AttributeValue& initialValue,
392 SupportLevel supportLevel = SUPPORTED,
393 const std::string& supportMsg = "");
394
395 /**
396 * Set the initial value of an Attribute.
397 *
398 * \param [in] i The attribute to manipulate
399 * \param [in] initialValue The new initial value to use for this attribute.
400 * \returns \c true if the call was successfully.
401 */
402 bool SetAttributeInitialValue(std::size_t i, Ptr<const AttributeValue> initialValue);
403
404 /**
405 * Record in this TypeId the fact that a new attribute exists.
406 *
407 * \param [in] name The name of the new attribute
408 * \param [in] help Some help text which describes the purpose of this
409 * attribute
410 * \param [in] flags Flags which describe how this attribute can be read and/or written.
411 * \param [in] initialValue The initial value for this attribute.
412 * \param [in] accessor An instance of the associated AttributeAccessor
413 * subclass.
414 * \param [in] checker An instance of the associated AttributeChecker
415 * subclass.
416 * \param [in] supportLevel Support/deprecation status of the attribute.
417 * \param [in] supportMsg Upgrade hint if this attribute is no longer
418 * supported. If the attribute is \c DEPRECATED the attribute
419 * behavior still exists, but user code should be updated
420 * following guidance in the hint..
421 * If the attribute is \c OBSOLETE, the hint should indicate
422 * which class the attribute functional has been moved to,
423 * or that the functionality is no longer supported.
424 * \returns This TypeId instance
425 */
426 TypeId AddAttribute(std::string name,
427 std::string help,
428 uint32_t flags,
429 const AttributeValue& initialValue,
432 SupportLevel supportLevel = SUPPORTED,
433 const std::string& supportMsg = "");
434
435 /**
436 * Record a new TraceSource.
437 *
438 * \param [in] name The name of the new trace source
439 * \param [in] help Some help text which describes the purpose of this
440 * trace source.
441 * \param [in] accessor A pointer to a TraceSourceAccessor which can be
442 * used to connect/disconnect sinks to this trace source.
443 * \param [in] callback Fully qualified typedef name for the callback
444 * signature. Generally this should begin with the
445 * "ns3::" namespace qualifier.
446 * \param [in] supportLevel Support/deprecation status of the attribute.
447 * \param [in] supportMsg Upgrade hint if this attribute is no longer
448 * supported. If the attribute is \c DEPRECATED the attribute
449 * behavior still exists, but user code should be updated
450 * following guidance in the hint..
451 * If the attribute is \c OBSOLETE, the hint should indicate
452 * which class the attribute functional has been moved to,
453 * or that the functionality is no longer supported.
454 * See test file type-id-test-suite.cc for examples.
455 * \returns This TypeId instance.
456 */
457 TypeId AddTraceSource(std::string name,
458 std::string help,
460 std::string callback,
461 SupportLevel supportLevel = SUPPORTED,
462 const std::string& supportMsg = "");
463
464 /**
465 * Hide this TypeId from documentation.
466 * \returns This TypeId instance.
467 */
469
470 /**
471 * Find an attribute by name in the inheritance tree for a given TypeId.
472 *
473 * \param [in] tid The TypeId to start the search from.
474 * \param [in] name The name of the attribute to search for.
475 * \return A tuple containing a boolean that indicates whether the attribute was found, the
476 * TypeId where the attribute was found, and the AttributeInformation of the found attribute.
477 */
478 static std::tuple<bool, TypeId, AttributeInformation> FindAttribute(const TypeId& tid,
479 const std::string& name);
480
481 /**
482 * Find an Attribute by name, retrieving the associated AttributeInformation.
483 *
484 * \param [in] name The name of the requested attribute
485 * \param [in,out] info A pointer to the TypeId::AttributeInformation
486 * data structure where the result value of this method
487 * will be stored.
488 * \param [in] permissive If false (by default), will generate warnings and errors for
489 * deprecated and obsolete attributes, respectively. If set to true, warnings for deprecated
490 * attributes will be suppressed.
491 * \returns \c true if the requested attribute could be found.
492 */
493 bool LookupAttributeByName(std::string name,
495 bool permissive = false) const;
496 /**
497 * Find a TraceSource by name.
498 *
499 * If no matching trace source is found, this method returns zero.
500 *
501 * \param [in] name The name of the requested trace source
502 * \return The trace source accessor which can be used to connect
503 * and disconnect trace sinks with the requested trace source on
504 * an object instance.
505 */
507 /**
508 * Find a TraceSource by name, retrieving the associated TraceSourceInformation.
509 *
510 * \param [in] name The name of the requested trace source.
511 * \param [out] info A pointer to the TypeId::TraceSourceInformation
512 * data structure where the result value of this method
513 * will be stored.
514 * \return The trace source accessor which can be used to connect
515 * and disconnect trace sinks with the requested trace source on
516 * an object instance.
517 */
519 TraceSourceInformation* info) const;
520
521 /**
522 * Get the internal id of this TypeId.
523 *
524 * \returns The internal integer which uniquely identifies this TypeId.
525 *
526 * This is really an internal method which users are not expected
527 * to use.
528 */
529 uint16_t GetUid() const;
530 /**
531 * Set the internal id of this TypeId.
532 *
533 * \param [in] uid The internal integer which uniquely identifies
534 * this TypeId. This TypeId should already have been registered.
535 *
536 * Typically this is used in serialization/deserialization.
537 *
538 * This method is even more internal than GetUid(). Use
539 * at your own risk and don't be surprised that it eats raw
540 * babies on full-moon nights.
541 */
542 void SetUid(uint16_t uid);
543
544 /** Default constructor. This produces an invalid TypeId. */
545 inline TypeId();
546 /**
547 * Copy constructor.
548 * \param [in] o The other TypeId.
549 */
550 inline TypeId(const TypeId& o);
551 /**
552 * Assignment.
553 * \param [in] o The other TypeId.
554 * \returns The copied TypeId.
555 */
556 inline TypeId& operator=(const TypeId& o);
557 /** Destructor. */
558 inline ~TypeId();
559
560 private:
561 /**
562 * \name Comparison operators.
563 * Standard comparison operators.
564 * @{
565 */
566 friend inline bool operator==(TypeId a, TypeId b);
567 friend inline bool operator!=(TypeId a, TypeId b);
568 friend bool operator<(TypeId a, TypeId b);
569 /**@}*/
570
571 /**
572 * Construct from an integer value.
573 * \param [in] tid The TypeId value as an integer.
574 */
575 explicit TypeId(uint16_t tid);
576 /**
577 * Implementation for AddConstructor().
578 *
579 * \param [in] callback Callback which constructs an instance of this TypeId.
580 */
582
583 /** The TypeId value. */
584 uint16_t m_tid;
585};
586
587/**
588 * \relates TypeId
589 * Output streamer.
590 *
591 * \param [in,out] os The output stream.
592 * \param [in] tid The TypeId.
593 * \returns The output stream.
594 */
595std::ostream& operator<<(std::ostream& os, TypeId tid);
596/**
597 * \relates TypeId
598 * Input Streamer.
599 * \param [in,out] is The input stream.
600 * \param [out] tid The TypeId to set from the stream.
601 * \returns The input stream.
602 */
603std::istream& operator>>(std::istream& is, TypeId& tid);
604
605/**
606 * Comparison operator.
607 * \param [in] a One value.
608 * \param [in] b The other value.
609 * \returns The result of the comparison.
610 * @{
611 */
612inline bool operator==(TypeId a, TypeId b);
613inline bool operator!=(TypeId a, TypeId b);
614bool operator<(TypeId a, TypeId b);
615/** @} */
616
618
619} // namespace ns3
620
621namespace ns3
622{
623
625 : m_tid(0)
626{
627}
628
630 : m_tid(o.m_tid)
631{
632}
633
634TypeId&
636{
637 m_tid = o.m_tid;
638 return *this;
639}
640
642{
643}
644
645inline bool
647{
648 return a.m_tid == b.m_tid;
649}
650
651inline bool
653{
654 return a.m_tid != b.m_tid;
655}
656
657/*************************************************************************
658 * The TypeId implementation which depends on templates
659 *************************************************************************/
660
661template <typename T>
662TypeId
664{
665 return SetParent(T::GetTypeId());
666}
667
668template <typename T>
669TypeId
671{
672 struct Maker
673 {
674 static ObjectBase* Create()
675 {
676 ObjectBase* base = new T();
677 return base;
678 }
679 };
680
681 Callback<ObjectBase*> cb = MakeCallback(&Maker::Create);
683 return *this;
684}
685
686} // namespace ns3
687
688#endif /* TYPE_ID_H */
ns3::MakeAccessorHelper declarations and template implementations.
Attribute helper (ATTRIBUTE_ )macros definition.
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
Declaration of the various callback functions.
Hold a value for an Attribute.
Definition attribute.h:59
Callback template class.
Definition callback.h:422
Anchor the ns-3 type and attribute system.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
Definition type-id.h:48
bool IsChildOf(TypeId other) const
Check if this TypeId is a child of another.
Definition type-id.cc:1041
friend bool operator!=(TypeId a, TypeId b)
Comparison operator.
Definition type-id.h:652
std::size_t GetTraceSourceN() const
Get the number of Trace sources.
Definition type-id.cc:1193
bool SetAttributeInitialValue(std::size_t i, Ptr< const AttributeValue > initialValue)
Set the initial value of an Attribute.
Definition type-id.cc:1146
static TypeId LookupByName(std::string name)
Get a TypeId by name.
Definition type-id.cc:872
bool HasParent() const
Check if this TypeId has a parent.
Definition type-id.cc:1033
TypeId SetSize(std::size_t size)
Set the size of this type.
Definition type-id.cc:1017
hash_t GetHash() const
Get the hash.
Definition type-id.cc:1069
TypeId AddTraceSource(std::string name, std::string help, Ptr< const TraceSourceAccessor > accessor, std::string callback, SupportLevel supportLevel=SUPPORTED, const std::string &supportMsg="")
Record a new TraceSource.
Definition type-id.cc:1207
bool MustHideFromDocumentation() const
Check if this TypeId should not be listed in documentation.
Definition type-id.cc:1162
TypeId AddDeprecatedName(const std::string &name)
Add an deprecated name for a TypeId.
Definition type-id.cc:862
AttributeFlag
Flags describing when a given attribute can be read or written.
Definition type-id.h:52
@ ATTR_GET
The attribute can be read.
Definition type-id.h:53
@ ATTR_SGC
The attribute can be read, and written at any time.
Definition type-id.h:56
@ ATTR_SET
The attribute can be written.
Definition type-id.h:54
@ ATTR_CONSTRUCT
The attribute can be written at construction-time.
Definition type-id.h:55
static bool LookupByHashFailSafe(hash_t hash, TypeId *tid)
Get a TypeId by hash.
Definition type-id.cc:914
TypeId::TraceSourceInformation GetTraceSource(std::size_t i) const
Get the trace source by index.
Definition type-id.cc:1200
std::string GetGroupName() const
Get the group name.
Definition type-id.cc:1053
TypeId HideFromDocumentation()
Hide this TypeId from documentation.
Definition type-id.cc:1221
Callback< ObjectBase * > GetConstructor() const
Get the constructor callback.
Definition type-id.cc:1154
static uint16_t GetRegisteredN()
Get the number of registered TypeIds.
Definition type-id.cc:926
std::string GetAttributeFullName(std::size_t i) const
Get the Attribute name by index.
Definition type-id.cc:1185
bool HasConstructor() const
Check if this TypeId has a constructor.
Definition type-id.cc:1084
std::size_t GetAttributeN() const
Get the number of attributes.
Definition type-id.cc:1170
TypeId GetParent() const
Get the parent of this TypeId.
Definition type-id.cc:1025
TypeId AddConstructor()
Record in this TypeId the fact that the default constructor is accessible.
Definition type-id.h:670
void SetUid(uint16_t uid)
Set the internal id of this TypeId.
Definition type-id.cc:1282
uint16_t m_tid
The TypeId value.
Definition type-id.h:584
TypeId SetGroupName(std::string groupName)
Set the group name.
Definition type-id.cc:1009
static TypeId LookupByHash(hash_t hash)
Get a TypeId by hash.
Definition type-id.cc:904
static TypeId GetRegistered(uint16_t i)
Get a TypeId by index.
Definition type-id.cc:933
friend bool operator==(TypeId a, TypeId b)
Comparison operator.
Definition type-id.h:646
std::size_t GetSize() const
Get the size of this object.
Definition type-id.cc:1076
Ptr< const TraceSourceAccessor > LookupTraceSourceByName(std::string name) const
Find a TraceSource by name.
Definition type-id.cc:1268
TypeId & operator=(const TypeId &o)
Assignment.
Definition type-id.h:635
~TypeId()
Destructor.
Definition type-id.h:641
friend bool operator<(TypeId a, TypeId b)
Comparison operator.
Definition type-id.cc:1323
uint32_t hash_t
Type of hash values.
Definition type-id.h:109
TypeId()
Default constructor.
Definition type-id.h:624
TypeId::AttributeInformation GetAttribute(std::size_t i) const
Get Attribute information by index.
Definition type-id.cc:1178
uint16_t GetUid() const
Get the internal id of this TypeId.
Definition type-id.cc:1275
static bool LookupByNameFailSafe(std::string name, TypeId *tid)
Get a TypeId by name.
Definition type-id.cc:886
bool LookupAttributeByName(std::string name, AttributeInformation *info, bool permissive=false) const
Find an Attribute by name, retrieving the associated AttributeInformation.
Definition type-id.cc:968
SupportLevel
The level of support or deprecation for attributes or trace sources.
Definition type-id.h:62
@ SUPPORTED
Attribute or trace source is currently used.
Definition type-id.h:63
@ OBSOLETE
Attribute or trace source is not used anymore; simulation fails.
Definition type-id.h:65
@ DEPRECATED
Attribute or trace source is deprecated; user is warned.
Definition type-id.h:64
TypeId AddAttribute(std::string name, std::string help, const AttributeValue &initialValue, Ptr< const AttributeAccessor > accessor, Ptr< const AttributeChecker > checker, SupportLevel supportLevel=SUPPORTED, const std::string &supportMsg="")
Record in this TypeId the fact that a new attribute exists.
Definition type-id.cc:1099
static std::tuple< bool, TypeId, AttributeInformation > FindAttribute(const TypeId &tid, const std::string &name)
Find an attribute by name in the inheritance tree for a given TypeId.
Definition type-id.cc:940
std::string GetName() const
Get the name.
Definition type-id.cc:1061
TypeId SetParent()
Set the parent TypeId.
Definition type-id.h:663
void DoAddConstructor(Callback< ObjectBase * > callback)
Implementation for AddConstructor().
Definition type-id.cc:1092
#define ATTRIBUTE_HELPER_HEADER(type)
Declare the attribute value, accessor and checkers for class type
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
ns3::Hasher, ns3::Hash32() and ns3::Hash64() function declarations.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool operator!=(Callback< R, Args... > a, Callback< R, Args... > b)
Inequality test.
Definition callback.h:658
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition callback.h:684
bool operator==(const EventId &a, const EventId &b)
Definition event-id.h:155
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition angles.cc:148
std::istream & operator>>(std::istream &is, Angles &a)
Definition angles.cc:172
bool operator<(const EventId &a, const EventId &b)
Definition event-id.h:168
Attribute implementation.
Definition type-id.h:70
Ptr< const AttributeValue > originalInitialValue
Default initial value.
Definition type-id.h:78
TypeId::SupportLevel supportLevel
Support level/deprecation.
Definition type-id.h:86
std::string name
Attribute name.
Definition type-id.h:72
Ptr< const AttributeAccessor > accessor
Accessor object.
Definition type-id.h:82
uint32_t flags
AttributeFlags value.
Definition type-id.h:76
Ptr< const AttributeChecker > checker
Checker object.
Definition type-id.h:84
std::string supportMsg
Support message.
Definition type-id.h:88
Ptr< const AttributeValue > initialValue
Configured initial value.
Definition type-id.h:80
std::string help
Attribute help string.
Definition type-id.h:74
TraceSource implementation.
Definition type-id.h:93
std::string name
Trace name.
Definition type-id.h:95
std::string supportMsg
Support message.
Definition type-id.h:105
std::string help
Trace help string.
Definition type-id.h:97
Ptr< const TraceSourceAccessor > accessor
Trace accessor.
Definition type-id.h:101
std::string callback
Callback function signature type.
Definition type-id.h:99
TypeId::SupportLevel supportLevel
Support level/deprecation.
Definition type-id.h:103
ns3::TraceSourceAccessor and ns3::MakeTraceSourceAccessor declarations.