yocto_wakeupschedule.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * $Id: yocto_wakeupschedule.h 28748 2017-10-03 08:23:39Z seb $
4  *
5  * Declares yFindWakeUpSchedule(), the high-level API for WakeUpSchedule functions
6  *
7  * - - - - - - - - - License information: - - - - - - - - -
8  *
9  * Copyright (C) 2011 and beyond by Yoctopuce Sarl, Switzerland.
10  *
11  * Yoctopuce Sarl (hereafter Licensor) grants to you a perpetual
12  * non-exclusive license to use, modify, copy and integrate this
13  * file into your software for the sole purpose of interfacing
14  * with Yoctopuce products.
15  *
16  * You may reproduce and distribute copies of this file in
17  * source or object form, as long as the sole purpose of this
18  * code is to interface with Yoctopuce products. You must retain
19  * this notice in the distributed source file.
20  *
21  * You should refer to Yoctopuce General Terms and Conditions
22  * for additional information regarding your rights and
23  * obligations.
24  *
25  * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT
26  * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
27  * WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS
28  * FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO
29  * EVENT SHALL LICENSOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL,
30  * INDIRECT OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA,
31  * COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR
32  * SERVICES, ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT
33  * LIMITED TO ANY DEFENSE THEREOF), ANY CLAIMS FOR INDEMNITY OR
34  * CONTRIBUTION, OR OTHER SIMILAR COSTS, WHETHER ASSERTED ON THE
35  * BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE), BREACH OF
36  * WARRANTY, OR OTHERWISE.
37  *
38  *********************************************************************/
39 
40 
41 #ifndef YOCTO_WAKEUPSCHEDULE_H
42 #define YOCTO_WAKEUPSCHEDULE_H
43 
44 #include "yocto_api.h"
45 #include <cfloat>
46 #include <cmath>
47 #include <map>
48 
49 //--- (YWakeUpSchedule return codes)
50 //--- (end of YWakeUpSchedule return codes)
51 //--- (YWakeUpSchedule definitions)
52 class YWakeUpSchedule; // forward declaration
53 
54 typedef void (*YWakeUpScheduleValueCallback)(YWakeUpSchedule *func, const string& functionValue);
55 #define Y_MINUTESA_INVALID (YAPI_INVALID_UINT)
56 #define Y_MINUTESB_INVALID (YAPI_INVALID_UINT)
57 #define Y_HOURS_INVALID (YAPI_INVALID_UINT)
58 #define Y_WEEKDAYS_INVALID (YAPI_INVALID_UINT)
59 #define Y_MONTHDAYS_INVALID (YAPI_INVALID_UINT)
60 #define Y_MONTHS_INVALID (YAPI_INVALID_UINT)
61 #define Y_NEXTOCCURENCE_INVALID (YAPI_INVALID_LONG)
62 //--- (end of YWakeUpSchedule definitions)
63 
64 //--- (YWakeUpSchedule declaration)
73 #ifdef __BORLANDC__
74 #pragma option push -w-8022
75 #endif
76 //--- (end of YWakeUpSchedule declaration)
77 protected:
78  //--- (YWakeUpSchedule attributes)
79  // Attributes (function value cache)
80  int _minutesA;
81  int _minutesB;
82  int _hours;
83  int _weekDays;
85  int _months;
88 
89  friend YWakeUpSchedule *yFindWakeUpSchedule(const string& func);
91 
92  // Function-specific method for parsing of JSON output and caching result
93  virtual int _parseAttr(YJSONObject* json_val);
94 
95  // Constructor is protected, use yFindWakeUpSchedule factory function to instantiate
96  YWakeUpSchedule(const string& func);
97  //--- (end of YWakeUpSchedule attributes)
98 
99 public:
100  ~YWakeUpSchedule();
101  //--- (YWakeUpSchedule accessors declaration)
102 
103  static const int MINUTESA_INVALID = YAPI_INVALID_UINT;
104  static const int MINUTESB_INVALID = YAPI_INVALID_UINT;
105  static const int HOURS_INVALID = YAPI_INVALID_UINT;
106  static const int WEEKDAYS_INVALID = YAPI_INVALID_UINT;
107  static const int MONTHDAYS_INVALID = YAPI_INVALID_UINT;
108  static const int MONTHS_INVALID = YAPI_INVALID_UINT;
109  static const s64 NEXTOCCURENCE_INVALID = YAPI_INVALID_LONG;
110 
118  int get_minutesA(void);
119 
120  inline int minutesA(void)
121  { return this->get_minutesA(); }
122 
132  int set_minutesA(int newval);
133  inline int setMinutesA(int newval)
134  { return this->set_minutesA(newval); }
135 
143  int get_minutesB(void);
144 
145  inline int minutesB(void)
146  { return this->get_minutesB(); }
147 
157  int set_minutesB(int newval);
158  inline int setMinutesB(int newval)
159  { return this->set_minutesB(newval); }
160 
168  int get_hours(void);
169 
170  inline int hours(void)
171  { return this->get_hours(); }
172 
182  int set_hours(int newval);
183  inline int setHours(int newval)
184  { return this->set_hours(newval); }
185 
193  int get_weekDays(void);
194 
195  inline int weekDays(void)
196  { return this->get_weekDays(); }
197 
207  int set_weekDays(int newval);
208  inline int setWeekDays(int newval)
209  { return this->set_weekDays(newval); }
210 
218  int get_monthDays(void);
219 
220  inline int monthDays(void)
221  { return this->get_monthDays(); }
222 
232  int set_monthDays(int newval);
233  inline int setMonthDays(int newval)
234  { return this->set_monthDays(newval); }
235 
243  int get_months(void);
244 
245  inline int months(void)
246  { return this->get_months(); }
247 
257  int set_months(int newval);
258  inline int setMonths(int newval)
259  { return this->set_months(newval); }
260 
268  s64 get_nextOccurence(void);
269 
270  inline s64 nextOccurence(void)
271  { return this->get_nextOccurence(); }
272 
300  static YWakeUpSchedule* FindWakeUpSchedule(string func);
301 
315 
316  virtual int _invokeValueCallback(string value);
317 
321  virtual s64 get_minutes(void);
322 
332  virtual int set_minutes(s64 bitmap);
333 
334 
335  inline static YWakeUpSchedule* Find(string func)
336  { return YWakeUpSchedule::FindWakeUpSchedule(func); }
337 
345  YWakeUpSchedule *nextWakeUpSchedule(void);
346  inline YWakeUpSchedule *next(void)
347  { return this->nextWakeUpSchedule();}
348 
358  static YWakeUpSchedule* FirstWakeUpSchedule(void);
359  inline static YWakeUpSchedule* First(void)
361 #ifdef __BORLANDC__
362 #pragma option pop
363 #endif
364  //--- (end of YWakeUpSchedule accessors declaration)
365 };
366 
367 //--- (YWakeUpSchedule functions declaration)
368 
396 inline YWakeUpSchedule* yFindWakeUpSchedule(const string& func)
409 
410 //--- (end of YWakeUpSchedule functions declaration)
411 
412 #endif
static YWakeUpSchedule * FindWakeUpSchedule(string func)
YWakeUpSchedule * yFindWakeUpSchedule(const string &func)
#define YAPI_INVALID_LONG
Definition: yocto_api.h:72
YWakeUpScheduleValueCallback _valueCallbackWakeUpSchedule
int setMinutesA(int newval)
#define YAPI_INVALID_UINT
Definition: yocto_api.h:71
int setWeekDays(int newval)
virtual int _parseAttr(YJSONObject *json_val)
Definition: yocto_api.cpp:2367
YWakeUpSchedule * yFirstWakeUpSchedule(void)
void(* YWakeUpScheduleValueCallback)(YWakeUpSchedule *func, const string &functionValue)
int setHours(int newval)
int setMonths(int newval)
YWakeUpSchedule * next(void)
virtual int registerValueCallback(YFunctionValueCallback callback)
Definition: yocto_api.cpp:2544
#define YOCTO_CLASS_EXPORT
Definition: yocto_api.h:61
int setMinutesB(int newval)
static YWakeUpSchedule * FirstWakeUpSchedule(void)
static YWakeUpSchedule * First(void)
static YWakeUpSchedule * Find(string func)
int setMonthDays(int newval)
virtual int _invokeValueCallback(string value)
Definition: yocto_api.cpp:2563


yoctopuce_altimeter
Author(s): Anja Sheppard
autogenerated on Mon Jun 10 2019 15:49:11