blob: b178ee1e071f1fdb5292f95491d60b84b242ceda [file] [log] [blame]
Alexander Afanasyeve4c2ece2012-01-11 10:44:40 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2012 UCLA
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19 */
20
21#ifndef CCNX_CONSUMER_WINDOW_TRACER_H
22#define CCNX_CONSUMER_WINDOW_TRACER_H
23
24#include "ns3/ptr.h"
25#include "ns3/simple-ref-count.h"
26
27namespace ns3 {
28
29class Node;
30
31class CcnxConsumerWindowTracer : public SimpleRefCount<CcnxConsumerWindowTracer>
32{
33public:
34 CcnxConsumerWindowTracer (std::ostream &os, Ptr<Node> node, const std::string &appId = "*");
35 virtual ~CcnxConsumerWindowTracer () { };
36
37 void
38 Connect ();
39
40 virtual void
41 PrintHeader (std::ostream &os) const;
42
43 virtual void
44 Print (std::ostream &os) const;
45
46 virtual void
47 OnWindowChange (std::string context,
48 uint32_t oldValue, uint32_t newValue);
49
50protected:
51 std::string m_appId;
52 std::string m_node;
53 Ptr<Node> m_nodePtr;
54 std::ostream& m_os;
55};
56
57inline std::ostream&
58operator << (std::ostream &os, const CcnxConsumerWindowTracer &tracer)
59{
60 os << "# ";
61 tracer.PrintHeader (os);
62 os << "\n";
63 tracer.Print (os);
64 return os;
65}
66
67} // namespace ns3
68
69#endif // CCNX_CONSUMER_WINDOW_TRACER_H