FNSS C++ library
C++ API for the Fast Network Simulation Setup (FNSS) toolchain
|
#include <traffic-matrix-sequence.h>
Classes | |
class | IndexOutOfBoundsException |
Public Member Functions | |
TrafficMatrixSequence (const Quantity &interval_=Quantity("1s", Units::Time)) | |
Quantity | getInterval () const |
void | setInterval (const Quantity &interval_) |
unsigned int | size () const |
void | addMatrix (const TrafficMatrix &matrix) |
void | addMatrix (const TrafficMatrix &matrix, unsigned int index) |
void | removeMatrix (unsigned int index) |
TrafficMatrix | getMatrix (unsigned int index) const |
Represent a sequence of traffic matrices, containing traffic matrices referring to a sequence of time intervals.
fnss::TrafficMatrixSequence::TrafficMatrixSequence | ( | const Quantity & | interval_ = Quantity("1s", Units::Time) | ) |
Constructor.
interval | the time interval between traffic matrices. |
void fnss::TrafficMatrixSequence::addMatrix | ( | const TrafficMatrix & | matrix | ) |
Add a TrafficMatrix
to the end of the sequence.
matrix | the TrafficMatrix to add. |
void fnss::TrafficMatrixSequence::addMatrix | ( | const TrafficMatrix & | matrix, |
unsigned int | index | ||
) |
Add a TrafficMatrix
at the specified index.
If the index exceeds already defined matrices, the sequence is resized to accommodate the new required size.
matrix | the TrafficMatrix to add. |
index | the position in the sequence. |
Quantity fnss::TrafficMatrixSequence::getInterval | ( | ) | const |
Get the time interval between traffic matrices.
TrafficMatrix fnss::TrafficMatrixSequence::getMatrix | ( | unsigned int | index | ) | const |
Get a copy of the TrafficMatrix
at the specified index.
Throws an exception if the index is out-of-bounds.
index | the position in the sequence. |
void fnss::TrafficMatrixSequence::removeMatrix | ( | unsigned int | index | ) |
Remove the TrafficMatrix
at the specified index.
Throws an exception if the index is out-of-bounds. Does not change the sequence index of already existing matrices.
index | the position in the sequence. |
void fnss::TrafficMatrixSequence::setInterval | ( | const Quantity & | interval_ | ) |
Set the time interval between traffic matrices.
interval | the time interval between traffic matrices. |
unsigned int fnss::TrafficMatrixSequence::size | ( | ) | const |
The size of the sequence.
TrafficMatrix
objects in the sequence.