Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Friends | List of all members
Mantid::Kernel::TimeInterval Class Reference

Represents a time interval. More...

#include <DateAndTime.h>

Inheritance diagram for Mantid::Kernel::TimeInterval:
Mantid::Kernel::SplittingInterval

Public Member Functions

std::string begin_str () const
 String representation of the begin time.
 
bool contains (const Types::Core::DateAndTime &t) const
 True if the interval contains t.
 
double duration () const
 in seconds
 
std::string end_str () const
 String representation of the end time.
 
TimeInterval intersection (const TimeInterval &ti) const
 Returns an intersection of two intervals.
 
bool isValid () const
 True if the interval is not empty.
 
Types::Core::time_duration length () const
 Interval length (in seconds?)
 
bool operator< (const TimeInterval &ti) const
 Returns true if this interval ends before ti starts.
 
bool operator== (const TimeInterval &ti) const
 
bool operator> (const TimeInterval &ti) const
 
bool overlaps (const TimeInterval &other) const
 Return true if the SplittingInterval overlaps with this one.
 
bool overlaps (const TimeInterval *other) const
 Return true if the SplittingInterval overlaps with this one.
 
const Types::Core::DateAndTime & start () const
 Beginning of the interval.
 
const Types::Core::DateAndTime & stop () const
 End of the interval.
 
 TimeInterval ()
 Default constructor.
 
 TimeInterval (const std::string &from, const std::string &to)
 
 TimeInterval (const Types::Core::DateAndTime &from, const Types::Core::DateAndTime &to)
 Constructor.
 

Private Attributes

Types::Core::DateAndTime m_start
 begin
 
Types::Core::DateAndTime m_stop
 end
 

Friends

MANTID_KERNEL_DLL std::ostream & operator<< (std::ostream &s, const Mantid::Kernel::TimeInterval &t)
 Stream output operator

 

Detailed Description

Represents a time interval.

Author
Roman Tolchenov, Tessella plc,
Date
25/03/2009

Definition at line 25 of file DateAndTime.h.

Constructor & Destructor Documentation

◆ TimeInterval() [1/3]

Mantid::Kernel::TimeInterval::TimeInterval ( )
inline

Default constructor.

Definition at line 28 of file DateAndTime.h.

Referenced by intersection().

◆ TimeInterval() [2/3]

Mantid::Kernel::TimeInterval::TimeInterval ( const Types::Core::DateAndTime &  from,
const Types::Core::DateAndTime &  to 
)

Constructor.

Definition at line 24 of file DateAndTime.cpp.

References m_stop.

◆ TimeInterval() [3/3]

Mantid::Kernel::TimeInterval::TimeInterval ( const std::string &  from,
const std::string &  to 
)

Definition at line 31 of file DateAndTime.cpp.

References m_start, and m_stop.

Member Function Documentation

◆ begin_str()

std::string Mantid::Kernel::TimeInterval::begin_str ( ) const

String representation of the begin time.

Definition at line 93 of file DateAndTime.cpp.

References m_start.

Referenced by Mantid::Kernel::SplittingInterval::debugStrPrint().

◆ contains()

bool Mantid::Kernel::TimeInterval::contains ( const Types::Core::DateAndTime &  t) const
inline

True if the interval contains t.

Definition at line 46 of file DateAndTime.h.

◆ duration()

double Mantid::Kernel::TimeInterval::duration ( ) const

in seconds

Definition at line 88 of file DateAndTime.cpp.

References length().

◆ end_str()

std::string Mantid::Kernel::TimeInterval::end_str ( ) const

String representation of the end time.

Definition at line 96 of file DateAndTime.cpp.

References m_stop.

Referenced by Mantid::Kernel::SplittingInterval::debugStrPrint().

◆ intersection()

TimeInterval Mantid::Kernel::TimeInterval::intersection ( const TimeInterval ti) const

Returns an intersection of two intervals.

Returns an intersection of this interval with ti.

Parameters
ti:: Time interval
Returns
A valid time interval if this interval intersects with ti or an empty interval otherwise.

Definition at line 59 of file DateAndTime.cpp.

References isValid(), start(), stop(), and TimeInterval().

Referenced by Mantid::Kernel::TimeROI::addMask().

◆ isValid()

bool Mantid::Kernel::TimeInterval::isValid ( ) const
inline

True if the interval is not empty.

Definition at line 38 of file DateAndTime.h.

Referenced by intersection().

◆ length()

Types::Core::time_duration Mantid::Kernel::TimeInterval::length ( ) const

Interval length (in seconds?)

Definition at line 86 of file DateAndTime.cpp.

References m_start, and m_stop.

Referenced by duration().

◆ operator<()

bool Mantid::Kernel::TimeInterval::operator< ( const TimeInterval ti) const

Returns true if this interval ends before ti starts.

Definition at line 69 of file DateAndTime.cpp.

References start(), and stop().

◆ operator==()

bool Mantid::Kernel::TimeInterval::operator== ( const TimeInterval ti) const

Definition at line 90 of file DateAndTime.cpp.

References start(), and stop().

◆ operator>()

bool Mantid::Kernel::TimeInterval::operator> ( const TimeInterval ti) const

Definition at line 77 of file DateAndTime.cpp.

References start(), and stop().

◆ overlaps() [1/2]

bool Mantid::Kernel::TimeInterval::overlaps ( const TimeInterval other) const

Return true if the SplittingInterval overlaps with this one.

Definition at line 52 of file DateAndTime.cpp.

References overlaps().

◆ overlaps() [2/2]

bool Mantid::Kernel::TimeInterval::overlaps ( const TimeInterval other) const

Return true if the SplittingInterval overlaps with this one.

Definition at line 42 of file DateAndTime.cpp.

References start(), and stop().

Referenced by Mantid::Kernel::SplittingInterval::operator|(), and overlaps().

◆ start()

const Types::Core::DateAndTime & Mantid::Kernel::TimeInterval::start ( ) const
inline

◆ stop()

const Types::Core::DateAndTime & Mantid::Kernel::TimeInterval::stop ( ) const
inline

Friends And Related Symbol Documentation

◆ operator<<

MANTID_KERNEL_DLL std::ostream & operator<< ( std::ostream &  s,
const Mantid::Kernel::TimeInterval t 
)
friend

Stream output operator

Definition at line 98 of file DateAndTime.cpp.

Member Data Documentation

◆ m_start

Types::Core::DateAndTime Mantid::Kernel::TimeInterval::m_start
private

begin

Definition at line 68 of file DateAndTime.h.

Referenced by begin_str(), length(), and TimeInterval().

◆ m_stop

Types::Core::DateAndTime Mantid::Kernel::TimeInterval::m_stop
private

end

Definition at line 70 of file DateAndTime.h.

Referenced by end_str(), length(), TimeInterval(), and TimeInterval().


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