| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
TeTimeInterval Class Reference

This class provides a set of functions for manipulating date and time intervals. More...

`#include <TeTimeInterval.h>`

List of all members.

## Public Member Functions

void | now (void)
| Set the date and time from the system clock.
| TeTimeInterval (void)
| Empty constructor.
| TeTimeInterval (TeTime &t1, TeTime &t2)
| Set all time information from the system clock.
| TeTimeInterval (const TeTimeInterval &t)
| Copy constructor.
| TeTimeInterval (const std::string &t1, const std::string &t2, TeChronon chronon=TeSECOND, const std::string &mask="YYYYsMMsDDsHHsmmsSS", const std::string &dateS="/", const std::string &timeS=":", const std::string &indPM="PM")
| Set date and time from arguments, though the time fields defaults to zero.
| TeTimeInterval (const std::string &t1, TeChronon chronon=TeSECOND, const std::string &mask="YYYYsMMsDDsHHsmmsSS", int delta=0, int numsteps=1)
| Set date and time from arguments, though the time fields defaults to zero.
TeChronon | intervalChronon ()
| Returns the chronon of the interval.
void | intervalChronon (TeChronon c)
| Sets the chronon of the interval.
std::string | getInitialTime ()
| Return a time of day std::string in format "hh:mm:ss".
std::string | getFinalTime ()
| Return a time of day std::string in format "hh:mm:ss".
std::string | getInitialDate (void)
| Return a std::string to the date in the form "yyyy-mm-dd".
std::string | getFinalDate (void)
| Return a std::string to the date in the form "yyyy-mm-dd".
TeTime & | getT1 (void)
| Return the time t1_.
TeTime & | getT2 (void)
| Return the time t2_.
std::string | getInitialDateTime (const std::string &mask="YYYYsMMsDDsHHsmmsSS", const std::string &dateS="/", const std::string &timeS=":", const std::string &indPM="PM", const std::string &indAM="AM")
| Return a pointer to the date and time in the form passed in mask.
std::string | getFinalDateTime (const std::string &mask="YYYYsMMsDDsHHsmmsSS", const std::string &dateS="/", const std::string &timeS=":", const std::string &indPM="PM", const std::string &indAM="AM")
| Return a pointer to the date and time in the form passed in mask.
time_t | setInitialTime (int y, int m, int d, int h=0, int min=0, int s=0)
| Reset time to the specified arguments. Return time_t: number of seconds since 0:00:00 Jan 1 1987.
time_t | setFinalTime (int y, int m, int d, int h=0, int min=0, int s=0)
| Reset time to the specified arguments. Return time_t: number of seconds since 0:00:00 Jan 1 1987.
TeTimeInterval & | operator= (const TeTimeInterval &t)
| Assignment operator for TeTime objects.
bool | operator== (const TeTimeInterval &other) const
| Operator ==.
bool | operator< (const TeTimeInterval &other) const
int | length ()
| Compute legnth of time interval in units of chonon.
void | shift (const std::string &t="")
| Shift the interval, begining at time t (in the form "yyyy-mm-dd hh:mm:ss").
void | shiftPlus (int delta)
| Shift the interval, begining delta units after the initial time. The interval length is maintained.
void | shiftMinus (int delta)
| Shift the interval, begining delta units before the initial time. The interval length is maintained.
bool | isValid ()
| verify if the times have null values
| ~TeTimeInterval (void)
| Normal destructor.
bool | during (TeTime &time)
| Verify if a specific time is during the interval time.
bool | before (TeTime &time)
| Verify if a specific time is before the interval time.

## Detailed Description

This class provides a set of functions for manipulating date and time intervals.

## Constructor & Destructor Documentation

TeTimeInterval::TeTimeInterval | ( | void |  | ) | `[inline]`

Empty constructor.

TeTimeInterval::TeTimeInterval | ( | TeTime & | t1,
|  | TeTime & | t2
| ) |  | `[inline]`

Set all time information from the system clock.

TeTimeInterval::TeTimeInterval | ( | const TeTimeInterval & | t | ) | `[inline]`

Copy constructor.

TeTimeInterval::TeTimeInterval | ( | const std::string & | t1,
|  | const std::string & | t2,
|  | TeChronon | chronon = `TeSECOND`,
|  | const std::string & | mask = `"YYYYsMMsDDsHHsmmsSS"`,
|  | const std::string & | dateS = `"/"`,
|  | const std::string & | timeS = `":"`,
|  | const std::string & | indPM = `"PM"`
| ) |  |

Set date and time from arguments, though the time fields defaults to zero.

TeTimeInterval::TeTimeInterval | ( | const std::string & | t1,
|  | TeChronon | chronon = `TeSECOND`,
|  | const std::string & | mask = `"YYYYsMMsDDsHHsmmsSS"`,
|  | int | delta = `0`,
|  | int | numsteps = `1`
| ) |  | `[inline]`

