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::EventSchedule Class Reference

#include <event-schedule.h>

Classes

class  IndexOutOfBoundsException
 

Public Member Functions

 EventSchedule (const Quantity &startTime_=Quantity("0s", Units::Time), const Quantity &endTime_=Quantity("0s", Units::Time))
 
Quantity getStartTime () const
 
void setStartTime (const Quantity &time)
 
Quantity getEndTime () const
 
void setEndTime (const Quantity &time)
 
unsigned int size () const
 
Event getEvent (unsigned int index) const
 
void addEvent (const Event &event)
 
void removeEvent (unsigned int index)
 

Detailed Description

Represent a schedule of events. Each event is represented by a time and a set of properties.

Author
Cosmin Cocora

Constructor & Destructor Documentation

fnss::EventSchedule::EventSchedule ( const Quantity startTime_ = Quantity("0s", Units::Time),
const Quantity endTime_ = Quantity("0s", Units::Time) 
)

Constructor.

Parameters
startTimethe start time of the schedule.
endTimethe end time of the schedule.

Member Function Documentation

void fnss::EventSchedule::addEvent ( const Event event)

Add an Event to the schedule.

Parameters
eventthe Event to add.
Quantity fnss::EventSchedule::getEndTime ( ) const

Get the end time of the schedule.

Returns
the end time of the schedule.
Event fnss::EventSchedule::getEvent ( unsigned int  index) const

Get a copy of the i-th Event in the schedule.

The events are sorted in ascending order by time. Throws an exception if the index is out-of-bounds.

Parameters
indexthe index of the Event to get.
Returns
a copy of the i-th Event.
Quantity fnss::EventSchedule::getStartTime ( ) const

Get the start time of the schedule.

Returns
the start time of the schedule.
void fnss::EventSchedule::removeEvent ( unsigned int  index)

Remove the i-th Event from the schedule.

The events are sorted in ascending order by time. The method does nothing if the given index is out of bounds.

Parameters
indexthe index of the Event to remove.
void fnss::EventSchedule::setEndTime ( const Quantity time)

Get the end time of the schedule.

Parameters
timethe end time of the schedule.
void fnss::EventSchedule::setStartTime ( const Quantity time)

Get the start time of the schedule.

Parameters
timethe start time of the schedule.
unsigned int fnss::EventSchedule::size ( ) const

Get the number of events present in the schedule.

Returns
the number of events.

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