blob: ad033b483828b57e2a270e059d264ecb16b94ff9 [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);
62
63private:
64 LoadStats m_count;
65 LoadStats m_satisfied;
66 LoadStats m_unsatisfied;
67
68 friend std::ostream &
69 operator << (std::ostream &os, const LoadStatsFace &stats);
70};
71
72inline LoadStats&
73LoadStatsFace::count ()
74{ return m_count; }
75
76inline const LoadStats&
77LoadStatsFace::count () const
78{ return m_count; }
79
80inline LoadStats&
81LoadStatsFace::satisfied ()
82{ return m_satisfied; }
83
84inline const LoadStats&
85LoadStatsFace::satisfied () const
86{ return m_satisfied; }
87
88inline LoadStats&
89LoadStatsFace::unsatisfied ()
90{ return m_unsatisfied; }
91
92inline const LoadStats&
93LoadStatsFace::unsatisfied () const
94{ return m_unsatisfied; }
95
96std::ostream &
97operator << (std::ostream &os, const LoadStatsFace &stats);
98
99}
100
101#endif // LOAD_STATS_FACE_H