22 #ifndef CCNX_CS_TRACER_H 
   23 #define CCNX_CS_TRACER_H 
   26 #include "ns3/simple-ref-count.h" 
   27 #include <ns3/nstime.h> 
   28 #include <ns3/event-id.h> 
   29 #include <ns3/node-container.h> 
   31 #include <boost/tuple/tuple.hpp> 
   32 #include <boost/shared_ptr.hpp> 
   46 typedef Interest InterestHeader;
 
   47 typedef Data DataHeader;
 
   70 class CsTracer : 
public SimpleRefCount<CsTracer>
 
   84   InstallAll (
const std::string &file, Time averagingPeriod = Seconds (0.5));
 
   98   Install (
const NodeContainer &nodes, 
const std::string &file, Time averagingPeriod = Seconds (0.5));
 
  112   Install (Ptr<Node> node, 
const std::string &file, Time averagingPeriod = Seconds (0.5));
 
  125   Install (Ptr<Node> node, boost::shared_ptr<std::ostream> outputStream, Time averagingPeriod = Seconds (0.5));
 
  141   CsTracer (boost::shared_ptr<std::ostream> os, Ptr<Node> node);
 
  148   CsTracer (boost::shared_ptr<std::ostream> os, 
const std::string &node);
 
  169   Print (std::ostream &os) 
const;
 
  176   CacheHits (Ptr<const Interest>, Ptr<const Data>);
 
  179   CacheMisses (Ptr<const Interest>);
 
  183   SetAveragingPeriod (
const Time &period);
 
  195   boost::shared_ptr<std::ostream> m_os;
 
  198   EventId m_printEvent;
 
  206 operator << (std::ostream &os, 
const CsTracer &tracer)
 
  218 #endif // CCNX_CS_TRACER_H 
NDN tracer for cache performance (hits and misses) 
 
void Print(std::ostream &os) const 
Print current trace data. 
 
static void InstallAll(const std::string &file, Time averagingPeriod=Seconds(0.5))
Helper method to install tracers on all simulation nodes. 
 
static void Install(const NodeContainer &nodes, const std::string &file, Time averagingPeriod=Seconds(0.5))
Helper method to install tracers on the selected simulation nodes. 
 
void PrintHeader(std::ostream &os) const 
Print head of the trace (e.g., for post-processing) 
 
static void Destroy()
Explicit request to remove all statically created tracers. 
 
CsTracer(boost::shared_ptr< std::ostream > os, Ptr< Node > node)
Trace constructor that attaches to the node using node pointer.