# HG changeset patch # User Mathieu Lacage # Date 1197377463 -3600 # Node ID 712afe5037e52cf7d4720dffe2cb12192595dd97 # Parent fdb8cddfcecb4e2cfc5ace4481e6502a6b39e76c add application tracing support diff -r fdb8cddfcecb -r 712afe5037e5 src/node/node.cc --- a/src/node/node.cc Tue Dec 11 13:42:09 2007 +0100 +++ b/src/node/node.cc Tue Dec 11 13:51:03 2007 +0100 @@ -60,6 +60,34 @@ } +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"); + return uid; +} +std::string +NodeApplicationIndex::GetTypeName (void) const +{ + return "ns3::NodeApplicationIndex"; +} + Node::Node() : m_id(0), @@ -92,6 +120,7 @@ { Ptr resolver = Create (); 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; } diff -r fdb8cddfcecb -r 712afe5037e5 src/node/node.h --- a/src/node/node.h Tue Dec 11 13:42:09 2007 +0100 +++ b/src/node/node.h Tue Dec 11 13:51:03 2007 +0100 @@ -58,6 +58,25 @@ }; /** + * \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. * * This class holds together: