FNSS C++ library
C++ API for the Fast Network Simulation Setup (FNSS) toolchain
 All Classes Functions Typedefs Pages
traffic-matrix.h
1 #ifndef TRAFFIC_MATRIX_H
2 #define TRAFFIC_MATRIX_H
3 
4 #include "quantity.h"
5 
6 #include <string>
7 #include <set>
8 #include <map>
9 #include <utility>
10 
11 namespace fnss {
12 
20 public:
26 unsigned int size() const;
27 
37 Quantity getFlow(const std::string &source, const std::string &destination) const;
38 
47 Quantity getFlow(const std::pair<std::string, std::string> &nodes) const;
48 
56 void setFlow(const std::string &source, const std::string &destination,
57  const Quantity &volume);
58 
65 void setFlow(const std::pair<std::string, std::string> &nodes, const Quantity &volume);
66 
74 std::set<std::pair<std::string, std::string> > getPairs() const;
75 
76 private:
80  typedef std::pair<std::string, std::string> matrixKeyType;
81  typedef std::map<matrixKeyType, Quantity> matrixType;
82  matrixType matrix;
83 };
84 
85 } //namespace
86 
87 #endif //TRAFFIC_MATRIX_H
void setFlow(const std::string &source, const std::string &destination, const Quantity &volume)
Definition: traffic-matrix.cpp:24
Quantity getFlow(const std::string &source, const std::string &destination) const
Definition: traffic-matrix.cpp:11
std::set< std::pair< std::string, std::string > > getPairs() const
Definition: traffic-matrix.cpp:41
unsigned int size() const
Definition: traffic-matrix.cpp:7
Definition: traffic-matrix.h:19
Definition: quantity.h:16