FNSS C++ library
C++ API for the Fast Network Simulation Setup (FNSS) toolchain
 All Classes Functions Typedefs Pages
Classes | Public Member Functions | List of all members
fnss::TrafficMatrixSequence Class Reference

#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
 

Detailed Description

Represent a sequence of traffic matrices, containing traffic matrices referring to a sequence of time intervals.

Author
Cosmin Cocora

Constructor & Destructor Documentation

fnss::TrafficMatrixSequence::TrafficMatrixSequence ( const Quantity interval_ = Quantity("1s", Units::Time))

Constructor.

Parameters
intervalthe time interval between traffic matrices.

Member Function Documentation

void fnss::TrafficMatrixSequence::addMatrix ( const TrafficMatrix matrix)

Add a TrafficMatrix to the end of the sequence.

Parameters
matrixthe 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.

Parameters
matrixthe TrafficMatrix to add.
indexthe position in the sequence.
Quantity fnss::TrafficMatrixSequence::getInterval ( ) const

Get the time interval between traffic matrices.

Returns
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.

Parameters
indexthe 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.

Parameters
indexthe position in the sequence.
void fnss::TrafficMatrixSequence::setInterval ( const Quantity interval_)

Set the time interval between traffic matrices.

Parameters
intervalthe time interval between traffic matrices.
unsigned int fnss::TrafficMatrixSequence::size ( ) const

The size of the sequence.

Returns
the number of TrafficMatrix objects in the sequence.

The documentation for this class was generated from the following files: