WSF
wsf::coverage::AccessInterval Class Reference

#include <WsfCoverageAccessInterval.hpp>

Public Member Functions

 AccessInterval ()=default
 AccessInterval (double aStart, double aEnd)
 AccessInterval (const AccessInterval &aOther)=default
AccessIntervaloperator= (const AccessInterval &aOther)=default
double GetStart () const
 Return the start time of the interval.
double GetEnd () const
 Return the end time of the interval.
double GetDuration () const
 Get the duration of the interval.
bool IsValid () const
 Returns true if this interval have a non-negative duration.
bool HasStart () const
 Returns true if this interval has a non-negative start time.
bool HasEnd () const
 Returns true if this interval has a non-negative end time.
void SetStart (double aSimTime)
 Set the start time to the given aSimTime.
void SetEnd (double aSimTime)
 Set the end time to the given aSimTime.
bool operator== (const AccessInterval &aOther) const
bool operator!= (const AccessInterval &aOther) const
 Negated equality operator.
bool HasOverlapWith (const AccessInterval &aOther) const
 Predicate to determine if this interval overlaps the given aOther.
AccessInterval UnionWith (const AccessInterval &aOther) const
AccessInterval IntersectionWith (const AccessInterval &aOther) const
bool Contains (double aSimTime) const
 Return true if the given aSimTime is inside this interval.

Detailed Description

Representation of the simulation times during which an access occurs.

This object uses simulation time to mark the bounds of the interval, so a negative start or end time is invalid, and is used to indicate that those values have not been set.

Constructor & Destructor Documentation

◆ AccessInterval() [1/3]

wsf::coverage::AccessInterval::AccessInterval ( )
default

◆ AccessInterval() [2/3]

wsf::coverage::AccessInterval::AccessInterval ( double aStart,
double aEnd )
inline

◆ AccessInterval() [3/3]

wsf::coverage::AccessInterval::AccessInterval ( const AccessInterval & aOther)
default

References AccessInterval().

Member Function Documentation

◆ Contains()

bool wsf::coverage::AccessInterval::Contains ( double aSimTime) const

Return true if the given aSimTime is inside this interval.

◆ GetDuration()

double wsf::coverage::AccessInterval::GetDuration ( ) const
inline

Get the duration of the interval.

Referenced by wsf::coverage::AccumulateIntervalDurations().

◆ GetEnd()

double wsf::coverage::AccessInterval::GetEnd ( ) const
inline

◆ GetStart()

double wsf::coverage::AccessInterval::GetStart ( ) const
inline

◆ HasEnd()

bool wsf::coverage::AccessInterval::HasEnd ( ) const
inline

Returns true if this interval has a non-negative end time.

◆ HasOverlapWith()

bool wsf::coverage::AccessInterval::HasOverlapWith ( const AccessInterval & aOther) const

Predicate to determine if this interval overlaps the given aOther.

References AccessInterval(), GetEnd(), and GetStart().

Referenced by IntersectionWith(), and UnionWith().

◆ HasStart()

bool wsf::coverage::AccessInterval::HasStart ( ) const
inline

Returns true if this interval has a non-negative start time.

◆ IntersectionWith()

AccessInterval wsf::coverage::AccessInterval::IntersectionWith ( const AccessInterval & aOther) const

Return the intersection of this interval with the given aOther.

If the given aOther interval does not overalap with this interval, then this will return an invalid interval.

References AccessInterval(), GetEnd(), GetStart(), HasOverlapWith(), SetEnd(), and SetStart().

◆ IsValid()

bool wsf::coverage::AccessInterval::IsValid ( ) const
inline

Returns true if this interval have a non-negative duration.

◆ operator!=()

bool wsf::coverage::AccessInterval::operator!= ( const AccessInterval & aOther) const
inline

Negated equality operator.

References AccessInterval().

◆ operator=()

AccessInterval & wsf::coverage::AccessInterval::operator= ( const AccessInterval & aOther)
default

References AccessInterval().

◆ operator==()

bool wsf::coverage::AccessInterval::operator== ( const AccessInterval & aOther) const

Equality operator.

Intervals are equal if their start and end points are the same.

References AccessInterval().

◆ SetEnd()

void wsf::coverage::AccessInterval::SetEnd ( double aSimTime)
inline

Set the end time to the given aSimTime.

Referenced by IntersectionWith(), and UnionWith().

◆ SetStart()

void wsf::coverage::AccessInterval::SetStart ( double aSimTime)
inline

Set the start time to the given aSimTime.

Referenced by IntersectionWith(), and UnionWith().

◆ UnionWith()

AccessInterval wsf::coverage::AccessInterval::UnionWith ( const AccessInterval & aOther) const

Return the union of this interval with the given aOther.

If the given aOther interval does not overalap with this interval, then this will return an invalid interval.

References AccessInterval(), GetEnd(), GetStart(), HasOverlapWith(), SetEnd(), and SetStart().


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved