yocto_oscontrol.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * $Id: yocto_oscontrol.h 28748 2017-10-03 08:23:39Z seb $
4  *
5  * Declares yFindOsControl(), the high-level API for OsControl 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_OSCONTROL_H
42 #define YOCTO_OSCONTROL_H
43 
44 #include "yocto_api.h"
45 #include <cfloat>
46 #include <cmath>
47 #include <map>
48 
49 //--- (YOsControl return codes)
50 //--- (end of YOsControl return codes)
51 //--- (YOsControl definitions)
52 class YOsControl; // forward declaration
53 
54 typedef void (*YOsControlValueCallback)(YOsControl *func, const string& functionValue);
55 #define Y_SHUTDOWNCOUNTDOWN_INVALID (YAPI_INVALID_UINT)
56 //--- (end of YOsControl definitions)
57 
58 //--- (YOsControl declaration)
67 #ifdef __BORLANDC__
68 #pragma option push -w-8022
69 #endif
70 //--- (end of YOsControl declaration)
71 protected:
72  //--- (YOsControl attributes)
73  // Attributes (function value cache)
76 
77  friend YOsControl *yFindOsControl(const string& func);
78  friend YOsControl *yFirstOsControl(void);
79 
80  // Function-specific method for parsing of JSON output and caching result
81  virtual int _parseAttr(YJSONObject* json_val);
82 
83  // Constructor is protected, use yFindOsControl factory function to instantiate
84  YOsControl(const string& func);
85  //--- (end of YOsControl attributes)
86 
87 public:
88  ~YOsControl();
89  //--- (YOsControl accessors declaration)
90 
91  static const int SHUTDOWNCOUNTDOWN_INVALID = YAPI_INVALID_UINT;
92 
102  int get_shutdownCountdown(void);
103 
104  inline int shutdownCountdown(void)
105  { return this->get_shutdownCountdown(); }
106 
107  int set_shutdownCountdown(int newval);
108  inline int setShutdownCountdown(int newval)
109  { return this->set_shutdownCountdown(newval); }
110 
138  static YOsControl* FindOsControl(string func);
139 
151  virtual int registerValueCallback(YOsControlValueCallback callback);
153 
154  virtual int _invokeValueCallback(string value);
155 
165  virtual int shutdown(int secBeforeShutDown);
166 
167 
168  inline static YOsControl* Find(string func)
169  { return YOsControl::FindOsControl(func); }
170 
178  YOsControl *nextOsControl(void);
179  inline YOsControl *next(void)
180  { return this->nextOsControl();}
181 
191  static YOsControl* FirstOsControl(void);
192  inline static YOsControl* First(void)
193  { return YOsControl::FirstOsControl();}
194 #ifdef __BORLANDC__
195 #pragma option pop
196 #endif
197  //--- (end of YOsControl accessors declaration)
198 };
199 
200 //--- (YOsControl functions declaration)
201 
229 inline YOsControl* yFindOsControl(const string& func)
230 { return YOsControl::FindOsControl(func);}
241 { return YOsControl::FirstOsControl();}
242 
243 //--- (end of YOsControl functions declaration)
244 
245 #endif
YOsControl * next(void)
static YOsControl * FirstOsControl(void)
int _shutdownCountdown
static YOsControl * First(void)
YOsControl * yFirstOsControl(void)
void(* YOsControlValueCallback)(YOsControl *func, const string &functionValue)
#define YAPI_INVALID_UINT
Definition: yocto_api.h:71
static YOsControl * FindOsControl(string func)
virtual int _parseAttr(YJSONObject *json_val)
Definition: yocto_api.cpp:2367
static YOsControl * Find(string func)
virtual int registerValueCallback(YFunctionValueCallback callback)
Definition: yocto_api.cpp:2544
int setShutdownCountdown(int newval)
#define YOCTO_CLASS_EXPORT
Definition: yocto_api.h:61
ROSCONSOLE_DECL void shutdown()
int shutdownCountdown(void)
YOsControl * yFindOsControl(const string &func)
virtual int _invokeValueCallback(string value)
Definition: yocto_api.cpp:2563
YOsControlValueCallback _valueCallbackOsControl


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