5% cpu optimization

This commit is contained in:
Mathieu Lacage
2008-11-19 14:19:10 +01:00
parent b6939441cd
commit 37d6b2a697
2 changed files with 17 additions and 8 deletions

View File

@@ -365,10 +365,6 @@ namespace ns3 {
* The TypeId class
*********************************************************************/
TypeId::TypeId ()
: m_tid (0)
{}
TypeId::TypeId (const char *name)
{
uint16_t uid = Singleton<IidManager>::Get ()->AllocateUid (name);
@@ -380,8 +376,6 @@ TypeId::TypeId (const char *name)
TypeId::TypeId (uint16_t tid)
: m_tid (tid)
{}
TypeId::~TypeId ()
{}
TypeId
TypeId::LookupByName (std::string name)
{

View File

@@ -351,8 +351,10 @@ public:
void SetUid (uint16_t tid);
// construct an invalid TypeId.
TypeId ();
~TypeId ();
inline TypeId ();
inline TypeId (const TypeId &o);
inline TypeId &operator = (const TypeId &o);
inline ~TypeId ();
private:
friend class AttributeList;
@@ -393,6 +395,19 @@ ATTRIBUTE_HELPER_HEADER (TypeId);
namespace ns3 {
TypeId::TypeId ()
: m_tid (0) {}
TypeId::TypeId (const TypeId &o)
: m_tid (o.m_tid) {}
TypeId &TypeId::operator = (const TypeId &o)
{
m_tid = o.m_tid;
return *this;
}
TypeId::~TypeId ()
{}
/*************************************************************************
* The TypeId implementation which depends on templates
*************************************************************************/