move more code around

This commit is contained in:
Mathieu Lacage
2008-03-17 05:42:20 +01:00
parent 96e4874bdb
commit 218c66592a
2 changed files with 30 additions and 29 deletions

View File

@@ -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
*************************************************************************/

View File

@@ -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 */