|
|
| 171 |
* Get the total number of type ids. |
171 |
* Get the total number of type ids. |
| 172 |
* \returns The total number. |
172 |
* \returns The total number. |
| 173 |
*/ |
173 |
*/ |
| 174 |
uint16_t GetRegisteredN(void) const; |
174 |
uint16_t GetRegisteredN (void) const; |
| 175 |
/** |
175 |
/** |
| 176 |
* Get a type id by index. |
176 |
* Get a type id by index. |
| 177 |
* |
177 |
* |
|
|
| 213 |
* \param [in] i The attribute to manipulate |
213 |
* \param [in] i The attribute to manipulate |
| 214 |
* \param [in] initialValue The new initial value to use for this attribute. |
214 |
* \param [in] initialValue The new initial value to use for this attribute. |
| 215 |
*/ |
215 |
*/ |
| 216 |
void SetAttributeInitialValue(uint16_t uid, |
216 |
void SetAttributeInitialValue (uint16_t uid, |
| 217 |
std::size_t i, |
217 |
std::size_t i, |
| 218 |
Ptr<const AttributeValue> initialValue); |
218 |
Ptr<const AttributeValue> initialValue); |
| 219 |
/** |
219 |
/** |
| 220 |
* Get the number of attributes. |
220 |
* Get the number of attributes. |
| 221 |
* \param [in] uid The id. |
221 |
* \param [in] uid The id. |
| 222 |
* \returns The number of attributes associated to this TypeId |
222 |
* \returns The number of attributes associated to this TypeId |
| 223 |
*/ |
223 |
*/ |
| 224 |
std::size_t GetAttributeN(uint16_t uid) const; |
224 |
std::size_t GetAttributeN (uint16_t uid) const; |
| 225 |
/** |
225 |
/** |
| 226 |
* Get Attribute information by index. |
226 |
* Get Attribute information by index. |
| 227 |
* \param [in] uid The id. |
227 |
* \param [in] uid The id. |
| 228 |
* \param [in] i Index into attribute array |
228 |
* \param [in] i Index into attribute array |
| 229 |
* \returns The information associated to attribute whose index is \p i. |
229 |
* \returns The information associated to attribute whose index is \p i. |
| 230 |
*/ |
230 |
*/ |
| 231 |
struct TypeId::AttributeInformation GetAttribute(uint16_t uid, std::size_t i) const; |
231 |
struct TypeId::AttributeInformation GetAttribute (uint16_t uid, std::size_t i) const; |
| 232 |
/** |
232 |
/** |
| 233 |
* Record a new TraceSource. |
233 |
* Record a new TraceSource. |
| 234 |
* \param [in] uid The id. |
234 |
* \param [in] uid The id. |
|
|
| 256 |
* \param [in] uid The id. |
256 |
* \param [in] uid The id. |
| 257 |
* \returns The number of trace sources defined in this TypeId. |
257 |
* \returns The number of trace sources defined in this TypeId. |
| 258 |
*/ |
258 |
*/ |
| 259 |
std::size_t GetTraceSourceN(uint16_t uid) const; |
259 |
std::size_t GetTraceSourceN (uint16_t uid) const; |
| 260 |
/** |
260 |
/** |
| 261 |
* Get the trace source by index. |
261 |
* Get the trace source by index. |
| 262 |
* \param [in] uid The id. |
262 |
* \param [in] uid The id. |
| 263 |
* \param [in] i Index into trace source array. |
263 |
* \param [in] i Index into trace source array. |
| 264 |
* \returns Detailed information about the requested trace source. |
264 |
* \returns Detailed information about the requested trace source. |
| 265 |
*/ |
265 |
*/ |
| 266 |
struct TypeId::TraceSourceInformation GetTraceSource(uint16_t uid, std::size_t i) const; |
266 |
struct TypeId::TraceSourceInformation GetTraceSource (uint16_t uid, std::size_t i) const; |
| 267 |
/** |
267 |
/** |
| 268 |
* Check if this TypeId should not be listed in documentation. |
268 |
* Check if this TypeId should not be listed in documentation. |
| 269 |
* \param [in] uid The id. |
269 |
* \param [in] uid The id. |
|
|
| 423 |
else |
423 |
else |
| 424 |
{ // chain old type |
424 |
{ // chain old type |
| 425 |
NS_LOG_LOGIC (IIDL << "Old TypeId '" << hinfo->name << "' getting chained."); |
425 |
NS_LOG_LOGIC (IIDL << "Old TypeId '" << hinfo->name << "' getting chained."); |
| 426 |
uint16_t oldUid = GetUid(hinfo->hash); |
426 |
uint16_t oldUid = GetUid (hinfo->hash); |
| 427 |
m_hashmap.erase (m_hashmap.find (hinfo->hash)); |
427 |
m_hashmap.erase (m_hashmap.find (hinfo->hash)); |
| 428 |
hinfo->hash = hash | HashChainFlag; |
428 |
hinfo->hash = hash | HashChainFlag; |
| 429 |
m_hashmap.insert (std::make_pair (hinfo->hash, oldUid)); |
429 |
m_hashmap.insert (std::make_pair (hinfo->hash, oldUid)); |
|
|
| 440 |
information.hasConstructor = false; |
440 |
information.hasConstructor = false; |
| 441 |
information.mustHideFromDocumentation = false; |
441 |
information.mustHideFromDocumentation = false; |
| 442 |
m_information.push_back (information); |
442 |
m_information.push_back (information); |
| 443 |
uint16_t uid = static_cast<uint16_t> (m_information.size()); |
443 |
std::size_t tuid = m_information.size (); |
| 444 |
NS_ASSERT (uid <= 0xffff); |
444 |
NS_ASSERT (tuid <= 0xffff); |
|
|
445 |
uint16_t uid = static_cast<uint16_t> (tuid); |
| 445 |
|
446 |
|
| 446 |
// Add to both maps: |
447 |
// Add to both maps: |
| 447 |
m_namemap.insert (std::make_pair (name, uid)); |
448 |
m_namemap.insert (std::make_pair (name, uid)); |
| 448 |
m_hashmap.insert (std::make_pair (hash, uid)); |
449 |
m_hashmap.insert (std::make_pair (hash, uid)); |
| 449 |
NS_LOG_LOGIC (IIDL << uid); |
450 |
NS_LOG_LOGIC (IIDL << uid); |
| 450 |
return static_cast<uint16_t>(uid); |
451 |
return static_cast<uint16_t> (uid); |
| 451 |
} |
452 |
} |
| 452 |
|
453 |
|
| 453 |
struct IidManager::IidInformation * |
454 |
struct IidManager::IidInformation * |
|
|
| 678 |
NS_LOG_LOGIC (IIDL << information->attributes.size () - 1); |
679 |
NS_LOG_LOGIC (IIDL << information->attributes.size () - 1); |
| 679 |
} |
680 |
} |
| 680 |
void |
681 |
void |
| 681 |
IidManager::SetAttributeInitialValue(uint16_t uid, |
682 |
IidManager::SetAttributeInitialValue (uint16_t uid, |
| 682 |
std::size_t i, |
683 |
std::size_t i, |
| 683 |
Ptr<const AttributeValue> initialValue) |
684 |
Ptr<const AttributeValue> initialValue) |
| 684 |
{ |
685 |
{ |
| 685 |
NS_LOG_FUNCTION (IID << uid << i << initialValue); |
686 |
NS_LOG_FUNCTION (IID << uid << i << initialValue); |
| 686 |
struct IidInformation *information = LookupInformation (uid); |
687 |
struct IidInformation *information = LookupInformation (uid); |
|
|
| 695 |
{ |
696 |
{ |
| 696 |
NS_LOG_FUNCTION (IID << uid); |
697 |
NS_LOG_FUNCTION (IID << uid); |
| 697 |
struct IidInformation *information = LookupInformation (uid); |
698 |
struct IidInformation *information = LookupInformation (uid); |
| 698 |
std::size_t size = information->attributes.size(); |
699 |
std::size_t size = information->attributes.size (); |
| 699 |
NS_LOG_LOGIC (IIDL << size); |
700 |
NS_LOG_LOGIC (IIDL << size); |
| 700 |
return size; |
701 |
return size; |
| 701 |
} |
702 |
} |
| 702 |
struct TypeId::AttributeInformation |
703 |
struct TypeId::AttributeInformation |
| 703 |
IidManager::GetAttribute(uint16_t uid, std::size_t i) const |
704 |
IidManager::GetAttribute (uint16_t uid, std::size_t i) const |
| 704 |
{ |
705 |
{ |
| 705 |
NS_LOG_FUNCTION (IID << uid << i); |
706 |
NS_LOG_FUNCTION (IID << uid << i); |
| 706 |
struct IidInformation *information = LookupInformation (uid); |
707 |
struct IidInformation *information = LookupInformation (uid); |
|
|
| 773 |
{ |
774 |
{ |
| 774 |
NS_LOG_FUNCTION (IID << uid); |
775 |
NS_LOG_FUNCTION (IID << uid); |
| 775 |
struct IidInformation *information = LookupInformation (uid); |
776 |
struct IidInformation *information = LookupInformation (uid); |
| 776 |
std::size_t size = information->traceSources.size(); |
777 |
std::size_t size = information->traceSources.size (); |
| 777 |
NS_LOG_LOGIC (IIDL << size); |
778 |
NS_LOG_LOGIC (IIDL << size); |
| 778 |
return size; |
779 |
return size; |
| 779 |
} |
780 |
} |
| 780 |
struct TypeId::TraceSourceInformation |
781 |
struct TypeId::TraceSourceInformation |
| 781 |
IidManager::GetTraceSource(uint16_t uid, std::size_t i) const |
782 |
IidManager::GetTraceSource (uint16_t uid, std::size_t i) const |
| 782 |
{ |
783 |
{ |
| 783 |
NS_LOG_FUNCTION (IID << uid << i); |
784 |
NS_LOG_FUNCTION (IID << uid << i); |
| 784 |
struct IidInformation *information = LookupInformation (uid); |
785 |
struct IidInformation *information = LookupInformation (uid); |
|
|
| 880 |
TypeId nextTid = *this; |
881 |
TypeId nextTid = *this; |
| 881 |
do { |
882 |
do { |
| 882 |
tid = nextTid; |
883 |
tid = nextTid; |
| 883 |
for (std::size_t i = 0; i < tid.GetAttributeN(); i++) |
884 |
for (std::size_t i = 0; i < tid.GetAttributeN (); i++) |
| 884 |
{ |
885 |
{ |
| 885 |
struct TypeId::AttributeInformation tmp = tid.GetAttribute(i); |
886 |
struct TypeId::AttributeInformation tmp = tid.GetAttribute (i); |
| 886 |
if (tmp.name == name) |
887 |
if (tmp.name == name) |
| 887 |
{ |
888 |
{ |
| 888 |
if (tmp.supportLevel == TypeId::SUPPORTED) |
889 |
if (tmp.supportLevel == TypeId::SUPPORTED) |
|
|
| 1039 |
} |
1040 |
} |
| 1040 |
|
1041 |
|
| 1041 |
bool |
1042 |
bool |
| 1042 |
TypeId::SetAttributeInitialValue(std::size_t i, |
1043 |
TypeId::SetAttributeInitialValue (std::size_t i, |
| 1043 |
Ptr<const AttributeValue> initialValue) |
1044 |
Ptr<const AttributeValue> initialValue) |
| 1044 |
{ |
1045 |
{ |
| 1045 |
NS_LOG_FUNCTION (this << i << initialValue); |
1046 |
NS_LOG_FUNCTION (this << i << initialValue); |
| 1046 |
IidManager::Get ()->SetAttributeInitialValue (m_tid, i, initialValue); |
1047 |
IidManager::Get ()->SetAttributeInitialValue (m_tid, i, initialValue); |
|
|
| 1068 |
TypeId::GetAttributeN (void) const |
1069 |
TypeId::GetAttributeN (void) const |
| 1069 |
{ |
1070 |
{ |
| 1070 |
NS_LOG_FUNCTION (this); |
1071 |
NS_LOG_FUNCTION (this); |
| 1071 |
std::size_t n = IidManager::Get()->GetAttributeN(m_tid); |
1072 |
std::size_t n = IidManager::Get ()->GetAttributeN (m_tid); |
| 1072 |
return n; |
1073 |
return n; |
| 1073 |
} |
1074 |
} |
| 1074 |
struct TypeId::AttributeInformation |
1075 |
struct TypeId::AttributeInformation |
| 1075 |
TypeId::GetAttribute(std::size_t i) const |
1076 |
TypeId::GetAttribute (std::size_t i) const |
| 1076 |
{ |
1077 |
{ |
| 1077 |
NS_LOG_FUNCTION (this << i); |
1078 |
NS_LOG_FUNCTION (this << i); |
| 1078 |
return IidManager::Get ()->GetAttribute(m_tid, i); |
1079 |
return IidManager::Get ()->GetAttribute (m_tid, i); |
| 1079 |
} |
1080 |
} |
| 1080 |
std::string |
1081 |
std::string |
| 1081 |
TypeId::GetAttributeFullName(std::size_t i) const |
1082 |
TypeId::GetAttributeFullName (std::size_t i) const |
| 1082 |
{ |
1083 |
{ |
| 1083 |
NS_LOG_FUNCTION (this << i); |
1084 |
NS_LOG_FUNCTION (this << i); |
| 1084 |
struct TypeId::AttributeInformation info = GetAttribute(i); |
1085 |
struct TypeId::AttributeInformation info = GetAttribute (i); |
| 1085 |
return GetName () + "::" + info.name; |
1086 |
return GetName () + "::" + info.name; |
| 1086 |
} |
1087 |
} |
| 1087 |
|
1088 |
|
|
|
| 1092 |
return IidManager::Get ()->GetTraceSourceN (m_tid); |
1093 |
return IidManager::Get ()->GetTraceSourceN (m_tid); |
| 1093 |
} |
1094 |
} |
| 1094 |
struct TypeId::TraceSourceInformation |
1095 |
struct TypeId::TraceSourceInformation |
| 1095 |
TypeId::GetTraceSource(std::size_t i) const |
1096 |
TypeId::GetTraceSource (std::size_t i) const |
| 1096 |
{ |
1097 |
{ |
| 1097 |
NS_LOG_FUNCTION (this << i); |
1098 |
NS_LOG_FUNCTION (this << i); |
| 1098 |
return IidManager::Get ()->GetTraceSource(m_tid, i); |
1099 |
return IidManager::Get ()->GetTraceSource (m_tid, i); |
| 1099 |
} |
1100 |
} |
| 1100 |
|
1101 |
|
| 1101 |
TypeId |
1102 |
TypeId |
|
|
| 1141 |
struct TypeId::TraceSourceInformation tmp; |
1142 |
struct TypeId::TraceSourceInformation tmp; |
| 1142 |
do { |
1143 |
do { |
| 1143 |
tid = nextTid; |
1144 |
tid = nextTid; |
| 1144 |
for (std::size_t i = 0; i < tid.GetTraceSourceN(); i++) |
1145 |
for (std::size_t i = 0; i < tid.GetTraceSourceN (); i++) |
| 1145 |
{ |
1146 |
{ |
| 1146 |
tmp = tid.GetTraceSource (i); |
1147 |
tmp = tid.GetTraceSource (i); |
| 1147 |
if (tmp.name == name) |
1148 |
if (tmp.name == name) |