C++ TargetRTS
Loading...
Searching...
No Matches
RTTime.h
1/*
2 * Licensed Materials - Property of HCL and/or IBM
3 * Copyright HCL Technologies Ltd. 2016, 2021. All Rights Reserved.
4 * Copyright IBM Corporation 1999, 2016. All Rights Reserved.
5 *
6 * U.S. Government Users Restricted Rights - Use, duplication or
7 * disclosure restricted by GSA ADP Schedule.
8 */
9
10#ifndef __RTTime_h__
11#define __RTTime_h__ included
12
13#ifdef PRAGMA
14#pragma interface
15#endif
16
17#ifndef __RTFieldDescriptor_h__
18#include <RTFieldDescriptor.h>
19#endif
20
21#ifndef __RTInteger_h__
22#include <RTInteger.h>
23#endif
24
25#ifndef __RTSequence_h__
26#include <RTSequence.h>
27#endif
28
29struct RTTimespec;
30
31class RTTime : public RTSequence
32{
33public:
34 RTInteger hours;
35 RTInteger minutes;
36 RTInteger seconds;
37
38 explicit RTTime( int _hrs = 0, int _min = 0, int _sec = 0 );
39 RTTime( const RTTime & );
40 RTTime( const RTTimespec & ); //lint !e1931
41 virtual ~RTTime( void );
42
43 static RTTime now( void ); /* current time */
44
45 int asInt( void ) const; /* seconds from midnight */
46
47 /* return time based upon number of seconds from midnight */
48 static RTTime asTime( int value );
49
50 RTTime & operator= ( const RTTime & );
51 RTTime & operator+=( const RTTime & );
52 RTTime & operator-=( const RTTime & );
53
54 virtual int operator==( const RTDataObject & ) const override;
55
56 virtual const RTObject_class * getClassData( void ) const override;
57 static const RTObject_class classData;
58 static const RTFieldDescriptor fieldData[];
59
60#define RTType_RTTime ( RTTime::classData )
61};
62
63int operator< ( const RTTime &, const RTTime & );
64RTS_INLINE int operator> ( const RTTime &, const RTTime & );
65RTS_INLINE int operator<=( const RTTime &, const RTTime & );
66RTS_INLINE int operator>=( const RTTime &, const RTTime & );
67RTTime operator+ ( const RTTime &, const RTTime & );
68RTTime operator- ( const RTTime &, const RTTime & );
69
71{
72 const void * data;
73 const RTObject_class * type;
74
75 RTS_INLINE RTTypedValue_RTTime( const RTTime & ); //lint !e1931
76 RTS_INLINE RTTypedValue_RTTime( const RTTime &,
77 const RTObject_class * );
78}; //lint !e1712
79
80#if RTS_INLINES
81#include <RTTime.inl>
82#endif
83
84#endif // __RTTime_h__
Provides a common interface to certain data type implementations (e.g.
Definition: RTDataObject.h:33
Definition: RTInteger.h:22
Definition: RTSequence.h:22
Definition: RTTime.h:32
Definition: RTFieldDescriptor.h:40
A type descriptor providing information about a type.
Definition: RTObject_class.h:64
A time value which can represent either an absolute or relative time.
Definition: RTTimespec.h:29
Definition: RTTime.h:71