datatypes::timeseries::TimeStep¶
Time step handling for time series. More...
#include <time_step.h>
Public Functions¶
Name | |
---|---|
TimeStep(const time_duration & stepDuration) Define a time step where every step is a fixed time duration. |
|
TimeStep(TimeStepImplementation * tsi) | |
TimeStep(const TimeStep & src) Copy constructor. |
|
TimeStep() | |
~TimeStep() | |
TimeStep & | operator=(const TimeStep & rhs) |
TimeStep & | operator=(const time_duration & stepDuration) Assignment operator. |
TimeStep & | operator=(const string & stepDuration) |
bool | operator==(const TimeStep & rhs) const |
bool | operator!=(const TimeStep & rhs) const |
TimeStep | operator*(int mult) const Multiplication operator, using the time_duration multiplication operator. |
TimeStep | operator*(double mult) const |
int | operator/(const TimeStep & divisor) const |
TimeStep | operator/(int divisor) const |
time_duration | operator%(const TimeStep & other) const |
bool | IsRegular() const Query if this time step is defined by a time duration in the true sense (day, week). Monthly time step would return false;. |
time_duration | GetRegularStepDuration() const Gets the underlying time_duration for this time step. Exception thrown if not a regular time step. |
const ptime | AddSteps(const ptime & startTimeStep, size_t n) const |
const ptime | AddSteps(const ptime & startTimeStep, int n) const |
const ptime | AddSteps(const ptime & startTimeStep, double mult) const Adds a number of steps to an instant, which can be non-integer for regular time steps. Behavior TBC for irregular time steps. |
vector< ptime > | AddSteps(const ptime & startTimeStep, const vector< double > timeSteps) const Vectorized version of shifting time steps. Adds a number of steps to an instant, which can be non-integer for regular time steps. Behavior TBC for irregular time steps. |
vector< ptime > | AddSteps(const vector< ptime > & times, double mult) const |
const time_duration | GetTimeStepDuration(const ptime & startTimeStep) const Given an instant, what is the next time instant according to this present Time step. |
const ptrdiff_t | GetUpperNumSteps(const ptime & start, const ptime & end) const Gets the minimum number of time steps covering a time interval. |
const ptrdiff_t | GetNumSteps(const ptime & start, const ptime & end) const Gets the maximum number of time steps from a starting instant to not get beyond an instant in time, 'end'. |
const ptrdiff_t | GetOffset(const ptime & start, const ptime & end) const |
const void | Increment(ptime * t) const Increments an instant by one time step. |
bool | IsUnknown() const Query if this object is the time step value "unknown". |
string | GetName() const |
TimeStep | Parse(const string & name) |
TimeStep | FromSeconds(unsigned int seconds) |
TimeStep | GetDaily() |
TimeStep | GetHourly() |
TimeStep | GetMonthlyQpp() |
TimeStep | GetUnknown() Gets an instance of time step that is unknown. This value is indented for use in methods as a default parameter value. |
ptime | CreatePtime(int year, int month, int day, int hour =0, int minute =0, int second =0) |
ptime | PtimeFromIsoString(const string & t) |
string | ToString(const ptime & dt, const string & format ="YYYYMMDDThhmmss") |
Detailed Description¶
Time step handling for time series.
A TimeStep is responsible for the definition of time steps in time series
and the associated calculations for determining time instants and durations
Public Functions Documentation¶
function TimeStep¶
Define a time step where every step is a fixed time duration.
Parameters:
- stepDuration Duration of the step.
function TimeStep¶
function TimeStep¶
Copy constructor.
Parameters:
- src TimeStep to copy.
function TimeStep¶
function ~TimeStep¶
function operator=¶
function operator=¶
Assignment operator.
Parameters:
- stepDuration Duration of the step.
Return: A reference to this object.
function operator=¶
function operator==¶
function operator!=¶
function operator*¶
Multiplication operator, using the time_duration multiplication operator.
Parameters:
- mult The multiplier.
Return: The result of the operation.
Multiplication operator, using the time_duration multiplication operator if the argument is an integer.
function operator*¶
function operator/¶
function operator/¶
function operator%¶
function IsRegular¶
Query if this time step is defined by a time duration in the true sense (day, week). Monthly time step would return false;.
Return: true if regular, false if not.
function GetRegularStepDuration¶
Gets the underlying time_duration for this time step. Exception thrown if not a regular time step.
Return: The regular step duration.
function AddSteps¶
function AddSteps¶
function AddSteps¶
Adds a number of steps to an instant, which can be non-integer for regular time steps. Behavior TBC for irregular time steps.
Parameters:
- startTimeStep The start time step.
- mult The number of steps added.
Return: A ptime.
function AddSteps¶
Vectorized version of shifting time steps. Adds a number of steps to an instant, which can be non-integer for regular time steps. Behavior TBC for irregular time steps.
Parameters:
- startTimeStep The start time step.
- timeSteps The time steps.
Return: A vector
function AddSteps¶
function GetTimeStepDuration¶
Given an instant, what is the next time instant according to this present Time step.
Parameters:
- startTimeStep The start time step.
Return: The time step duration.
function GetUpperNumSteps¶
Gets the minimum number of time steps covering a time interval.
Parameters:
- start The start of the time interval
- end The end of the time interval
Return: the number of steps needed to get beyond 'end'
function GetNumSteps¶
Gets the maximum number of time steps from a starting instant to not get beyond an instant in time, 'end'.
Parameters:
- start The start of the time interval
- end The end of the time interval
Return: the number of steps needed to not get beyond 'end'
function GetOffset¶
function Increment¶
Increments an instant by one time step.
Parameters:
- t If non-null, the ptime to process.
function IsUnknown¶
Query if this object is the time step value "unknown".
Return: true if unknown, false if not.
function GetName¶
function Parse¶
function FromSeconds¶
function GetDaily¶
function GetHourly¶
function GetMonthlyQpp¶
function GetUnknown¶
Gets an instance of time step that is unknown. This value is indented for use in methods as a default parameter value.
Return: The "unknown" value of the time step
function CreatePtime¶
function PtimeFromIsoString¶
function ToString¶
Updated on 2022-08-21 at 18:10:33 +1000