add application tracing support
This commit is contained in:
@@ -60,6 +60,34 @@ NodeNetDeviceIndex::GetTypeName (void) const
|
||||
}
|
||||
|
||||
|
||||
NodeApplicationIndex::NodeApplicationIndex ()
|
||||
: m_index (0)
|
||||
{}
|
||||
NodeApplicationIndex::NodeApplicationIndex (uint32_t index)
|
||||
: m_index (index)
|
||||
{}
|
||||
uint32_t
|
||||
NodeApplicationIndex::Get (void) const
|
||||
{
|
||||
return m_index;
|
||||
}
|
||||
void
|
||||
NodeApplicationIndex::Print (std::ostream &os) const
|
||||
{
|
||||
os << "device=" << m_index;
|
||||
}
|
||||
uint16_t
|
||||
NodeApplicationIndex::GetUid (void)
|
||||
{
|
||||
static uint16_t uid = AllocateUid<NodeApplicationIndex> ("NodeApplicationIndex");
|
||||
return uid;
|
||||
}
|
||||
std::string
|
||||
NodeApplicationIndex::GetTypeName (void) const
|
||||
{
|
||||
return "ns3::NodeApplicationIndex";
|
||||
}
|
||||
|
||||
|
||||
Node::Node()
|
||||
: m_id(0),
|
||||
@@ -92,6 +120,7 @@ Node::GetTraceResolver (void) const
|
||||
{
|
||||
Ptr<CompositeTraceResolver> resolver = Create<CompositeTraceResolver> ();
|
||||
resolver->AddArray ("devices", m_devices.begin (), m_devices.end (), NodeNetDeviceIndex ());
|
||||
resolver->AddArray ("applications", m_applications.begin (), m_applications.end (), NodeApplicationIndex ());
|
||||
resolver->SetParentResolver (Object::GetTraceResolver ());
|
||||
return resolver;
|
||||
}
|
||||
|
||||
@@ -57,6 +57,25 @@ private:
|
||||
uint32_t m_index;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief hold in a TraceContext the index of an Application within a Node
|
||||
*/
|
||||
class NodeApplicationIndex : public TraceContextElement
|
||||
{
|
||||
public:
|
||||
NodeApplicationIndex ();
|
||||
NodeApplicationIndex (uint32_t index);
|
||||
/**
|
||||
* \returns the index of the Application within its container Node.
|
||||
*/
|
||||
uint32_t Get (void) const;
|
||||
void Print (std::ostream &os) const;
|
||||
std::string GetTypeName (void) const;
|
||||
static uint16_t GetUid (void);
|
||||
private:
|
||||
uint32_t m_index;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief A network Node.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user