1 //******************************************************************
3 // Copyright 2014 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 #include "ActionSet.h"
28 setTime(0, 0, 0, 0, 0, 0, 0);
35 void Time::setTime(OCTime t)
39 void Time::setTime(unsigned int yy, unsigned int mm, unsigned int dd,
40 unsigned int h, unsigned int m, unsigned int s,
55 mTime.tm_wday = (unsigned int) dayoftheweek;
58 void Time::setDayOfWeekForRecursive(int day)
65 setTime(0, 0, 0, 0, 0, 0, day);
67 unsigned int Time::getYear()
71 unsigned int Time::getMonth()
75 unsigned int Time::getDay()
79 unsigned int Time::getHour()
83 unsigned int Time::getMin()
87 unsigned int Time::getSec()
91 long int Time::getSecondsFromAbsoluteTime()
93 if(mTime.tm_year > 1900)
94 mTime.tm_year -= 1900;
98 return getSecondsFromAbsTime(&mTime);
100 long int Time::getSecAbsTime()
102 return getSeconds(&mTime);
104 long int Time::getSecondsForWeeklySchedule()
106 if(mTime.tm_year > 1900)
107 mTime.tm_year -= 1900;
110 return getRelativeIntervalOfWeek(&mTime);
113 void Time::setDelay(long int seconds)
121 std::string Time::toString() const
123 char temp[25] = { 0 };
124 // It is shown format which required of scheduled/recursive group action time.
125 // " [delay] [type of actionset] "
126 snprintf(temp, sizeof(temp) / sizeof(char),
127 "%ld %d", mDelay, (unsigned int) type);
128 return std::string(temp);
146 listOfCapability.clear();
157 ActionSet::ActionSet() :
161 ActionSet::~ActionSet()
163 listOfAction.clear();