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 #ifndef __OC_ACTIONSET__
22 #define __OC_ACTIONSET__
39 NONE = 0, SCHEDULED, RECURSIVE
46 * @brief This class provides time-related information used for scheduled/recursive group action
47 * features. Along with time-related variables, it also provides various useful functionality
48 * including translating time to second unit
54 * Constructor for Time
58 * Virtual destructor for Time
62 /** @brief a unit of second.*/
64 /** @brief time information in structure tm.*/
66 /** @brief flag to indicate group action type(NONE, SCHEDULED, RECURSIVE).*/
69 void setTime(OCTime t);
70 void setTime(unsigned int yy, unsigned int mm, unsigned int dd,
71 unsigned int h, unsigned int m, unsigned int s,
73 void setDayOfWeekForRecursive(int day);
74 unsigned int getYear();
75 unsigned int getMonth();
76 unsigned int getDay();
77 unsigned int getHour();
78 unsigned int getMin();
79 unsigned int getSec();
80 long int getSecondsFromAbsoluteTime();
81 long int getSecAbsTime();
82 long int getSecondsForWeeklySchedule();
83 void setDelay(long int seconds);
84 std::string toString() const;
89 * @brief This class provides a structure to help developers to easily specify a unit of attribute
90 * key-value pair which corresponds to action.
95 /** @brief This corresponds with attribute key.*/
96 std::string capability;
97 /** @brief This corresponds with attribute value.*/
103 * @brief This class provides a structure to help developers to easily specify an action which a
104 * target resource have to do for.
110 * Constructor for Action
114 * Virtual destructor for Action
118 /** @brief This is a target URL of this action. It includes IP address, port, and resource URI.*/
120 /** @brief This is a list of capabilites.*/
121 std::vector<Capability*> listOfCapability;
126 * @brief This class provides a structure to help developers to easily specify group action.
128 class ActionSet: public Time
132 * Constructor for ActionSet
136 * Virtual destructor for ActionSet
140 /** @brief a name of group action */
141 std::string actionsetName;
142 /** @brief a list of actions composing group action */
143 std::vector<Action*> listOfAction;