yocto_voc.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * $Id: yocto_voc.h 28748 2017-10-03 08:23:39Z seb $
4  *
5  * Declares yFindVoc(), the high-level API for Voc 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_VOC_H
42 #define YOCTO_VOC_H
43 
44 #include "yocto_api.h"
45 #include <cfloat>
46 #include <cmath>
47 #include <map>
48 
49 //--- (YVoc return codes)
50 //--- (end of YVoc return codes)
51 //--- (YVoc definitions)
52 class YVoc; // forward declaration
53 
54 typedef void (*YVocValueCallback)(YVoc *func, const string& functionValue);
55 class YMeasure; // forward declaration
56 typedef void (*YVocTimedReportCallback)(YVoc *func, YMeasure measure);
57 //--- (end of YVoc definitions)
58 
59 //--- (YVoc declaration)
68 #ifdef __BORLANDC__
69 #pragma option push -w-8022
70 #endif
71 //--- (end of YVoc declaration)
72 protected:
73  //--- (YVoc attributes)
74  // Attributes (function value cache)
77 
78  friend YVoc *yFindVoc(const string& func);
79  friend YVoc *yFirstVoc(void);
80 
81  // Constructor is protected, use yFindVoc factory function to instantiate
82  YVoc(const string& func);
83  //--- (end of YVoc attributes)
84 
85 public:
86  ~YVoc();
87  //--- (YVoc accessors declaration)
88 
89 
117  static YVoc* FindVoc(string func);
118 
130  virtual int registerValueCallback(YVocValueCallback callback);
132 
133  virtual int _invokeValueCallback(string value);
134 
148 
149  virtual int _invokeTimedReportCallback(YMeasure value);
150 
151 
152  inline static YVoc* Find(string func)
153  { return YVoc::FindVoc(func); }
154 
162  YVoc *nextVoc(void);
163  inline YVoc *next(void)
164  { return this->nextVoc();}
165 
175  static YVoc* FirstVoc(void);
176  inline static YVoc* First(void)
177  { return YVoc::FirstVoc();}
178 #ifdef __BORLANDC__
179 #pragma option pop
180 #endif
181  //--- (end of YVoc accessors declaration)
182 };
183 
184 //--- (YVoc functions declaration)
185 
213 inline YVoc* yFindVoc(const string& func)
214 { return YVoc::FindVoc(func);}
224 inline YVoc* yFirstVoc(void)
225 { return YVoc::FirstVoc();}
226 
227 //--- (end of YVoc functions declaration)
228 
229 #endif
YVocTimedReportCallback _timedReportCallbackVoc
Definition: yocto_voc.h:76
static YVoc * FirstVoc(void)
Definition: yocto_voc.cpp:201
void(* YVocValueCallback)(YVoc *func, const string &functionValue)
Definition: yocto_voc.h:54
void(* YVocTimedReportCallback)(YVoc *func, YMeasure measure)
Definition: yocto_voc.h:56
YVoc * yFirstVoc(void)
Definition: yocto_voc.h:224
static YVoc * First(void)
Definition: yocto_voc.h:176
YVoc * yFindVoc(const string &func)
Definition: yocto_voc.h:213
virtual int registerTimedReportCallback(YSensorTimedReportCallback callback)
Definition: yocto_api.cpp:7923
virtual int _invokeTimedReportCallback(YMeasure value)
Definition: yocto_api.cpp:7936
virtual int _invokeValueCallback(string value)
Definition: yocto_api.cpp:7645
static YVoc * Find(string func)
Definition: yocto_voc.h:152
virtual int registerValueCallback(YSensorValueCallback callback)
Definition: yocto_api.cpp:7626
#define YOCTO_CLASS_EXPORT
Definition: yocto_api.h:61
Definition: yocto_voc.h:67
YVocValueCallback _valueCallbackVoc
Definition: yocto_voc.h:75
static YVoc * FindVoc(string func)
Definition: yocto_voc.cpp:96
YVoc * next(void)
Definition: yocto_voc.h:163


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