Set date and time from arguments, though the time fields defaults to zero.

TeTimeInterval::~TeTimeInterval | ( | void |  | ) | `[inline]`

Normal destructor.

## Member Function Documentation

bool TeTimeInterval::before | ( | TeTime & | time | ) |

Verify if a specific time is before the interval time.

bool TeTimeInterval::during | ( | TeTime & | time | ) |

Verify if a specific time is during the interval time.

std::string TeTimeInterval::getFinalDate | ( | void |  | ) | `[inline]`

Return a std::string to the date in the form "yyyy-mm-dd".

std::string TeTimeInterval::getFinalDateTime | ( | const std::string & | mask = `"YYYYsMMsDDsHHsmmsSS"`,
|  | const std::string & | dateS = `"/"`,
|  | const std::string & | timeS = `":"`,
|  | const std::string & | indPM = `"PM"`,
|  | const std::string & | indAM = `"AM"`
| ) |  | `[inline]`

Return a pointer to the date and time in the form passed in mask.

Examples:
  querierGroupChronon.cpp.

std::string TeTimeInterval::getFinalTime | ( |  | ) | `[inline]`

Return a time of day std::string in format "hh:mm:ss".

std::string TeTimeInterval::getInitialDate | ( | void |  | ) | `[inline]`

Return a std::string to the date in the form "yyyy-mm-dd".

std::string TeTimeInterval::getInitialDateTime | ( | const std::string & | mask = `"YYYYsMMsDDsHHsmmsSS"`,
|  | const std::string & | dateS = `"/"`,
|  | const std::string & | timeS = `":"`,
|  | const std::string & | indPM = `"PM"`,
|  | const std::string & | indAM = `"AM"`
| ) |  | `[inline]`

Return a pointer to the date and time in the form passed in mask.

Examples:
  querierGroupChronon.cpp.

std::string TeTimeInterval::getInitialTime | ( |  | ) | `[inline]`

Return a time of day std::string in format "hh:mm:ss".

TeTime& TeTimeInterval::getT1 | ( | void |  | ) | `[inline]`

Return the time t1_.

TeTime& TeTimeInterval::getT2 | ( | void |  | ) | `[inline]`

Return the time t2_.

TeChronon TeTimeInterval::intervalChronon | ( |  | ) | `[inline]`

Returns the chronon of the interval.

void TeTimeInterval::intervalChronon | ( | TeChronon | c | ) |

Sets the chronon of the interval.

bool TeTimeInterval::isValid | ( |  | ) | `[inline]`

verify if the times have null values

int TeTimeInterval::length | ( |  | ) |

Compute legnth of time interval in units of chonon.

void TeTimeInterval::now | ( | void |  | ) | `[inline]`

Set the date and time from the system clock.

bool TeTimeInterval::operator< | ( | const TeTimeInterval & | other | ) | const`[inline]`

TeTimeInterval& TeTimeInterval::operator= | ( | const TeTimeInterval & | t | ) | `[inline]`

Assignment operator for TeTime objects.

bool TeTimeInterval::operator== | ( | const TeTimeInterval & | other | ) | const`[inline]`

Operator ==.

time_t TeTimeInterval::setFinalTime | ( | int | y,
|  | int | m,
|  | int | d,
|  | int | h = `0`,
|  | int | min = `0`,
|  | int | s = `0`
| ) |  | `[inline]`

Reset time to the specified arguments. Return time_t: number of seconds since 0:00:00 Jan 1 1987.

Parameters:

  y | year
  m | month
  d | day
  h | hour
  min | minutes
  s | seconds

time_t TeTimeInterval::setInitialTime | ( | int | y,
|  | int | m,
|  | int | d,
|  | int | h = `0`,
|  | int | min = `0`,
|  | int | s = `0`
| ) |  | `[inline]`

Reset time to the specified arguments. Return time_t: number of seconds since 0:00:00 Jan 1 1987.

Parameters:

  y | year
  m | month
  d | day
  h | hour
  min | minutes
  s | seconds

void TeTimeInterval::shift | ( | const std::string & | t = `""` | ) |

Shift the interval, begining at time t (in the form "yyyy-mm-dd hh:mm:ss").

If t is not provided, the current final time becomes the initial time. The interval length is maintained.

void TeTimeInterval::shiftMinus | ( | int | delta | ) |

Shift the interval, begining delta units before the initial time. The interval length is maintained.

void TeTimeInterval::shiftPlus | ( | int | delta | ) |

Shift the interval, begining delta units after the initial time. The interval length is maintained.

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

- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeTimeInterval.h
- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeTimeInterval.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines