FNSS C++ library
C++ API for the Fast Network Simulation Setup (FNSS) toolchain
 All Classes Functions Typedefs Pages
edge.h
1 #ifndef EDGE_H
2 #define EDGE_H
3 
4 #include "quantity.h"
5 #include "units.h"
6 
7 #include <string>
8 
9 namespace fnss {
10 
14 #define DEFAULT_CAPACITY "1Mbps"
15 
19 #define DEFAULT_DELAY "1ms"
20 
24 #define DEFAULT_WEIGHT 1
25 
29 #define DEFAULT_BUFFER_SIZE "100packets"
30 
36 class Edge {
37 public:
41  Edge(const Quantity &capacity_ = Quantity(DEFAULT_CAPACITY, Units::Bandwidth),
42  const Quantity &delay_ = Quantity(DEFAULT_DELAY, Units::Time),
43  const float &weight_ = DEFAULT_WEIGHT,
44  const Quantity &bufferSize_ = Quantity(DEFAULT_BUFFER_SIZE, Units::BufferSize));
45 
51  Quantity getCapacity() const;
52 
58  void setCapacity(const Quantity &capacity_);
59 
65  float getWeight() const;
66 
72  void setWeight(float weight_);
73 
79  Quantity getDelay() const;
80 
86  void setDelay(const Quantity &delay_);
87 
93  Quantity getBufferSize() const;
94 
100  void setBufferSize(const Quantity &bufferSize_);
101 
102 private:
103  Quantity capacity;
104  float weight;
105  Quantity delay;
106  Quantity bufferSize;
107 };
108 
109 } //namespace
110 
111 #endif //EDGE_H
void setBufferSize(const Quantity &bufferSize_)
Definition: edge.cpp:38
void setWeight(float weight_)
Definition: edge.cpp:22
void setDelay(const Quantity &delay_)
Definition: edge.cpp:30
Quantity getDelay() const
Definition: edge.cpp:26
void setCapacity(const Quantity &capacity_)
Definition: edge.cpp:14
Edge(const Quantity &capacity_=Quantity(DEFAULT_CAPACITY, Units::Bandwidth), const Quantity &delay_=Quantity(DEFAULT_DELAY, Units::Time), const float &weight_=DEFAULT_WEIGHT, const Quantity &bufferSize_=Quantity(DEFAULT_BUFFER_SIZE, Units::BufferSize))
Definition: edge.cpp:5
float getWeight() const
Definition: edge.cpp:18
Definition: edge.h:36
Quantity getBufferSize() const
Definition: edge.cpp:34
Quantity getCapacity() const
Definition: edge.cpp:10
Definition: quantity.h:16