diff --git a/src/core/examples/main-ptr.cc b/src/core/examples/main-ptr.cc index 7c2ae07db..c39f437e1 100644 --- a/src/core/examples/main-ptr.cc +++ b/src/core/examples/main-ptr.cc @@ -26,6 +26,12 @@ using namespace ns3; class PtrExample : public Object { public: + /** + * @brief Get the type ID. + * @return the object TypeId + */ + static TypeId GetTypeId(); + /** Constructor. */ PtrExample(); /** Destructor. */ @@ -34,6 +40,16 @@ class PtrExample : public Object void Method(); }; +NS_OBJECT_ENSURE_REGISTERED(PtrExample); + +TypeId +PtrExample::GetTypeId() +{ + static TypeId tid = + TypeId("ns3::PtrExample").SetParent().SetGroupName("Core").HideFromDocumentation(); + return tid; +} + PtrExample::PtrExample() { std::cout << "PtrExample constructor" << std::endl; diff --git a/src/internet/model/ipv6-autoconfigured-prefix.cc b/src/internet/model/ipv6-autoconfigured-prefix.cc index 2a9f3ca4b..20a19cb78 100644 --- a/src/internet/model/ipv6-autoconfigured-prefix.cc +++ b/src/internet/model/ipv6-autoconfigured-prefix.cc @@ -18,8 +18,18 @@ namespace ns3 NS_LOG_COMPONENT_DEFINE("Ipv6AutoconfiguredPrefix"); +NS_OBJECT_ENSURE_REGISTERED(Ipv6AutoconfiguredPrefix); + uint32_t Ipv6AutoconfiguredPrefix::m_prefixId = 0; +TypeId +Ipv6AutoconfiguredPrefix::GetTypeId() +{ + static TypeId tid = + TypeId("ns3::Ipv6AutoconfiguredPrefix").SetParent().SetGroupName("Internet"); + return tid; +} + Ipv6AutoconfiguredPrefix::Ipv6AutoconfiguredPrefix(Ptr node, uint32_t interface, Ipv6Address prefix, diff --git a/src/internet/model/ipv6-autoconfigured-prefix.h b/src/internet/model/ipv6-autoconfigured-prefix.h index 169fb1910..5ecfceb36 100644 --- a/src/internet/model/ipv6-autoconfigured-prefix.h +++ b/src/internet/model/ipv6-autoconfigured-prefix.h @@ -29,6 +29,12 @@ class Node; class Ipv6AutoconfiguredPrefix : public Object { public: + /** + * @brief Get the type ID. + * @return the object TypeId + */ + static TypeId GetTypeId(); + /** * @brief Constructor. * @param node node diff --git a/src/test/traced/traced-callback-typedef-test-suite.cc b/src/test/traced/traced-callback-typedef-test-suite.cc index e84ceae2d..6b56563b7 100644 --- a/src/test/traced/traced-callback-typedef-test-suite.cc +++ b/src/test/traced/traced-callback-typedef-test-suite.cc @@ -53,6 +53,16 @@ using namespace ns3; class TracedCallbackTypedefTestCase : public TestCase { public: + /// @return the TypeId for the callback checkers + static TypeId GetCheckerTypeId() + { + static TypeId tid = TypeId("ns3::TracedCallbackTypedefTestCaseChecker") + .SetParent() + .SetGroupName("Test") + .HideFromDocumentation(); + return tid; + } + TracedCallbackTypedefTestCase(); ~TracedCallbackTypedefTestCase() override @@ -268,6 +278,12 @@ class TracedCallbackTypedefTestCase::Checker : public Object TracedCallback m_cb; public: + /// @return the TypeId for this checker + static TypeId GetTypeId() + { + return TracedCallbackTypedefTestCase::GetCheckerTypeId(); + } + Checker() { }