|
102 |
Ptr<const AttributeValue> initialValue, |
102 |
Ptr<const AttributeValue> initialValue, |
103 |
Ptr<const AttributeAccessor> spec, |
103 |
Ptr<const AttributeAccessor> spec, |
104 |
Ptr<const AttributeChecker> checker); |
104 |
Ptr<const AttributeChecker> checker); |
|
|
105 |
void AddDeprecatedAttribute (uint16_t uid, const std::string &oldName, |
106 |
const std::string &oldClass, const std::string &msg); |
105 |
void SetAttributeInitialValue(uint16_t uid, |
107 |
void SetAttributeInitialValue(uint16_t uid, |
106 |
uint32_t i, |
108 |
uint32_t i, |
107 |
Ptr<const AttributeValue> initialValue); |
109 |
Ptr<const AttributeValue> initialValue); |
108 |
uint32_t GetAttributeN (uint16_t uid) const; |
110 |
uint32_t GetAttributeN (uint16_t uid) const; |
|
|
111 |
uint32_t GetDeprecatedAttributeN (uint16_t uid) const; |
109 |
struct TypeId::AttributeInformation GetAttribute(uint16_t uid, uint32_t i) const; |
112 |
struct TypeId::AttributeInformation GetAttribute(uint16_t uid, uint32_t i) const; |
|
|
113 |
struct TypeId::DeprecatedAttributeInformation GetDeprecatedAttribute (uint16_t uid, |
114 |
uint32_t i) const; |
110 |
void AddTraceSource (uint16_t uid, |
115 |
void AddTraceSource (uint16_t uid, |
111 |
std::string name, |
116 |
std::string name, |
112 |
std::string help, |
117 |
std::string help, |
113 |
Ptr<const TraceSourceAccessor> accessor, |
118 |
Ptr<const TraceSourceAccessor> accessor, |
114 |
std::string callback); |
119 |
std::string callback); |
|
|
120 |
void AddDeprecatedTraceSource(uint16_t uid, const std::string &oldName, |
121 |
const std::string &oldClass, const std::string &msg); |
115 |
uint32_t GetTraceSourceN (uint16_t uid) const; |
122 |
uint32_t GetTraceSourceN (uint16_t uid) const; |
|
|
123 |
uint32_t GetDeprecatedTraceSourceN (uint16_t uid) const; |
116 |
struct TypeId::TraceSourceInformation GetTraceSource(uint16_t uid, uint32_t i) const; |
124 |
struct TypeId::TraceSourceInformation GetTraceSource(uint16_t uid, uint32_t i) const; |
|
|
125 |
struct TypeId::DeprecatedTraceSourceInformation GetDeprecatedTraceSource (uint16_t uid, |
126 |
uint32_t i) const; |
117 |
bool MustHideFromDocumentation (uint16_t uid) const; |
127 |
bool MustHideFromDocumentation (uint16_t uid) const; |
118 |
|
128 |
|
119 |
private: |
129 |
private: |
|
131 |
Callback<ObjectBase *> constructor; |
141 |
Callback<ObjectBase *> constructor; |
132 |
bool mustHideFromDocumentation; |
142 |
bool mustHideFromDocumentation; |
133 |
std::vector<struct TypeId::AttributeInformation> attributes; |
143 |
std::vector<struct TypeId::AttributeInformation> attributes; |
|
|
144 |
std::vector<struct TypeId::DeprecatedAttributeInformation> deprecatedAttributes; |
134 |
std::vector<struct TypeId::TraceSourceInformation> traceSources; |
145 |
std::vector<struct TypeId::TraceSourceInformation> traceSources; |
|
|
146 |
std::vector<struct TypeId::DeprecatedTraceSourceInformation> deprecatedTraceSources; |
135 |
}; |
147 |
}; |
136 |
typedef std::vector<struct IidInformation>::const_iterator Iterator; |
148 |
typedef std::vector<struct IidInformation>::const_iterator Iterator; |
137 |
|
149 |
|
Lines 436-441
IidManager::AddAttribute (uint16_t uid,
|
Link Here
|
---|
|
436 |
info.checker = checker; |
448 |
info.checker = checker; |
437 |
information->attributes.push_back (info); |
449 |
information->attributes.push_back (info); |
438 |
} |
450 |
} |
|
|
451 |
|
452 |
void |
453 |
IidManager::AddDeprecatedAttribute(uint16_t uid, const std::string &oldName, |
454 |
const std::string &oldClass, const std::string &msg) |
455 |
{ |
456 |
NS_LOG_FUNCTION (this << oldName << oldClass); |
457 |
struct IidInformation *information = LookupInformation (uid); |
458 |
struct TypeId::DeprecatedAttributeInformation info; |
459 |
info.oldName = oldName; |
460 |
info.oldClass = oldClass; |
461 |
info.msg = msg; |
462 |
information->deprecatedAttributes.push_back (info); |
463 |
} |
464 |
|
439 |
void |
465 |
void |
440 |
IidManager::SetAttributeInitialValue(uint16_t uid, |
466 |
IidManager::SetAttributeInitialValue(uint16_t uid, |
441 |
uint32_t i, |
467 |
uint32_t i, |
Lines 447-454
IidManager::SetAttributeInitialValue(uint16_t uid,
|
Link Here
|
---|
|
447 |
information->attributes[i].initialValue = initialValue; |
473 |
information->attributes[i].initialValue = initialValue; |
448 |
} |
474 |
} |
449 |
|
475 |
|
450 |
|
|
|
451 |
|
452 |
uint32_t |
476 |
uint32_t |
453 |
IidManager::GetAttributeN (uint16_t uid) const |
477 |
IidManager::GetAttributeN (uint16_t uid) const |
454 |
{ |
478 |
{ |
Lines 456-461
IidManager::GetAttributeN (uint16_t uid) const
|
Link Here
|
---|
|
456 |
struct IidInformation *information = LookupInformation (uid); |
480 |
struct IidInformation *information = LookupInformation (uid); |
457 |
return information->attributes.size (); |
481 |
return information->attributes.size (); |
458 |
} |
482 |
} |
|
|
483 |
|
484 |
uint32_t |
485 |
IidManager::GetDeprecatedAttributeN (uint16_t uid) const |
486 |
{ |
487 |
NS_LOG_FUNCTION (this << uid); |
488 |
struct IidInformation *information = LookupInformation (uid); |
489 |
return information->deprecatedAttributes.size (); |
490 |
} |
491 |
|
459 |
struct TypeId::AttributeInformation |
492 |
struct TypeId::AttributeInformation |
460 |
IidManager::GetAttribute(uint16_t uid, uint32_t i) const |
493 |
IidManager::GetAttribute(uint16_t uid, uint32_t i) const |
461 |
{ |
494 |
{ |
Lines 465-470
IidManager::GetAttribute(uint16_t uid, uint32_t i) const
|
Link Here
|
---|
|
465 |
return information->attributes[i]; |
498 |
return information->attributes[i]; |
466 |
} |
499 |
} |
467 |
|
500 |
|
|
|
501 |
struct TypeId::DeprecatedAttributeInformation |
502 |
IidManager::GetDeprecatedAttribute (uint16_t uid, uint32_t i) const |
503 |
{ |
504 |
NS_LOG_FUNCTION (this << uid << i); |
505 |
struct IidInformation *information = LookupInformation (uid); |
506 |
NS_ASSERT (i < information->deprecatedAttributes.size ()); |
507 |
return information->deprecatedAttributes[i]; |
508 |
} |
509 |
|
468 |
bool |
510 |
bool |
469 |
IidManager::HasTraceSource (uint16_t uid, |
511 |
IidManager::HasTraceSource (uint16_t uid, |
470 |
std::string name) |
512 |
std::string name) |
Lines 514-519
IidManager::AddTraceSource (uint16_t uid,
|
Link Here
|
---|
|
514 |
source.callback = callback; |
556 |
source.callback = callback; |
515 |
information->traceSources.push_back (source); |
557 |
information->traceSources.push_back (source); |
516 |
} |
558 |
} |
|
|
559 |
|
560 |
void |
561 |
IidManager::AddDeprecatedTraceSource (uint16_t uid, const std::string &oldName, |
562 |
const std::string &oldClass, const std::string &msg) |
563 |
{ |
564 |
NS_LOG_FUNCTION (this << uid << oldName << oldClass); |
565 |
struct IidInformation *information = LookupInformation (uid); |
566 |
struct TypeId::DeprecatedTraceSourceInformation source; |
567 |
source.oldName = oldName; |
568 |
source.oldClass = oldClass; |
569 |
source.msg = msg; |
570 |
information->deprecatedTraceSources.push_back (source); |
571 |
} |
572 |
|
517 |
uint32_t |
573 |
uint32_t |
518 |
IidManager::GetTraceSourceN (uint16_t uid) const |
574 |
IidManager::GetTraceSourceN (uint16_t uid) const |
519 |
{ |
575 |
{ |
Lines 521-526
IidManager::GetTraceSourceN (uint16_t uid) const
|
Link Here
|
---|
|
521 |
struct IidInformation *information = LookupInformation (uid); |
577 |
struct IidInformation *information = LookupInformation (uid); |
522 |
return information->traceSources.size (); |
578 |
return information->traceSources.size (); |
523 |
} |
579 |
} |
|
|
580 |
|
581 |
uint32_t |
582 |
IidManager::GetDeprecatedTraceSourceN (uint16_t uid) const |
583 |
{ |
584 |
NS_LOG_FUNCTION (this << uid); |
585 |
struct IidInformation *information = LookupInformation (uid); |
586 |
return information->deprecatedTraceSources.size (); |
587 |
} |
588 |
|
524 |
struct TypeId::TraceSourceInformation |
589 |
struct TypeId::TraceSourceInformation |
525 |
IidManager::GetTraceSource(uint16_t uid, uint32_t i) const |
590 |
IidManager::GetTraceSource(uint16_t uid, uint32_t i) const |
526 |
{ |
591 |
{ |
Lines 529-534
IidManager::GetTraceSource(uint16_t uid, uint32_t i) const
|
Link Here
|
---|
|
529 |
NS_ASSERT (i < information->traceSources.size ()); |
594 |
NS_ASSERT (i < information->traceSources.size ()); |
530 |
return information->traceSources[i]; |
595 |
return information->traceSources[i]; |
531 |
} |
596 |
} |
|
|
597 |
|
598 |
struct TypeId::DeprecatedTraceSourceInformation |
599 |
IidManager::GetDeprecatedTraceSource(uint16_t uid, uint32_t i) const |
600 |
{ |
601 |
NS_LOG_FUNCTION (this << uid << i); |
602 |
struct IidInformation *information = LookupInformation (uid); |
603 |
NS_ASSERT (i < information->deprecatedTraceSources.size ()); |
604 |
return information->deprecatedTraceSources[i]; |
605 |
} |
606 |
|
532 |
bool |
607 |
bool |
533 |
IidManager::MustHideFromDocumentation (uint16_t uid) const |
608 |
IidManager::MustHideFromDocumentation (uint16_t uid) const |
534 |
{ |
609 |
{ |
Lines 631-636
TypeId::LookupAttributeByName (std::string name, struct TypeId::AttributeInforma
|
Link Here
|
---|
|
631 |
} |
706 |
} |
632 |
nextTid = tid.GetParent (); |
707 |
nextTid = tid.GetParent (); |
633 |
} while (nextTid != tid); |
708 |
} while (nextTid != tid); |
|
|
709 |
|
710 |
nextTid = *this; |
711 |
do { |
712 |
tid = nextTid; |
713 |
for (uint32_t i = 0; i < tid.GetDeprecatedAttributeN (); ++i) |
714 |
{ |
715 |
struct TypeId::DeprecatedAttributeInformation tmp = tid.GetDeprecatedAttribute (i); |
716 |
if (tmp.oldName == name) |
717 |
{ |
718 |
NS_LOG_UNCOND ("ATTENTION: Deprecated attribute " << name << |
719 |
" in class " << tmp.oldClass << "." << tmp.msg); |
720 |
return false; |
721 |
} |
722 |
} |
723 |
nextTid = tid.GetParent (); |
724 |
} while (nextTid != tid); |
725 |
|
634 |
return false; |
726 |
return false; |
635 |
} |
727 |
} |
636 |
|
728 |
|
Lines 750-755
TypeId::AddAttribute (std::string name,
|
Link Here
|
---|
|
750 |
return *this; |
842 |
return *this; |
751 |
} |
843 |
} |
752 |
|
844 |
|
|
|
845 |
TypeId |
846 |
TypeId::DeprecateAttribute (const std::string &oldName, const std::string &oldClass, |
847 |
const std::string &msg) |
848 |
{ |
849 |
Singleton<IidManager>::Get ()->AddDeprecatedAttribute (m_tid, oldName, oldClass, msg); |
850 |
return *this; |
851 |
} |
852 |
|
853 |
TypeId |
854 |
TypeId::DeprecateTraceSource (const std::string &oldName, const std::string &oldClass, |
855 |
const std::string &msg) |
856 |
{ |
857 |
Singleton<IidManager>::Get ()->AddDeprecatedTraceSource (m_tid, oldName, oldClass, msg); |
858 |
return *this; |
859 |
} |
860 |
|
753 |
bool |
861 |
bool |
754 |
TypeId::SetAttributeInitialValue(uint32_t i, |
862 |
TypeId::SetAttributeInitialValue(uint32_t i, |
755 |
Ptr<const AttributeValue> initialValue) |
863 |
Ptr<const AttributeValue> initialValue) |
Lines 783-794
TypeId::GetAttributeN (void) const
|
Link Here
|
---|
|
783 |
uint32_t n = Singleton<IidManager>::Get ()->GetAttributeN (m_tid); |
891 |
uint32_t n = Singleton<IidManager>::Get ()->GetAttributeN (m_tid); |
784 |
return n; |
892 |
return n; |
785 |
} |
893 |
} |
|
|
894 |
|
895 |
uint32_t |
896 |
TypeId::GetDeprecatedAttributeN (void) const |
897 |
{ |
898 |
NS_LOG_FUNCTION (this); |
899 |
uint32_t n = Singleton<IidManager>::Get ()->GetDeprecatedAttributeN (m_tid); |
900 |
return n; |
901 |
} |
786 |
struct TypeId::AttributeInformation |
902 |
struct TypeId::AttributeInformation |
787 |
TypeId::GetAttribute(uint32_t i) const |
903 |
TypeId::GetAttribute(uint32_t i) const |
788 |
{ |
904 |
{ |
789 |
NS_LOG_FUNCTION (this << i); |
905 |
NS_LOG_FUNCTION (this << i); |
790 |
return Singleton<IidManager>::Get ()->GetAttribute(m_tid, i); |
906 |
return Singleton<IidManager>::Get ()->GetAttribute(m_tid, i); |
791 |
} |
907 |
} |
|
|
908 |
|
909 |
struct TypeId::DeprecatedAttributeInformation |
910 |
TypeId::GetDeprecatedAttribute (uint32_t i) const |
911 |
{ |
912 |
NS_LOG_FUNCTION (this << i); |
913 |
return Singleton<IidManager>::Get ()->GetDeprecatedAttribute (m_tid, i); |
914 |
} |
915 |
|
792 |
std::string |
916 |
std::string |
793 |
TypeId::GetAttributeFullName (uint32_t i) const |
917 |
TypeId::GetAttributeFullName (uint32_t i) const |
794 |
{ |
918 |
{ |
Lines 803-808
TypeId::GetTraceSourceN (void) const
|
Link Here
|
---|
|
803 |
NS_LOG_FUNCTION (this); |
927 |
NS_LOG_FUNCTION (this); |
804 |
return Singleton<IidManager>::Get ()->GetTraceSourceN (m_tid); |
928 |
return Singleton<IidManager>::Get ()->GetTraceSourceN (m_tid); |
805 |
} |
929 |
} |
|
|
930 |
|
931 |
uint32_t |
932 |
TypeId::GetDeprecatedTraceSourceN (void) const |
933 |
{ |
934 |
NS_LOG_FUNCTION (this); |
935 |
return Singleton<IidManager>::Get ()->GetDeprecatedTraceSourceN (m_tid); |
936 |
} |
937 |
|
806 |
struct TypeId::TraceSourceInformation |
938 |
struct TypeId::TraceSourceInformation |
807 |
TypeId::GetTraceSource(uint32_t i) const |
939 |
TypeId::GetTraceSource(uint32_t i) const |
808 |
{ |
940 |
{ |
Lines 810-815
TypeId::GetTraceSource(uint32_t i) const
|
Link Here
|
---|
|
810 |
return Singleton<IidManager>::Get ()->GetTraceSource(m_tid, i); |
942 |
return Singleton<IidManager>::Get ()->GetTraceSource(m_tid, i); |
811 |
} |
943 |
} |
812 |
|
944 |
|
|
|
945 |
struct TypeId::DeprecatedTraceSourceInformation |
946 |
TypeId::GetDeprecatedTraceSource (uint32_t i) const |
947 |
{ |
948 |
NS_LOG_FUNCTION (this << i); |
949 |
return Singleton<IidManager>::Get ()->GetDeprecatedTraceSource (m_tid, i); |
950 |
} |
951 |
|
813 |
TypeId |
952 |
TypeId |
814 |
TypeId::AddTraceSource (std::string name, |
953 |
TypeId::AddTraceSource (std::string name, |
815 |
std::string help, |
954 |
std::string help, |
Lines 856-861
TypeId::LookupTraceSourceByName (std::string name) const
|
Link Here
|
---|
|
856 |
} |
995 |
} |
857 |
nextTid = tid.GetParent (); |
996 |
nextTid = tid.GetParent (); |
858 |
} while (nextTid != tid); |
997 |
} while (nextTid != tid); |
|
|
998 |
|
999 |
nextTid = *this; |
1000 |
do { |
1001 |
tid = nextTid; |
1002 |
for (uint32_t i = 0; i < tid.GetDeprecatedTraceSourceN (); ++i) |
1003 |
{ |
1004 |
struct TypeId::DeprecatedTraceSourceInformation tmp = tid.GetDeprecatedTraceSource (i); |
1005 |
if (tmp.oldName == name) |
1006 |
{ |
1007 |
NS_LOG_UNCOND ("ATTENTION: Deprecated attribute " << name << |
1008 |
" in class " << tmp.oldClass << "." << tmp.msg); |
1009 |
return 0; |
1010 |
} |
1011 |
} |
1012 |
nextTid = tid.GetParent (); |
1013 |
} while (nextTid != tid); |
1014 |
|
859 |
return 0; |
1015 |
return 0; |
860 |
} |
1016 |
} |
861 |
|
1017 |
|