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>

Public Member Functions

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

Private Attributes

Types::Core::DateAndTime m_begin
 begin More...
 
Types::Core::DateAndTime m_end
 end More...
 

Friends

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

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/2]

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

Default constructor.

Definition at line 28 of file DateAndTime.h.

Referenced by intersection().

◆ TimeInterval() [2/2]

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

Member Function Documentation

◆ begin()

Types::Core::DateAndTime Mantid::Kernel::TimeInterval::begin ( ) const
inline

◆ begin_str()

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

String representation of the begin time.

Definition at line 52 of file DateAndTime.cpp.

References m_begin.

◆ contains()

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

True if the interval contains t.

Definition at line 42 of file DateAndTime.h.

◆ end()

Types::Core::DateAndTime Mantid::Kernel::TimeInterval::end ( ) const
inline

◆ end_str()

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

String representation of the end time.

Definition at line 55 of file DateAndTime.cpp.

References m_end.

◆ 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 36 of file DateAndTime.cpp.

References begin(), end(), isValid(), and TimeInterval().

Referenced by Mantid::Kernel::LogFilter::addFilter().

◆ isValid()

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

True if the interval is not empty.

Definition at line 36 of file DateAndTime.h.

Referenced by Mantid::Kernel::LogFilter::addFilter(), and intersection().

◆ length()

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

Interval length (in seconds?)

Definition at line 39 of file DateAndTime.h.

Referenced by Mantid::Kernel::timeMean().

◆ operator<()

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

Returns true if this interval ends before ti starts.

Definition at line 46 of file DateAndTime.h.

References begin().

Friends And Related Function Documentation

◆ operator<<

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

Stream output operator

Definition at line 57 of file DateAndTime.cpp.

Member Data Documentation

◆ m_begin

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

begin

Definition at line 57 of file DateAndTime.h.

Referenced by begin_str().

◆ m_end

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

end

Definition at line 59 of file DateAndTime.h.

Referenced by end_str(), and TimeInterval().


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