diff --git a/src/core/object.h b/src/core/object.h index df3332ce6..d869fd54a 100644 --- a/src/core/object.h +++ b/src/core/object.h @@ -25,16 +25,13 @@ #include #include #include "ptr.h" -#include "callback.h" #include "attribute.h" #include "object-base.h" -#include "attribute-helper.h" #include "attribute-list.h" namespace ns3 { -class CallbackBase; class Object; class AttributeAccessor; class AttributeValue; @@ -172,32 +169,6 @@ private: namespace ns3 { -/************************************************************************* - * The TypeId implementation which depends on templates - *************************************************************************/ - -template -TypeId -TypeId::SetParent (void) -{ - return SetParent (T::GetTypeId ()); -} - -template -TypeId -TypeId::AddConstructor (void) -{ - struct Maker { - static ObjectBase * Create () { - ObjectBase * base = new T (); - return base; - } - }; - Callback cb = MakeCallback (&Maker::Create); - DoAddConstructor (cb); - return *this; -} - /************************************************************************* * The Object implementation which depends on templates *************************************************************************/ diff --git a/src/core/type-id.h b/src/core/type-id.h index f1550c892..4a4ffe8da 100644 --- a/src/core/type-id.h +++ b/src/core/type-id.h @@ -289,4 +289,34 @@ ATTRIBUTE_HELPER_HEADER_2 (TypeId); } // namespace ns3 +namespace ns3 { + +/************************************************************************* + * The TypeId implementation which depends on templates + *************************************************************************/ + +template +TypeId +TypeId::SetParent (void) +{ + return SetParent (T::GetTypeId ()); +} + +template +TypeId +TypeId::AddConstructor (void) +{ + struct Maker { + static ObjectBase * Create () { + ObjectBase * base = new T (); + return base; + } + }; + Callback cb = MakeCallback (&Maker::Create); + DoAddConstructor (cb); + return *this; +} + +} // namespace ns3 + #endif /* TYPE_ID_H */