TraceContextElement::Register -> TraceContextElement::AllocateUid
This commit is contained in:
@@ -128,7 +128,7 @@ public:
|
||||
SUBRESOLVER,
|
||||
};
|
||||
static uint16_t GetUid (void)
|
||||
{static uint16_t uid = Register<TraceSourceTest> ("TraceSourceTest"); return uid;}
|
||||
{static uint16_t uid = AllocateUid<TraceSourceTest> ("TraceSourceTest"); return uid;}
|
||||
void Print (std::ostream &os)
|
||||
{os << "tracesource=";
|
||||
if (m_sources == DOUBLEA) {os << "doubleA";}
|
||||
@@ -150,7 +150,7 @@ public:
|
||||
INT,
|
||||
};
|
||||
static uint16_t GetUid (void)
|
||||
{static uint16_t uid = Register<SubTraceSourceTest> ("SubTraceSourceTest"); return uid;}
|
||||
{static uint16_t uid = AllocateUid<SubTraceSourceTest> ("SubTraceSourceTest"); return uid;}
|
||||
void Print (std::ostream &os)
|
||||
{os << "subtracesource=int";}
|
||||
SubTraceSourceTest () : m_sources (SubTraceSourceTest::INT) {}
|
||||
|
||||
@@ -20,7 +20,7 @@ class TraceContextElement
|
||||
{
|
||||
protected:
|
||||
template <typename T>
|
||||
static uint16_t Register (std::string name);
|
||||
static uint16_t AllocateUid (std::string name);
|
||||
};
|
||||
|
||||
} // namespace ns3
|
||||
@@ -35,7 +35,7 @@ class ElementRegistry
|
||||
{
|
||||
public:
|
||||
template <typename T>
|
||||
static uint16_t Register (std::string name);
|
||||
static uint16_t AllocateUid (std::string name);
|
||||
|
||||
static uint32_t GetSize (uint16_t uid);
|
||||
static void Print (uint16_t uid, uint8_t *instance, std::ostream &os);
|
||||
@@ -78,7 +78,7 @@ ElementRegistry::DoDestroy (uint8_t *instance)
|
||||
|
||||
template <typename T>
|
||||
uint16_t
|
||||
ElementRegistry::Register (std::string name)
|
||||
ElementRegistry::AllocateUid (std::string name)
|
||||
{
|
||||
InfoVector *vec = GetInfoVector ();
|
||||
uint16_t uid = 1;
|
||||
@@ -103,9 +103,9 @@ ElementRegistry::Register (std::string name)
|
||||
|
||||
template <typename T>
|
||||
uint16_t
|
||||
TraceContextElement::Register (std::string name)
|
||||
TraceContextElement::AllocateUid (std::string name)
|
||||
{
|
||||
return ElementRegistry::Register<T> (name);
|
||||
return ElementRegistry::AllocateUid<T> (name);
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -242,7 +242,7 @@ template <int N>
|
||||
class Ctx : public TraceContextElement
|
||||
{
|
||||
public:
|
||||
static uint16_t GetUid (void) {static uint16_t uid = Register<Ctx<N> > (GetName ()); return uid;}
|
||||
static uint16_t GetUid (void) {static uint16_t uid = AllocateUid<Ctx<N> > (GetName ()); return uid;}
|
||||
static std::string GetName (void) {std::ostringstream oss; oss << "Ctx" << N; return oss.str ();}
|
||||
Ctx () : m_v (0) {}
|
||||
Ctx (int v) : m_v (v) {}
|
||||
|
||||
@@ -56,7 +56,7 @@ CsmaCdTraceType::Print (std::ostream &os) const
|
||||
uint16_t
|
||||
CsmaCdTraceType::GetUid (void)
|
||||
{
|
||||
static uint16_t uid = Register<CsmaCdTraceType> ("CsmaCdTraceType");
|
||||
static uint16_t uid = AllocateUid<CsmaCdTraceType> ("CsmaCdTraceType");
|
||||
return uid;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ PointToPointTraceType::Print (std::ostream &os) const
|
||||
uint16_t
|
||||
PointToPointTraceType::GetUid (void)
|
||||
{
|
||||
static uint16_t uid = Register<PointToPointTraceType> ("PointToPointTraceType");
|
||||
static uint16_t uid = AllocateUid<PointToPointTraceType> ("PointToPointTraceType");
|
||||
return uid;
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ Ipv4L3ProtocolTraceContextElement::Print (std::ostream &os) const
|
||||
uint16_t
|
||||
Ipv4L3ProtocolTraceContextElement::GetUid (void)
|
||||
{
|
||||
static uint16_t uid = Register<Ipv4L3ProtocolTraceContextElement> ("Ipv4L3ProtocolTraceContextElement");
|
||||
static uint16_t uid = AllocateUid<Ipv4L3ProtocolTraceContextElement> ("Ipv4L3ProtocolTraceContextElement");
|
||||
return uid;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ Ipv4l3ProtocolInterfaceIndex::Print (std::ostream &os) const
|
||||
uint16_t
|
||||
Ipv4l3ProtocolInterfaceIndex::GetUid (void)
|
||||
{
|
||||
static uint16_t uid = Register<Ipv4l3ProtocolInterfaceIndex> ("Ipv4l3ProtocolInterfaceIndex");
|
||||
static uint16_t uid = AllocateUid<Ipv4l3ProtocolInterfaceIndex> ("Ipv4l3ProtocolInterfaceIndex");
|
||||
return uid;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ Ipv4L4ProtocolTraceContextElement::Print (std::ostream &os) const
|
||||
uint16_t
|
||||
Ipv4L4ProtocolTraceContextElement::GetUid (void)
|
||||
{
|
||||
static uint16_t uid = Register<Ipv4L4ProtocolTraceContextElement> ("Ipv4L4ProtocolTraceContextElement");
|
||||
static uint16_t uid = AllocateUid<Ipv4L4ProtocolTraceContextElement> ("Ipv4L4ProtocolTraceContextElement");
|
||||
return uid;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ NodeListIndex::Print (std::ostream &os)
|
||||
uint16_t
|
||||
NodeListIndex::GetUid (void)
|
||||
{
|
||||
static uint16_t uid = Register<NodeListIndex> ("NodeListIndex");
|
||||
static uint16_t uid = AllocateUid<NodeListIndex> ("NodeListIndex");
|
||||
return uid;
|
||||
}
|
||||
uint32_t
|
||||
|
||||
@@ -50,7 +50,7 @@ NodeNetDeviceIndex::Print (std::ostream &os) const
|
||||
uint16_t
|
||||
NodeNetDeviceIndex::GetUid (void)
|
||||
{
|
||||
static uint16_t uid = Register<NodeNetDeviceIndex> ("NodeNetDeviceIndex");
|
||||
static uint16_t uid = AllocateUid<NodeNetDeviceIndex> ("NodeNetDeviceIndex");
|
||||
return uid;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ static ClassIdDefaultValue g_classIdDefaultValue ("Queue", "Packet Queue",
|
||||
uint16_t
|
||||
QueueTraceType::GetUid (void)
|
||||
{
|
||||
static uint16_t uid = Register<QueueTraceType> ("QueueTraceType");
|
||||
static uint16_t uid = AllocateUid<QueueTraceType> ("QueueTraceType");
|
||||
return uid;
|
||||
}
|
||||
QueueTraceType::QueueTraceType ()
|
||||
|
||||
Reference in New Issue
Block a user