Sequence Chart Studio  svn HEAD revision
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | Private Attributes | Friends | List of all members
MscTimeInterval< T > Class Template Reference

class representing Interval More...

#include <time.h>

Collaboration diagram for MscTimeInterval< T >:
Collaboration graph

Public Member Functions

 MscTimeInterval ()
 
 MscTimeInterval (T value)
 
 MscTimeInterval (T left_value, T right_value)
 
 MscTimeInterval (const bool &left_closed, const T &left_value, const T &right_value, const bool &right_closed)
 
 MscTimeInterval (const MscIntervalCouple< T > &begin, const MscIntervalCouple< T > &end)
 
 MscTimeInterval (const std::string &interval) throw (MscIntervalStringConversionError)
 
void assign (const std::string &interval) throw (MscIntervalStringConversionError)
 
const MscIntervalCouple< T > & get_begin () const
 
get_begin_value () const
 
const bool & get_begin_closed () const
 
const MscIntervalCouple< T > & get_end () const
 
get_end_value () const
 
const bool & get_end_closed () const
 
void set (T left_value, T right_value)
 
void set (bool &left, T &b, T &e, bool &right)
 
void set_begin (const MscIntervalCouple< T > begin)
 
void set_begin_closed (const bool &b)
 
void set_end (const MscIntervalCouple< T > end)
 
void set_end_closed (const bool &b)
 
MscTimeIntervaloperator= (const T &value)
 
MscTimeIntervaloperator= (const MscTimeInterval &right)
 
const MscTimeInterval operator+ (const MscTimeInterval &right) const
 
const MscTimeInterval operator+ (const T &value) const
 
const MscTimeInterval operator- (const MscTimeInterval &right) const
 
const MscTimeInterval operator- (const T &value) const
 
const MscTimeInterval operator* (const T &value) const
 
bool operator== (const MscTimeInterval &right) const
 
bool operator!= (const MscTimeInterval &right) const
 
bool includes (const T &value) const
 
bool is_valid () const
 tests if the interval is valid Tests beginning and ending value More...
 
bool is_empty () const
 tests the interval for emptiness Tests beginning and ending value More...
 
void set_empty ()
 
void set_infinity ()
 
bool is_infinity () const
 
bool is_upper_bound_infinity ()
 checks whether the upper bound of time interval is infinity More...
 
std::string to_string ()
 prints interval to the string More...
 

Static Public Member Functions

static MscTimeInterval interval_inverse (const MscTimeInterval &inter)
 
static MscTimeInterval interval_intersection (const MscTimeInterval &left, const MscTimeInterval &right)
 intersection of two intervals More...
 
static MscTimeInterval interval_union (const MscTimeInterval &left, const MscTimeInterval &right)
 union of two interval More...
 
static MscTimeInterval components_max (const MscTimeInterval &left, const MscTimeInterval &right)
 return max(begins) and max(ends) Interval Takes two itervals (a,b) (c,d) and returns Inerval(max(a,c),max(b,d)) More...
 

Private Attributes

MscIntervalCouple< T > m_begin
 
MscIntervalCouple< T > m_end
 

Friends

std::ostream & operator<< (std::ostream &os, const MscTimeInterval< T > &interval)
 

Detailed Description

template<class T>
class MscTimeInterval< T >

class representing Interval

Definition at line 493 of file time.h.

Constructor & Destructor Documentation

template<class T>
MscTimeInterval< T >::MscTimeInterval ( )
inline
template<class T>
MscTimeInterval< T >::MscTimeInterval ( value)
inline

Definition at line 503 of file time.h.

template<class T>
MscTimeInterval< T >::MscTimeInterval ( left_value,
right_value 
)
inline

Definition at line 507 of file time.h.

template<class T>
MscTimeInterval< T >::MscTimeInterval ( const bool &  left_closed,
const T &  left_value,
const T &  right_value,
const bool &  right_closed 
)
inline

Definition at line 513 of file time.h.

template<class T>
MscTimeInterval< T >::MscTimeInterval ( const MscIntervalCouple< T > &  begin,
const MscIntervalCouple< T > &  end 
)
inline

Definition at line 518 of file time.h.

template<class T>
MscTimeInterval< T >::MscTimeInterval ( const std::string interval)
throw (MscIntervalStringConversionError
)
inline

Definition at line 524 of file time.h.

References MscTimeInterval< T >::assign().

Member Function Documentation

template<class T>
void MscTimeInterval< T >::assign ( const std::string interval)
throw (MscIntervalStringConversionError
)
inline
template<class T>
static MscTimeInterval MscTimeInterval< T >::components_max ( const MscTimeInterval< T > &  left,
const MscTimeInterval< T > &  right 
)
inlinestatic

