TECA
The Toolkit for Extreme Climate Analysis
teca_calendar_util::year_iterator Class Reference

Enumerate ranges of time steps bracketing months. More...

#include <teca_calendar_util.h>

Inheritance diagram for teca_calendar_util::year_iterator:
Collaboration diagram for teca_calendar_util::year_iterator:

Public Member Functions

bool is_valid () const override
 return true if there are more time steps in the sequence More...
 
int initialize (const const_p_teca_variant_array &t, const std::string &units, const std::string &calendar, long first_step, long last_step) override
 
int get_next_interval (time_point &first_step, time_point &last_step) override
 
virtual int initialize (const teca_metadata &md)
 
virtual int initialize (const teca_metadata &md, long first_step, long last_step)
 
virtual int initialize (const const_p_teca_variant_array &t, const std::string &units, const std::string &calendar, long first_step, long last_step)=0
 
- Public Member Functions inherited from teca_calendar_util::interval_iterator
virtual int initialize (const teca_metadata &md)
 
virtual int initialize (const teca_metadata &md, long first_step, long last_step)
 
 operator bool () const
 
const time_pointget_begin () const
 return the first time point in the series More...
 
const time_pointget_end () const
 return the last time point in the series More...
 

Protected Attributes

int year
 
- Protected Attributes inherited from teca_calendar_util::interval_iterator
const_p_teca_variant_array time
 
std::string units
 
std::string calendar
 
time_point begin
 
time_point end
 
bool valid
 

Detailed Description

Enumerate ranges of time steps bracketing months.

An iterator over all months between 2 time_point's. A pair of time steps bracketing the current month are returned at each iteration.

Member Function Documentation

◆ get_next_interval()

int teca_calendar_util::year_iterator::get_next_interval ( time_point first_step,
time_point last_step 
)
overridevirtual

return a pair of time steps bracketing the current season. both returned time steps belong to the current season.

Implements teca_calendar_util::interval_iterator.

◆ initialize() [1/4]

int teca_calendar_util::year_iterator::initialize ( const const_p_teca_variant_array t,
const std::string &  units,
const std::string &  calendar,
long  first_step,
long  last_step 
)
overridevirtual

Initialize the iterator.

Parameters
[in]tAn array of time values
[in]unitsA string units of the time values
[in]calendarA string name of the calendar system
[in]first_stepthe first step to include in the series or 0 to use all
[in]last_stepthe last step to include in the series or -1 to use all
Returns
0 if successfully initialized

Implements teca_calendar_util::interval_iterator.

◆ initialize() [2/4]

virtual int teca_calendar_util::interval_iterator::initialize

Initialize the iterator.

Parameters
[in]tAn array of time values
[in]unitsA string units of the time values
[in]calendarA string name of the calendar system
[in]first_stepthe first step to include in the series or 0 to use all
[in]last_stepthe last step to include in the series or -1 to use all
Returns
0 if successfully initialized

◆ initialize() [3/4]

virtual int teca_calendar_util::interval_iterator::initialize

Initialize the iterator from a metadata object following the conventions defined by the teca_cf_reader.

Returns
0 if successfully initialized

◆ initialize() [4/4]

virtual int teca_calendar_util::interval_iterator::initialize

Initialize the iterator from a metadata object following the conventions defined by the teca_cf_reader.

Parameters
[in]mda metadata object
[in]first_stepthe first step to include in the series or 0 to use all
[in]last_stepthe last step to include in the series or -1 to use all
Returns
0 if successfully initialized

◆ is_valid()

bool teca_calendar_util::year_iterator::is_valid ( ) const
overridevirtual

return true if there are more time steps in the sequence

Implements teca_calendar_util::interval_iterator.


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