cta_time.h File Reference

Interface description of the default COSTA time component. More...

#include "cta_system.h"
#include "cta_handles.h"
#include "cta_datatypes.h"

Go to the source code of this file.

Typedefs

typedef CTA_Handle CTA_Time

Functions

CTAEXPORT int CTA_Time_Create (CTA_Time *htime)
 Create a time object.
CTAEXPORT int CTA_Time_Free (CTA_Time *htime)
 Free a time object.
CTAEXPORT int CTA_Time_SetSpan (CTA_Time htime, double tstart, double tend)
 Set the time span.
CTAEXPORT int CTA_Time_GetSpan (CTA_Time htime, double *tstart, double *tend)
 Get the time span.
CTAEXPORT int CTA_Time_SetStep (CTA_Time htime, double tstep)
 Set the time step.
CTAEXPORT int CTA_Time_GetStep (CTA_Time htime, double *tstep)
 Get time step.
CTAEXPORT int CTA_Time_CountSteps (CTA_Time htime, int *nsteps)
 Count number of timesteps in time.
CTAEXPORT int CTA_Time_GetTimeStep (CTA_Time htime, int istep, CTA_Time hstep)
 Get interval of i-th step.
CTAEXPORT int CTA_Time_InSpan (CTA_Time htimesub, CTA_Time htime, BOOL *inspan)
 Check whether htimesub is within time span of htime.
CTAEXPORT int CTA_Time_IsStep (CTA_Time htime, double t, BOOL *isstep)
 Check whether time step of time object equals t.
CTAEXPORT int CTA_Time_Copy (CTA_Time hfrom, CTA_Time hto)
 Copy a time object.
CTAEXPORT int CTA_Time_Export (CTA_Time htime, CTA_Handle hexport)
 Export a time object. exports the whole internal state of the time object to given target CTA_FILE will export the time component in a MATLAB/OCTAVE readable form CTA_PACK will pack the content.
CTAEXPORT int CTA_Time_Import (CTA_Time htime, CTA_Handle himport)
 Import a time object. imports the whole internal state of the time object from given source.
CTAEXPORT int CTA_Time_IsSpan (CTA_Time htime, int *isspan)
 Returns whether time object describes an timespan or a single instance.

Detailed Description

Interface description of the default COSTA time component.

A time object describes a time span (time of start, time of end). Utility functions are provided for changing and evaluating or comparing time spans.

Definition in file cta_time.h.


Typedef Documentation

Definition at line 37 of file cta_time.h.


Function Documentation

CTAEXPORT int CTA_Time_Copy ( CTA_Time  hfrom,
CTA_Time  hto 
)

Copy a time object.

Parameters:
hfrom I time object to copy from
hto O handle of time object that receives copy, must exist before calling
Returns:
error status: CTA_OK if successful
CTAEXPORT int CTA_Time_CountSteps ( CTA_Time  htime,
int *  nsteps 
)

Count number of timesteps in time.

Parameters:
htime I time object (see function description)
nsteps O number of timesteps
Returns:
error status: CTA_OK if successful
Note:
number of steps is rounded to nearest integer
CTAEXPORT int CTA_Time_Create ( CTA_Time htime  ) 

Create a time object.

Parameters:
htime O receives handle of newly created time object
Returns:
error status: CTA_OK if successful
CTAEXPORT int CTA_Time_Export ( CTA_Time  htime,
CTA_Handle  hexport 
)

Export a time object. exports the whole internal state of the time object to given target CTA_FILE will export the time component in a MATLAB/OCTAVE readable form CTA_PACK will pack the content.

Parameters:
htime I time object to export
hexport I target for export (CTA_FILE or CTA_PACK)
Returns:
error status: CTA_OK if successful
CTAEXPORT int CTA_Time_Free ( CTA_Time htime  ) 

Free a time object.

Parameters:
htime IO handle of time object to be freed, replaced by CTA_NULL on return.
Returns:
error status: CTA_OK if successful
CTAEXPORT int CTA_Time_GetSpan ( CTA_Time  htime,
double *  tstart,
double *  tend 
)

Get the time span.

Parameters:
htime I time object of which to get time span
tstart O receives the starting time
tend O receives ending time
Returns:
error status: CTA_OK if successful
CTAEXPORT int CTA_Time_GetStep ( CTA_Time  htime,
double *  tstep 
)

Get time step.

Parameters:
htime IO time object of which to get time step
tstep O receives time step
Returns:
error status: CTA_OK if successful
CTAEXPORT int CTA_Time_GetTimeStep ( CTA_Time  htime,
int  istep,
CTA_Time  hstep 
)

Get interval of i-th step.

Parameters:
htime I time object (see function description)
istep I interval of step
hstep O time step of model
Returns:
error status: CTA_OK if successful
Note:
intervals are counted from 1 to nsteps
CTAEXPORT int CTA_Time_Import ( CTA_Time  htime,
CTA_Handle  himport 
)

Import a time object. imports the whole internal state of the time object from given source.

Parameters:
htime I time object to import to
himport I source of import (CTA_PACK)
Returns:
error status: CTA_OK if successful
CTAEXPORT int CTA_Time_InSpan ( CTA_Time  htimesub,
CTA_Time  htime,
BOOL *  inspan 
)

Check whether htimesub is within time span of htime.

Parameters:
htimesub I time object (see function description)
htime I time object (see function description)
inspan O receives TRUE if htimesub is within time span of htime or FALSE otherwise
Returns:
error status: CTA_OK if successful
CTAEXPORT int CTA_Time_IsSpan ( CTA_Time  htime,
int *  isspan 
)

Returns whether time object describes an timespan or a single instance.

Parameters:
htime I time object to import to
isspan O time object is a time timespan (CTA_TRUE/CTA_FALSE)
Returns:
error status: CTA_OK if successful
CTAEXPORT int CTA_Time_IsStep ( CTA_Time  htime,
double  t,
BOOL *  isstep 
)

Check whether time step of time object equals t.

Parameters:
htime I time object
t I time step to compare
isstep O receives TRUE if t equals time step of time object or FALSE otherwise
Returns:
error status: CTA_OK if successful
CTAEXPORT int CTA_Time_SetSpan ( CTA_Time  htime,
double  tstart,
double  tend 
)

Set the time span.

Parameters:
htime IO time object of which to set time span
tstart I starting time
tend I ending time
Returns:
error status: CTA_OK if successful
CTAEXPORT int CTA_Time_SetStep ( CTA_Time  htime,
double  tstep 
)

Set the time step.

Parameters:
htime IO time object of which to set time step
tstep I new time step
Returns:
error status: CTA_OK if successful

Generated on 4 Mar 2014 for OpenDA by  doxygen 1.6.1