return max(begins) and max(ends) Interval Takes two itervals (a,b) (c,d) and returns Inerval(max(a,c),max(b,d))

Definition at line 916 of file time.h.

References MscTimeInterval< T >::m_begin, MscTimeInterval< T >::m_end, and MscTimeInterval< T >::MscTimeInterval().

Referenced by MscTimeIntervalSet< double >::components_max().

template<class T>
const MscIntervalCouple<T>& MscTimeInterval< T >::get_begin ( ) const
inline

Definition at line 602 of file time.h.

References MscTimeInterval< T >::m_begin.

Referenced by MscTimeIntervalSet< double >::insert(), and set_absolute_endpoint().

template<class T>
const bool& MscTimeInterval< T >::get_begin_closed ( ) const
inline
template<class T>
T MscTimeInterval< T >::get_begin_value ( ) const
inline
template<class T>
const MscIntervalCouple<T>& MscTimeInterval< T >::get_end ( ) const
inline

Definition at line 618 of file time.h.

References MscTimeInterval< T >::m_end.

Referenced by MscTimeIntervalSet< double >::insert(), and set_absolute_endpoint().

template<class T>
const bool& MscTimeInterval< T >::get_end_closed ( ) const
inline
template<class T>
T MscTimeInterval< T >::get_end_value ( ) const
inline
template<class T>
bool MscTimeInterval< T >::includes ( const T &  value) const
inline

Definition at line 726 of file time.h.

template<class T>
static MscTimeInterval MscTimeInterval< T >::interval_intersection ( const MscTimeInterval< T > &  left,
const MscTimeInterval< T > &  right 
)
inlinestatic

intersection of two intervals

Returns
intersection of two intervals
Warning
returned interval has to be valid, is_valid() may return false, CHECK FOR VALIDITY

Definition at line 849 of file time.h.

References MscTimeInterval< T >::m_begin, MscTimeInterval< T >::m_end, and MscTimeInterval< T >::MscTimeInterval().

Referenced by P3C::directional_path_consistency(), MscTimeInterval< T >::interval_union(), MscTimeIntervalSet< double >::set_intersection(), P3C::tight(), and FloydWarshall::tight().

template<class T>
static MscTimeInterval MscTimeInterval< T >::interval_inverse ( const MscTimeInterval< T > &  inter)
inlinestatic
template<class T>
static MscTimeInterval MscTimeInterval< T >::interval_union ( const MscTimeInterval< T > &  left,
const MscTimeInterval< T > &  right 
)
inlinestatic

union of two interval

Returns
intersection of two intervals if they have intersection, else return empty interval;
Warning
CHECK if the returned interval is not empty!!!

Definition at line 880 of file time.h.

References MscTimeInterval< T >::interval_intersection(), MscTimeInterval< T >::is_valid(), MscTimeInterval< T >::m_begin, MscTimeInterval< T >::m_end, MscTimeInterval< T >::MscTimeInterval(), and MscTimeInterval< T >::set_empty().

template<class T>
bool MscTimeInterval< T >::is_empty ( ) const
inline

tests the interval for emptiness Tests beginning and ending value

  • beginning value < ending value: interval not empty
  • beginning value == ending value and bothe ends are closed interval not empty
  • this method assumes that there are correct brackets if infty is used it is sufficient to use this method after intersection of two valid intervals
Returns
true if the interval is empty

Definition at line 799 of file time.h.

References MscTimeInterval< T >::m_begin, and MscTimeInterval< T >::m_end.

template<class T>
bool MscTimeInterval< T >::is_infinity ( ) const
inline

Definition at line 822 of file time.h.

References MscTimeInterval< T >::m_begin, and MscTimeInterval< T >::m_end.

template<class T>
bool MscTimeInterval< T >::is_upper_bound_infinity ( )
inline

checks whether the upper bound of time interval is infinity

Returns
true if the upper bound of time interval is infinity, false otherwise

Definition at line 832 of file time.h.

References MscTimeInterval< T >::m_end.

Referenced by HMscConsistencyChecker::check().

template<class T>
bool MscTimeInterval< T >::is_valid ( ) const
inline

tests if the interval is valid Tests beginning and ending value

  • beginning value > ending value: invalid interval
  • beginning value < ending value: valid interval
  • MscIntervalException (begin == end, brackets difference) cases: (4,4], [4,4) interval is not valid in both cases.
  • beginning value == ending value, brackets are same cases: (4,4) - not valid [4,4] - valid interval
    Returns
    true if the interval is valid

Definition at line 755 of file time.h.

References MscTimeInterval< T >::m_begin, and MscTimeInterval< T >::m_end.

