torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TimeStamp.hpp
Go to the documentation of this file.
1 // Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
2 // $HeadURL$
3 // $Id$
4 
5 // This program is free software: you can redistribute it and/or modify it under the terms of the
6 // GNU General Public License as published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
11 // the GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License along with this program. If
14 // not, see <http://www.gnu.org/licenses/>.
15 
16 #ifndef TORC_GENERIC_TIMESTAMP_HPP
17 #define TORC_GENERIC_TIMESTAMP_HPP
18 
19 //BOOST
20 #include <boost/cstdint.hpp>
21 
22 namespace torc {
23 namespace generic {
24 
25 /**
26  * @brief Represents the time in Universal Time Coordinate
27  * (year, month, day, hour, minute, second)
28  */
29 class TimeStamp {
30 private:
31  uint32_t mYear;
32  uint32_t mMonth;
33  uint32_t mDay;
34  uint32_t mHour;
35  uint32_t mMinute;
36  uint32_t mSecond;
37 
38 public:
39  TimeStamp(uint32_t inYear, uint32_t inMonth, uint32_t inDay, uint32_t inHour, uint32_t inMinute,
40  uint32_t inSecond);
41 
42  TimeStamp();
43 
44  ~TimeStamp() throw ();
45 
46  TimeStamp(const TimeStamp& source);
47 
48  TimeStamp& operator =(const TimeStamp& source);
49 
50  /**
51  * Get year information
52  *
53  * @return mYear
54  */
55  inline uint32_t getYear() const;
56 
57  /**
58  * Set year information
59  *
60  * @param[in] inYear Year information
61  */
62  void setYear(const uint32_t& inYear);
63 
64  /**
65  * Get month information
66  *
67  * @return mMonth
68  */
69  inline uint32_t getMonth() const;
70 
71  /**
72  * Set month information
73  *
74  * @param[in] inMonth Month information
75  */
76  void setMonth(const uint32_t& inMonth);
77 
78  /**
79  * Get day information
80  *
81  * @return mDay
82  */
83  inline uint32_t getDay() const;
84 
85  /**
86  * Set day information
87  *
88  * @param[in] inDay Day information
89  */
90  void setDay(const uint32_t& inDay);
91 
92  /**
93  * Get hour information
94  *
95  * @return mHour
96  */
97  inline uint32_t getHour() const;
98 
99  /**
100  * Set hour information
101  *
102  * @param[in] inHour Hour information
103  */
104  void setHour(const uint32_t& inHour);
105 
106  /**
107  * Get minute information
108  *
109  * @return mMinute
110  */
111  inline uint32_t getMinute() const;
112 
113  /**
114  * Set minute information
115  *
116  * @param[in] inMinute Minute information
117  */
118  void setMinute(uint32_t inMinute);
119 
120  /**
121  * Get second information
122  *
123  * @return mSecond
124  */
125  inline uint32_t getSecond() const;
126 
127  /**
128  * Set second information
129  *
130  * @param[in] inSecond Second information
131  */
132  void setSecond(uint32_t inSecond);
133 
134 };
135 /**
136  * Get year information
137  *
138  * @return mYear
139  */
140 inline uint32_t TimeStamp::getYear() const {
141  return mYear;
142 }
143 
144 /**
145  * Get month information
146  *
147  * @return mMonth
148  */
149 inline uint32_t TimeStamp::getMonth() const {
150  return mMonth;
151 }
152 
153 /**
154  * Get day information
155  *
156  * @return mDay
157  */
158 inline uint32_t TimeStamp::getDay() const {
159  return mDay;
160 }
161 
162 /**
163  * Get hour information
164  *
165  * @return mHour
166  */
167 inline uint32_t TimeStamp::getHour() const {
168  return mHour;
169 }
170 
171 /**
172  * Get minute information
173  *
174  * @return mMinute
175  */
176 inline uint32_t TimeStamp::getMinute() const {
177  return mMinute;
178 }
179 
180 /**
181  * Get second information
182  *
183  * @return mSecond
184  */
185 inline uint32_t TimeStamp::getSecond() const {
186  return mSecond;
187 }
188 
189 } // namespace generic
190 } // namespace torc
191 
192 #endif // TORC_GENERIC_TIMESTAMP_HPP
void setHour(const uint32_t &inHour)
Definition: TimeStamp.cpp:76
uint32_t getSecond() const
Definition: TimeStamp.hpp:185
uint32_t getHour() const
Definition: TimeStamp.hpp:167
void setMinute(uint32_t inMinute)
Definition: TimeStamp.cpp:85
void setMonth(const uint32_t &inMonth)
Definition: TimeStamp.cpp:58
uint32_t getMonth() const
Definition: TimeStamp.hpp:149
uint32_t getYear() const
Definition: TimeStamp.hpp:140
void setYear(const uint32_t &inYear)
Definition: TimeStamp.cpp:49
Represents the time in Universal Time Coordinate (year, month, day, hour, minute, second) ...
Definition: TimeStamp.hpp:29
void setDay(const uint32_t &inDay)
Definition: TimeStamp.cpp:67
uint32_t getMinute() const
Definition: TimeStamp.hpp:176
uint32_t getDay() const
Definition: TimeStamp.hpp:158
void setSecond(uint32_t inSecond)
Definition: TimeStamp.cpp:94