00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
#ifndef ACSTIME_DURATION_HELPER_H
00027
#define ACSTIME_DURATION_HELPER_H
00028
00029
#ifndef __cplusplus
00030
#error This is a C++ include file and cannot be used from plain C
00031
#endif
00032
00033
#include "acstimeTimeUtil.h"
00034
00049 class DurationHelper :
TimeUtil
00050 {
00051
public:
00052
00057
DurationHelper(
const acstime::Duration &duration);
00058
00061
DurationHelper();
00062
00067
DurationHelper(
long double seconds);
00068
00073
DurationHelper(
const ACS::TimeInterval &duration);
00074
00077 virtual ~DurationHelper(){};
00078
00086 acstime::Duration
value();
00087
00095
void value(
const acstime::Duration &duration);
00096
00104
void value(
const ACS::TimeInterval &duration);
00105
00113
void value(
long double seconds);
00114
00123 CORBA::Boolean
positive();
00124
00133
void positive(
const CORBA::Boolean&);
00134
00142 CORBA::Long
day();
00143
00151
void day(
const CORBA::Long&);
00152
00160 CORBA::Long
hour();
00161
00169
void hour(
const CORBA::Long&);
00170
00178 CORBA::Long
minute();
00179
00187
void minute(
const CORBA::Long&);
00188
00196 CORBA::Long
second();
00197
00205
void second(
const CORBA::Long&);
00206
00214 CORBA::ULong
microSecond();
00215
00223
void microSecond(
const CORBA::ULong&);
00224
00241 CORBA::Boolean
normalize();
00242
00259
void normalize(
const CORBA::Boolean&);
00260
00268
void reset();
00269
00281 acstime::TimeComparison
compare(
const acstime::Duration &duration);
00282
00283 CORBA::Boolean
operator==(
const acstime::Duration &duration)
const;
00284 CORBA::Boolean
operator<=(
const acstime::Duration &duration)
const;
00285 CORBA::Boolean
operator<(
const acstime::Duration &duration)
const;
00286 CORBA::Boolean
operator>=(
const acstime::Duration &duration)
const;
00287 CORBA::Boolean
operator>(
const acstime::Duration &duration)
const;
00288
00298
void add(
const acstime::Duration &duration) ;
00299
00308
DurationHelper&
operator+=(
const acstime::Duration &duration);
00309
00319
void subtract(
const acstime::Duration &duration);
00320
00329
DurationHelper&
operator-=(
const acstime::Duration &duration);
00330
00339
void modulo(
const acstime::Duration &duration);
00340
00349
DurationHelper&
operator%=(
const acstime::Duration &duration);
00350
00360
void multiply(
const CORBA::ULong &multiplier);
00361
00370
DurationHelper&
operator*=(
const CORBA::ULong &multiplier);
00371
00380
void divide(
const CORBA::ULong ÷r);
00381
00390
DurationHelper&
operator/=(
const CORBA::ULong ÷r);
00391
00402 std::string
toString(
const char *format);
00403
00413
void fromString(
const char *duration);
00414
00427
long double toSeconds();
00428
00429
00430
private:
00431
00435
void m_toValue();
00436
00437
void m_toAttributes();
00438
00439
void m_microSec(std::ostringstream&);
00440
00441
00442 acstime::Duration
value_m;
00443 CORBA::Boolean
positive_m;
00444 CORBA::Long
day_m;
00445 CORBA::Long
hour_m;
00446 CORBA::Long
minute_m;
00447 CORBA::Long
second_m;
00448 CORBA::ULong
microSecond_m;
00449 CORBA::Boolean
normalize_m;
00450
00453
DurationHelper(
const DurationHelper&);
00454
00457
void operator= (
const DurationHelper&);
00458 };
00459
00460
#endif
00461
00462
00463
00464
00465
00466
00467
00468