|
|
| 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 |
uint32_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 |
* |
|
|
| 181 |
* \param [in] i The index. |
181 |
* \param [in] i The index. |
| 182 |
* \returns The type id. |
182 |
* \returns The type id. |
| 183 |
*/ |
183 |
*/ |
| 184 |
uint16_t GetRegistered (uint32_t i) const; |
184 |
uint16_t GetRegistered (uint16_t i) const; |
| 185 |
/** |
185 |
/** |
| 186 |
* Record a new attribute in a type id. |
186 |
* Record a new attribute in a type id. |
| 187 |
* \param [in] uid The id. |
187 |
* \param [in] uid The id. |
|
|
| 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 |
uint32_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 |
uint32_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, uint32_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 |
uint32_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, uint32_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 |
uint32_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 |
uint32_t uid = m_information.size (); |
443 |
uint16_t uid = static_cast<uint16_t> (m_information.size ()); |
| 444 |
NS_ASSERT (uid <= 0xffff); |
444 |
NS_ASSERT (uid <= 0xffff); |
| 445 |
|
445 |
|
| 446 |
// Add to both maps: |
446 |
// Add to both maps: |
|
|
| 594 |
return hasC; |
594 |
return hasC; |
| 595 |
} |
595 |
} |
| 596 |
|
596 |
|
| 597 |
uint32_t |
597 |
uint16_t |
| 598 |
IidManager::GetRegisteredN (void) const |
598 |
IidManager::GetRegisteredN (void) const |
| 599 |
{ |
599 |
{ |
| 600 |
NS_LOG_FUNCTION (IID << m_information.size ()); |
600 |
NS_LOG_FUNCTION (IID << m_information.size ()); |
| 601 |
return m_information.size (); |
601 |
return static_cast<uint16_t> (m_information.size ()); |
| 602 |
} |
602 |
} |
| 603 |
uint16_t |
603 |
uint16_t |
| 604 |
IidManager::GetRegistered (uint32_t i) const |
604 |
IidManager::GetRegistered (uint16_t i) const |
| 605 |
{ |
605 |
{ |
| 606 |
NS_LOG_FUNCTION (IID << i); |
606 |
NS_LOG_FUNCTION (IID << i); |
| 607 |
return i + 1; |
607 |
return i + 1; |
|
|
| 679 |
} |
679 |
} |
| 680 |
void |
680 |
void |
| 681 |
IidManager::SetAttributeInitialValue(uint16_t uid, |
681 |
IidManager::SetAttributeInitialValue(uint16_t uid, |
| 682 |
uint32_t i, |
682 |
std::size_t i, |
| 683 |
Ptr<const AttributeValue> initialValue) |
683 |
Ptr<const AttributeValue> initialValue) |
| 684 |
{ |
684 |
{ |
| 685 |
NS_LOG_FUNCTION (IID << uid << i << initialValue); |
685 |
NS_LOG_FUNCTION (IID << uid << i << initialValue); |
|
|
| 690 |
|
690 |
|
| 691 |
|
691 |
|
| 692 |
|
692 |
|
| 693 |
uint32_t |
693 |
std::size_t |
| 694 |
IidManager::GetAttributeN (uint16_t uid) const |
694 |
IidManager::GetAttributeN (uint16_t uid) const |
| 695 |
{ |
695 |
{ |
| 696 |
NS_LOG_FUNCTION (IID << uid); |
696 |
NS_LOG_FUNCTION (IID << uid); |
| 697 |
struct IidInformation *information = LookupInformation (uid); |
697 |
struct IidInformation *information = LookupInformation (uid); |
| 698 |
uint32_t size = information->attributes.size (); |
698 |
std::size_t size = information->attributes.size (); |
| 699 |
NS_LOG_LOGIC (IIDL << size); |
699 |
NS_LOG_LOGIC (IIDL << size); |
| 700 |
return size; |
700 |
return size; |
| 701 |
} |
701 |
} |
| 702 |
struct TypeId::AttributeInformation |
702 |
struct TypeId::AttributeInformation |
| 703 |
IidManager::GetAttribute(uint16_t uid, uint32_t i) const |
703 |
IidManager::GetAttribute(uint16_t uid, std::size_t i) const |
| 704 |
{ |
704 |
{ |
| 705 |
NS_LOG_FUNCTION (IID << uid << i); |
705 |
NS_LOG_FUNCTION (IID << uid << i); |
| 706 |
struct IidInformation *information = LookupInformation (uid); |
706 |
struct IidInformation *information = LookupInformation (uid); |
|
|
| 768 |
information->traceSources.push_back (source); |
768 |
information->traceSources.push_back (source); |
| 769 |
NS_LOG_LOGIC (IIDL << information->traceSources.size () - 1); |
769 |
NS_LOG_LOGIC (IIDL << information->traceSources.size () - 1); |
| 770 |
} |
770 |
} |
| 771 |
uint32_t |
771 |
std::size_t |
| 772 |
IidManager::GetTraceSourceN (uint16_t uid) const |
772 |
IidManager::GetTraceSourceN (uint16_t uid) const |
| 773 |
{ |
773 |
{ |
| 774 |
NS_LOG_FUNCTION (IID << uid); |
774 |
NS_LOG_FUNCTION (IID << uid); |
| 775 |
struct IidInformation *information = LookupInformation (uid); |
775 |
struct IidInformation *information = LookupInformation (uid); |
| 776 |
uint32_t size = information->traceSources.size (); |
776 |
std::size_t size = information->traceSources.size (); |
| 777 |
NS_LOG_LOGIC (IIDL << size); |
777 |
NS_LOG_LOGIC (IIDL << size); |
| 778 |
return size; |
778 |
return size; |
| 779 |
} |
779 |
} |
| 780 |
struct TypeId::TraceSourceInformation |
780 |
struct TypeId::TraceSourceInformation |
| 781 |
IidManager::GetTraceSource(uint16_t uid, uint32_t i) const |
781 |
IidManager::GetTraceSource(uint16_t uid, std::size_t i) const |
| 782 |
{ |
782 |
{ |
| 783 |
NS_LOG_FUNCTION (IID << uid << i); |
783 |
NS_LOG_FUNCTION (IID << uid << i); |
| 784 |
struct IidInformation *information = LookupInformation (uid); |
784 |
struct IidInformation *information = LookupInformation (uid); |
|
|
| 859 |
return true; |
859 |
return true; |
| 860 |
} |
860 |
} |
| 861 |
|
861 |
|
| 862 |
uint32_t |
862 |
uint16_t |
| 863 |
TypeId::GetRegisteredN (void) |
863 |
TypeId::GetRegisteredN (void) |
| 864 |
{ |
864 |
{ |
| 865 |
NS_LOG_FUNCTION_NOARGS (); |
865 |
NS_LOG_FUNCTION_NOARGS (); |
| 866 |
return IidManager::Get ()->GetRegisteredN (); |
866 |
return IidManager::Get ()->GetRegisteredN (); |
| 867 |
} |
867 |
} |
| 868 |
TypeId |
868 |
TypeId |
| 869 |
TypeId::GetRegistered (uint32_t i) |
869 |
TypeId::GetRegistered (uint16_t i) |
| 870 |
{ |
870 |
{ |
| 871 |
NS_LOG_FUNCTION (i); |
871 |
NS_LOG_FUNCTION (i); |
| 872 |
return TypeId (IidManager::Get ()->GetRegistered (i)); |
872 |
return TypeId (IidManager::Get ()->GetRegistered (i)); |
|
|
| 880 |
TypeId nextTid = *this; |
880 |
TypeId nextTid = *this; |
| 881 |
do { |
881 |
do { |
| 882 |
tid = nextTid; |
882 |
tid = nextTid; |
| 883 |
for (uint32_t i = 0; i < tid.GetAttributeN (); i++) |
883 |
for (std::size_t i = 0; i < tid.GetAttributeN (); i++) |
| 884 |
{ |
884 |
{ |
| 885 |
struct TypeId::AttributeInformation tmp = tid.GetAttribute(i); |
885 |
struct TypeId::AttributeInformation tmp = tid.GetAttribute(i); |
| 886 |
if (tmp.name == name) |
886 |
if (tmp.name == name) |
|
|
| 1039 |
} |
1039 |
} |
| 1040 |
|
1040 |
|
| 1041 |
bool |
1041 |
bool |
| 1042 |
TypeId::SetAttributeInitialValue(uint32_t i, |
1042 |
TypeId::SetAttributeInitialValue(std::size_t i, |
| 1043 |
Ptr<const AttributeValue> initialValue) |
1043 |
Ptr<const AttributeValue> initialValue) |
| 1044 |
{ |
1044 |
{ |
| 1045 |
NS_LOG_FUNCTION (this << i << initialValue); |
1045 |
NS_LOG_FUNCTION (this << i << initialValue); |
|
|
| 1064 |
return mustHide; |
1064 |
return mustHide; |
| 1065 |
} |
1065 |
} |
| 1066 |
|
1066 |
|
| 1067 |
uint32_t |
1067 |
std::size_t |
| 1068 |
TypeId::GetAttributeN (void) const |
1068 |
TypeId::GetAttributeN (void) const |
| 1069 |
{ |
1069 |
{ |
| 1070 |
NS_LOG_FUNCTION (this); |
1070 |
NS_LOG_FUNCTION (this); |
| 1071 |
uint32_t n = IidManager::Get ()->GetAttributeN (m_tid); |
1071 |
std::size_t n = IidManager::Get ()->GetAttributeN (m_tid); |
| 1072 |
return n; |
1072 |
return n; |
| 1073 |
} |
1073 |
} |
| 1074 |
struct TypeId::AttributeInformation |
1074 |
struct TypeId::AttributeInformation |
| 1075 |
TypeId::GetAttribute(uint32_t i) const |
1075 |
TypeId::GetAttribute(std::size_t i) const |
| 1076 |
{ |
1076 |
{ |
| 1077 |
NS_LOG_FUNCTION (this << i); |
1077 |
NS_LOG_FUNCTION (this << i); |
| 1078 |
return IidManager::Get ()->GetAttribute(m_tid, i); |
1078 |
return IidManager::Get ()->GetAttribute(m_tid, i); |
| 1079 |
} |
1079 |
} |
| 1080 |
std::string |
1080 |
std::string |
| 1081 |
TypeId::GetAttributeFullName (uint32_t i) const |
1081 |
TypeId::GetAttributeFullName (std::size_t i) const |
| 1082 |
{ |
1082 |
{ |
| 1083 |
NS_LOG_FUNCTION (this << i); |
1083 |
NS_LOG_FUNCTION (this << i); |
| 1084 |
struct TypeId::AttributeInformation info = GetAttribute(i); |
1084 |
struct TypeId::AttributeInformation info = GetAttribute(i); |
| 1085 |
return GetName () + "::" + info.name; |
1085 |
return GetName () + "::" + info.name; |
| 1086 |
} |
1086 |
} |
| 1087 |
|
1087 |
|
| 1088 |
uint32_t |
1088 |
std::size_t |
| 1089 |
TypeId::GetTraceSourceN (void) const |
1089 |
TypeId::GetTraceSourceN (void) const |
| 1090 |
{ |
1090 |
{ |
| 1091 |
NS_LOG_FUNCTION (this); |
1091 |
NS_LOG_FUNCTION (this); |
| 1092 |
return IidManager::Get ()->GetTraceSourceN (m_tid); |
1092 |
return IidManager::Get ()->GetTraceSourceN (m_tid); |
| 1093 |
} |
1093 |
} |
| 1094 |
struct TypeId::TraceSourceInformation |
1094 |
struct TypeId::TraceSourceInformation |
| 1095 |
TypeId::GetTraceSource(uint32_t i) const |
1095 |
TypeId::GetTraceSource(std::size_t i) const |
| 1096 |
{ |
1096 |
{ |
| 1097 |
NS_LOG_FUNCTION (this << i); |
1097 |
NS_LOG_FUNCTION (this << i); |
| 1098 |
return IidManager::Get ()->GetTraceSource(m_tid, i); |
1098 |
return IidManager::Get ()->GetTraceSource(m_tid, i); |
|
|
| 1141 |
struct TypeId::TraceSourceInformation tmp; |
1141 |
struct TypeId::TraceSourceInformation tmp; |
| 1142 |
do { |
1142 |
do { |
| 1143 |
tid = nextTid; |
1143 |
tid = nextTid; |
| 1144 |
for (uint32_t i = 0; i < tid.GetTraceSourceN (); i++) |
1144 |
for (std::size_t i = 0; i < tid.GetTraceSourceN (); i++) |
| 1145 |
{ |
1145 |
{ |
| 1146 |
tmp = tid.GetTraceSource (i); |
1146 |
tmp = tid.GetTraceSource (i); |
| 1147 |
if (tmp.name == name) |
1147 |
if (tmp.name == name) |