torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TimeStamp.cpp
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 
17 
18 namespace torc {
19 namespace generic {
20 
21 TimeStamp::TimeStamp(uint32_t inYear, uint32_t inMonth, uint32_t inDay, uint32_t inHour,
22  uint32_t inMinute, uint32_t inSecond) : mYear(inYear), mMonth(inMonth), mDay(inDay),
23  mHour(inHour), mMinute(inMinute), mSecond(inSecond) {}
24 
25 TimeStamp::TimeStamp() : mYear(0), mMonth(0), mDay(0), mHour(0), mMinute(0), mSecond(0) {}
26 
27 TimeStamp::TimeStamp(const TimeStamp& source) : mYear(source.mYear), mMonth(source.mMonth),
28  mDay(source.mDay), mHour(source.mHour), mMinute(source.mMinute), mSecond(source.mSecond) {}
29 
31  if(this != &source) {
32  mYear = source.mYear;
33  mMonth = source.mMonth;
34  mDay = source.mDay;
35  mHour = source.mHour;
36  mMinute = source.mMinute;
37  mSecond = source.mSecond;
38  }
39  return *this;
40 }
41 
42 TimeStamp::~TimeStamp() throw () {}
43 
44 /**
45  * Set year information
46  *
47  * @param[in] inYear Year information
48  */
49 void TimeStamp::setYear(const uint32_t& inYear) {
50  mYear = inYear;
51 }
52 
53 /**
54  * Set month information
55  *
56  * @param[in] inMonth Month information
57  */
58 void TimeStamp::setMonth(const uint32_t& inMonth) {
59  mMonth = inMonth;
60 }
61 
62 /**
63  * Set day information
64  *
65  * @param[in] inDay Day information
66  */
67 void TimeStamp::setDay(const uint32_t& inDay) {
68  mDay = inDay;
69 }
70 
71 /**
72  * Set hour information
73  *
74  * @param[in] inHour Hour information
75  */
76 void TimeStamp::setHour(const uint32_t& inHour) {
77  mHour = inHour;
78 }
79 
80 /**
81  * Set minute information
82  *
83  * @param[in] inMinute Minute information
84  */
85 void TimeStamp::setMinute(uint32_t inMinute) {
86  mMinute = inMinute;
87 }
88 
89 /**
90  * Set second information
91  *
92  * @param[in] inSecond Second information
93  */
94 void TimeStamp::setSecond(uint32_t inSecond) {
95  mSecond = inSecond;
96 }
97 
98 } // namespace generic
99 } // namespace torc
void setHour(const uint32_t &inHour)
Definition: TimeStamp.cpp:76
void setMinute(uint32_t inMinute)
Definition: TimeStamp.cpp:85
void setMonth(const uint32_t &inMonth)
Definition: TimeStamp.cpp:58
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
void setSecond(uint32_t inSecond)
Definition: TimeStamp.cpp:94
TimeStamp & operator=(const TimeStamp &source)
Definition: TimeStamp.cpp:30