blob: 6c85a68b4186552e0f0552263b3c69684a6fd345 [file] [log] [blame]
Alexander Afanasyev0845c092012-07-13 17:45:33 -07001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2011 University of California, Los Angeles
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 LOAD_STATS_FACE_H
22#define LOAD_STATS_FACE_H
23
24#include "load-stats.h"
25
26namespace ndnSIM
27{
28
29class LoadStatsFace
30{
31public:
32 void
33 Step ();
34
35 inline LoadStats&
36 count ();
37
38 inline const LoadStats&
39 count () const;
40
41 inline LoadStats&
42 satisfied ();
43
44 inline const LoadStats&
45 satisfied () const;
46
47 inline LoadStats&
48 unsatisfied ();
49
50 inline const LoadStats&
51 unsatisfied () const;
52
53 //
54 LoadStats::stats_tuple
55 GetSatisfiedRatio () const;
56
57 LoadStats::stats_tuple
58 GetUnsatisfiedRatio () const;
59
60 LoadStatsFace &
61 operator += (const LoadStatsFace &load);
Alexander Afanasyev0560eec2012-07-16 15:44:31 -070062
63 bool
64 IsZero () const;
Alexander Afanasyev0845c092012-07-13 17:45:33 -070065
66private:
67 LoadStats m_count;
68 LoadStats m_satisfied;
69 LoadStats m_unsatisfied;
70
71 friend std::ostream &
72 operator << (std::ostream &os, const LoadStatsFace &stats);
73};
74
75inline LoadStats&
76LoadStatsFace::count ()
77{ return m_count; }
78
79inline const LoadStats&
80LoadStatsFace::count () const
81{ return m_count; }
82
83inline LoadStats&
84LoadStatsFace::satisfied ()
85{ return m_satisfied; }
86
87inline const LoadStats&
88LoadStatsFace::satisfied () const
89{ return m_satisfied; }
90
91inline LoadStats&
92LoadStatsFace::unsatisfied ()
93{ return m_unsatisfied; }
94
95inline const LoadStats&
96LoadStatsFace::unsatisfied () const
97{ return m_unsatisfied; }
98
99std::ostream &
100operator << (std::ostream &os, const LoadStatsFace &stats);
101
102}
103
104#endif // LOAD_STATS_FACE_H