Mobile API Reference  MicroStrategy 2019
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DynamicTime.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : DynamicTime.h
3 // AUTHOR : Yuxiao Xiao
4 // CREATION : 6/11/02
5 // Copyright (C) MicroStrategy, Inc. 2001
6 //==============================================================================================
7 
8 #ifndef _DYNAMICTIME_H_
9 #define _DYNAMICTIME_H_
10 
12 
13 namespace MDataType {
14 
15 //==============================================================================================
16 // It's size is IMMUTABLE - you can not make a bug fix which creates new member!!!
17 //==============================================================================================
18 
19 // according to EnumDSSDynamicTime
20 typedef enum
21 {
22  TIME_END = 0,
24  NOW = 2,
25  TODAY = 3,
26  THIS_WEEK = 4,
28  THIS_YEAR = 6,
36  STATIC_DATE = 0x20,
37  DYNAMIC_HOUR = 0x40,
40 } DYNAMIC_TIME ;
41 
42 // according to EnumDSSTimeGranularityLevel
43 typedef enum
44 {
45  SECONDS = 1,
46  MINUTES = 2,
47  HOUR = 3,
48  DAY = 4,
49  MONTH = 5,
50  YEAR = 6,
51  WEEK = 7
53 
55 {
56 public:
57 
58  DynamicTime(DYNAMIC_TIME inTime=NOT_DYNAMIC_TIME, Int32 inDynamicDayOffset=0);
59  DynamicTime(const DynamicTime& irSrc);
60 
61  DynamicTime& operator = (const DynamicTime& irSrc);
62 
63  virtual ~DynamicTime() throw();
64 
65  void PutDynamicTime(DYNAMIC_TIME inDynamicTime);
66  DYNAMIC_TIME GetDynamicTime() const;
67 
68  Int32 GetDynamicDayOffset() const;
69  void PutDynamicDayOffset(Int32 inDayOffset);
70 
71  Int32 GetYear() const;
72  Int32 GetMonth() const;
73  Int32 GetDay() const;
74  Int32 GetHour() const;
75  Int32 GetMinute() const;
76  Int32 GetSecond() const;
77  Int32 GetWeek() const;
78  Int32 GetDayOfWeek() const;
79 
80  void PutYear(Int32 inYear);
81  void PutMonth(Int32 inMonth);
82  void PutDay(Int32 inDay);
83  void PutHour(Int32 inHour);
84  void PutMinute(Int32 inMinute);
85  void PutSecond(Int32 inSecond);
86  void PutWeek(Int32 inWeek);
87  void PutDayOfWeek(Int32 inDayofweek);
88 
89  // return 0 = success
90  // return -1, it's TIME_END or TIME_BEGINNING, cannot convert to valid non-dynamic time.
91  // orTime is UTC.
92  Int32 ToDateTime(DateTime& orTime) const;
93 
94  static void MoveNthTimePointBefore(DateTime& iorTime, Int32 inCount, TIME_GRANULARITY inLevel);
95 
96  short GetDynamicMonthOffset() const;
97  void PutDynamicMonthOffset(short inOffset);
98 
99 private:
100 
101  DYNAMIC_TIME mnDynamicTime;
102 
103  Int32 mnDayOffset;
104 
105  Int32 mnYear;
106  Int32 mnMonth;
107  Int32 mnDay;
108  Int32 mnHour;
109  Int32 mnMinute;
110  Int32 mnSecond;
111  Int32 mnWeek;
112  Int32 mnDayOfWeek;
113 
114  short mnMonthOffset;
115 };
116 
117 } // namespace
118 
119 #endif // _DYNAMICTIME_H_
Definition: DynamicTime.h:27
Definition: DynamicTime.h:45
Definition: DynamicTime.h:31
#define DLL_DATATYPE_EXIM
Definition: DataType.h:22
Definition: DynamicTime.h:48
Definition: DynamicTime.h:35
Definition: BigDecimal.h:18
Definition: DynamicTime.h:25
Definition: DynamicTime.h:39
Definition: DynamicTime.h:47
Definition: DynamicTime.h:22
Definition: DynamicTime.h:46
#define Int32
Definition: BasicTypes.h:20
Definition: DynamicTime.h:38
Definition: DynamicTime.h:28
Definition: DynamicTime.h:33
Definition: DynamicTime.h:50
Definition: DynamicTime.h:34
Definition: DynamicTime.h:30
Definition: DynamicTime.h:36
Definition: DynamicTime.h:37
Definition: DynamicTime.h:54
TIME_GRANULARITY
Definition: DynamicTime.h:43
Definition: DateTime.h:74
Definition: DynamicTime.h:49
Definition: DynamicTime.h:51
Definition: DynamicTime.h:32
Definition: DynamicTime.h:23
DYNAMIC_TIME
Definition: DynamicTime.h:20
Definition: DynamicTime.h:26
Definition: DynamicTime.h:29
Definition: DynamicTime.h:24