move more code around
This commit is contained in:
@@ -25,16 +25,13 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#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 <typename T>
|
||||
TypeId
|
||||
TypeId::SetParent (void)
|
||||
{
|
||||
return SetParent (T::GetTypeId ());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
TypeId
|
||||
TypeId::AddConstructor (void)
|
||||
{
|
||||
struct Maker {
|
||||
static ObjectBase * Create () {
|
||||
ObjectBase * base = new T ();
|
||||
return base;
|
||||
}
|
||||
};
|
||||
Callback<ObjectBase *> cb = MakeCallback (&Maker::Create);
|
||||
DoAddConstructor (cb);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* The Object implementation which depends on templates
|
||||
*************************************************************************/
|
||||
|
||||
@@ -289,4 +289,34 @@ ATTRIBUTE_HELPER_HEADER_2 (TypeId);
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/*************************************************************************
|
||||
* The TypeId implementation which depends on templates
|
||||
*************************************************************************/
|
||||
|
||||
template <typename T>
|
||||
TypeId
|
||||
TypeId::SetParent (void)
|
||||
{
|
||||
return SetParent (T::GetTypeId ());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
TypeId
|
||||
TypeId::AddConstructor (void)
|
||||
{
|
||||
struct Maker {
|
||||
static ObjectBase * Create () {
|
||||
ObjectBase * base = new T ();
|
||||
return base;
|
||||
}
|
||||
};
|
||||
Callback<ObjectBase *> cb = MakeCallback (&Maker::Create);
|
||||
DoAddConstructor (cb);
|
||||
return *this;
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
#endif /* TYPE_ID_H */
|
||||
|
||||
Reference in New Issue
Block a user