blob: e5809ebe360f78ffdc9d03a1bb4e9ec2c381a611 [file] [log] [blame]
Junxiao Shi7860d482014-02-21 23:57:20 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (C) 2014 Named Data Networking Project
4 * See COPYING for copyright and distribution information.
5 */
6
7#ifndef NFD_FACE_FACE_COUNTER_HPP
8#define NFD_FACE_FACE_COUNTER_HPP
9
10#include "common.hpp"
11
12namespace nfd {
13
14/** \class FaceCounter
15 * \brief represents a counter on face
16 */
17typedef uint64_t FaceCounter;
18
19
20/** \brief contains counters on face
21 */
22class FaceCounters
23{
24public:
25 FaceCounters();
26
27 /// incoming Interest (total packets since Face establishment)
28 const FaceCounter&
29 getInInterest() const;
30
31 FaceCounter&
32 getInInterest();
33
34 /// incoming Data (total packets since Face establishment)
35 const FaceCounter&
36 getInData() const;
37
38 FaceCounter&
39 getInData();
40
41 /// outgoing Interest (total packets since Face establishment)
42 const FaceCounter&
43 getOutInterest() const;
44
45 FaceCounter&
46 getOutInterest();
47
48 /// outgoing Data (total packets since Face establishment)
49 const FaceCounter&
50 getOutData() const;
51
52 FaceCounter&
53 getOutData();
54
55private:
56 FaceCounter m_inInterest;
57 FaceCounter m_inData;
58 FaceCounter m_outInterest;
59 FaceCounter m_outData;
60};
61
62
63inline const FaceCounter&
64FaceCounters::getInInterest() const
65{
66 return m_inInterest;
67}
68
69inline FaceCounter&
70FaceCounters::getInInterest()
71{
72 return m_inInterest;
73}
74
75inline const FaceCounter&
76FaceCounters::getInData() const
77{
78 return m_inData;
79}
80
81inline FaceCounter&
82FaceCounters::getInData()
83{
84 return m_inData;
85}
86
87inline const FaceCounter&
88FaceCounters::getOutInterest() const
89{
90 return m_outInterest;
91}
92
93inline FaceCounter&
94FaceCounters::getOutInterest()
95{
96 return m_outInterest;
97}
98
99inline const FaceCounter&
100FaceCounters::getOutData() const
101{
102 return m_outData;
103}
104
105inline FaceCounter&
106FaceCounters::getOutData()
107{
108 return m_outData;
109}
110
111
112} // namespace nfd
113
114#endif // NFD_FACE_FACE_COUNTER_HPP