Referenced by MscTimeInterval< T >::assign(), MscTimeIntervalSet< double >::components_max(), MscTimeInterval< T >::interval_union(), and MscTimeIntervalSet< double >::set_intersection().

template<class T>
bool MscTimeInterval< T >::operator!= ( const MscTimeInterval< T > &  right) const
inline

Definition at line 721 of file time.h.

References MscTimeInterval< T >::m_begin, and MscTimeInterval< T >::m_end.

template<class T>
const MscTimeInterval MscTimeInterval< T >::operator* ( const T &  value) const
inline
template<class T>
const MscTimeInterval MscTimeInterval< T >::operator+ ( const MscTimeInterval< T > &  right) const
inline
template<class T>
const MscTimeInterval MscTimeInterval< T >::operator+ ( const T &  value) const
inline
template<class T>
const MscTimeInterval MscTimeInterval< T >::operator- ( const MscTimeInterval< T > &  right) const
inline
Warning
: inteval minus (a,b) - (c,d) = (a-d, b-c)

Definition at line 699 of file time.h.

References MscTimeInterval< T >::m_begin, MscTimeInterval< T >::m_end, and MscTimeInterval< T >::MscTimeInterval().

template<class T>
const MscTimeInterval MscTimeInterval< T >::operator- ( const T &  value) const
inline
template<class T>
MscTimeInterval& MscTimeInterval< T >::operator= ( const T &  value)
inline

Definition at line 667 of file time.h.

References MscTimeInterval< T >::m_begin, and MscTimeInterval< T >::m_end.

template<class T>
MscTimeInterval& MscTimeInterval< T >::operator= ( const MscTimeInterval< T > &  right)
inline

Definition at line 674 of file time.h.

References MscTimeInterval< T >::m_begin, and MscTimeInterval< T >::m_end.

template<class T>
bool MscTimeInterval< T >::operator== ( const MscTimeInterval< T > &  right) const
inline

Definition at line 714 of file time.h.

References MscTimeInterval< T >::m_begin, and MscTimeInterval< T >::m_end.

template<class T>
void MscTimeInterval< T >::set ( left_value,
right_value 
)
inline

Definition at line 633 of file time.h.

References MscTimeInterval< T >::m_begin, and MscTimeInterval< T >::m_end.

Referenced by MscTimeInterval< T >::set_empty().

template<class T>
void MscTimeInterval< T >::set ( bool &  left,
T &  b,
T &  e,
bool &  right 
)
inline

Definition at line 639 of file time.h.

References MscTimeInterval< T >::m_begin, and MscTimeInterval< T >::m_end.

template<class T>
void MscTimeInterval< T >::set_begin ( const MscIntervalCouple< T >  begin)
inline

Definition at line 647 of file time.h.

References MscTimeInterval< T >::m_begin.

Referenced by MscTimeIntervalSet< double >::insert().

template<class T>
void MscTimeInterval< T >::set_begin_closed ( const bool &  b)
inline

Definition at line 652 of file time.h.

References MscTimeInterval< T >::m_begin.

Referenced by MscTimeIntervalSet< double >::insert().

template<class T>
void MscTimeInterval< T >::set_empty ( )
inline

Definition at line 809 of file time.h.

References MscTimeInterval< T >::set().

Referenced by MscTimeInterval< T >::interval_union().

template<class T>
void MscTimeInterval< T >::set_end ( const MscIntervalCouple< T >  end)
inline

Definition at line 657 of file time.h.

References MscTimeInterval< T >::m_end.

Referenced by MscTimeIntervalSet< double >::insert().

template<class T>
void MscTimeInterval< T >::set_end_closed ( const bool &  b)
inline

Definition at line 662 of file time.h.

References MscTimeInterval< T >::m_end.

Referenced by MscTimeIntervalSet< double >::insert().

template<class T>
void MscTimeInterval< T >::set_infinity ( )
inline
template<class T>
std::string MscTimeInterval< T >::to_string ( )
inline

prints interval to the string

Returns
interval string

Definition at line 948 of file time.h.

Referenced by MscTimeInterval< T >::assign().

Friends And Related Function Documentation

template<class T>
std::ostream& operator<< ( std::ostream &  os,
const MscTimeInterval< T > &  interval 
)
friend

Definition at line 956 of file time.h.

Member Data Documentation

template<class T>
MscIntervalCouple<T> MscTimeInterval< T >::m_begin
private
template<class T>
MscIntervalCouple<T> MscTimeInterval< T >::m_end
private

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

SourceForge.net Logo
Generated on Fri Jan 15 2016 16:26:59 for Sequence Chart Studio by  doxygen