classhueplusplus_1_1_condition.html
19.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>hueplusplus: hueplusplus::Condition Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">hueplusplus
 <span id="projectnumber">1.0.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacehueplusplus.html">hueplusplus</a></li><li class="navelem"><a class="el" href="classhueplusplus_1_1_condition.html">Condition</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> |
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="classhueplusplus_1_1_condition-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">hueplusplus::Condition Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><a class="el" href="classhueplusplus_1_1_condition.html" title="Condition for a Rule. ">Condition</a> for a <a class="el" href="classhueplusplus_1_1_rule.html" title="Rule stored in the bridge. ">Rule</a>.
<a href="classhueplusplus_1_1_condition.html#details">More...</a></p>
<p><code>#include <<a class="el" href="_condition_8h_source.html">hueplusplus/Condition.h</a>></code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a8a66cda007f5cf01934f71c02c03cf35"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_condition.html#a8a66cda007f5cf01934f71c02c03cf35">Operator</a> { <br />
  <a class="el" href="classhueplusplus_1_1_condition.html#a8a66cda007f5cf01934f71c02c03cf35adf22f17124884fc51f1ac69d610096ac">Operator::eq</a>,
<a class="el" href="classhueplusplus_1_1_condition.html#a8a66cda007f5cf01934f71c02c03cf35a1bfad22f0925978f310a37440bfdff43">Operator::gt</a>,
<a class="el" href="classhueplusplus_1_1_condition.html#a8a66cda007f5cf01934f71c02c03cf35ad91af6958918af87d6a057c1cdf5b225">Operator::lt</a>,
<a class="el" href="classhueplusplus_1_1_condition.html#a8a66cda007f5cf01934f71c02c03cf35aacd2b09d39705a84bff035c18c9faea9">Operator::dx</a>,
<br />
  <a class="el" href="classhueplusplus_1_1_condition.html#a8a66cda007f5cf01934f71c02c03cf35a49d3650727f25f1831b88d97028cf8b4">Operator::ddx</a>,
<a class="el" href="classhueplusplus_1_1_condition.html#a8a66cda007f5cf01934f71c02c03cf35af40faf6384fc85a33d3b05a9d41c012b">Operator::stable</a>,
<a class="el" href="classhueplusplus_1_1_condition.html#a8a66cda007f5cf01934f71c02c03cf35ad0bd4c0424231a1c79762fc43ec24db9">Operator::notStable</a>,
<a class="el" href="classhueplusplus_1_1_condition.html#a8a66cda007f5cf01934f71c02c03cf35a13b5bfe96f3e2fe411c9f66f4a582adf">Operator::in</a>,
<br />
  <a class="el" href="classhueplusplus_1_1_condition.html#a8a66cda007f5cf01934f71c02c03cf35af3b45b74588c59c7ffc26692135ae58c">Operator::notIn</a>
<br />
}<tr class="memdesc:a8a66cda007f5cf01934f71c02c03cf35"><td class="mdescLeft"> </td><td class="mdescRight">Specifies which operation is used to check the condition. <a href="classhueplusplus_1_1_condition.html#a8a66cda007f5cf01934f71c02c03cf35">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:a8a66cda007f5cf01934f71c02c03cf35"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a14c0d2560c50eb6dc36b44bb825d3c82"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_condition.html#a14c0d2560c50eb6dc36b44bb825d3c82">Condition</a> (const std::string &address, <a class="el" href="classhueplusplus_1_1_condition.html#a8a66cda007f5cf01934f71c02c03cf35">Operator</a> op, const std::string &value)</td></tr>
<tr class="memdesc:a14c0d2560c50eb6dc36b44bb825d3c82"><td class="mdescLeft"> </td><td class="mdescRight">Create a condition from any address on the bridge. <a href="#a14c0d2560c50eb6dc36b44bb825d3c82">More...</a><br /></td></tr>
<tr class="separator:a14c0d2560c50eb6dc36b44bb825d3c82"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a31f46f01e55a3e75b5136e7f4a02bee1"><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_condition.html#a31f46f01e55a3e75b5136e7f4a02bee1">getAddress</a> () const</td></tr>
<tr class="memdesc:a31f46f01e55a3e75b5136e7f4a02bee1"><td class="mdescLeft"> </td><td class="mdescRight">Get address on the bridge. <a href="#a31f46f01e55a3e75b5136e7f4a02bee1">More...</a><br /></td></tr>
<tr class="separator:a31f46f01e55a3e75b5136e7f4a02bee1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a87c67b3fbcbde2310e651b4229fbafaf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classhueplusplus_1_1_condition.html#a8a66cda007f5cf01934f71c02c03cf35">Operator</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_condition.html#a87c67b3fbcbde2310e651b4229fbafaf">getOperator</a> () const</td></tr>
<tr class="memdesc:a87c67b3fbcbde2310e651b4229fbafaf"><td class="mdescLeft"> </td><td class="mdescRight">Get used operator. <a href="#a87c67b3fbcbde2310e651b4229fbafaf">More...</a><br /></td></tr>
<tr class="separator:a87c67b3fbcbde2310e651b4229fbafaf"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5c7b9db9d34eeef8e9e44630c374c8c8"><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_condition.html#a5c7b9db9d34eeef8e9e44630c374c8c8">getValue</a> () const</td></tr>
<tr class="memdesc:a5c7b9db9d34eeef8e9e44630c374c8c8"><td class="mdescLeft"> </td><td class="mdescRight">Get value the attribute is checked against. <a href="#a5c7b9db9d34eeef8e9e44630c374c8c8">More...</a><br /></td></tr>
<tr class="separator:a5c7b9db9d34eeef8e9e44630c374c8c8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3d1d808aadd6f241f2210ff2a0b90024"><td class="memItemLeft" align="right" valign="top">nlohmann::json </td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_condition.html#a3d1d808aadd6f241f2210ff2a0b90024">toJson</a> () const</td></tr>
<tr class="memdesc:a3d1d808aadd6f241f2210ff2a0b90024"><td class="mdescLeft"> </td><td class="mdescRight">Create the json form of the condition. <a href="#a3d1d808aadd6f241f2210ff2a0b90024">More...</a><br /></td></tr>
<tr class="separator:a3d1d808aadd6f241f2210ff2a0b90024"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a838c40cffaa7fd37d2874d35fe951f0a"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classhueplusplus_1_1_condition.html">Condition</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_condition.html#a838c40cffaa7fd37d2874d35fe951f0a">parse</a> (const nlohmann::json &json)</td></tr>
<tr class="memdesc:a838c40cffaa7fd37d2874d35fe951f0a"><td class="mdescLeft"> </td><td class="mdescRight">Parse condition from json value. <a href="#a838c40cffaa7fd37d2874d35fe951f0a">More...</a><br /></td></tr>
<tr class="separator:a838c40cffaa7fd37d2874d35fe951f0a"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classhueplusplus_1_1_condition.html" title="Condition for a Rule. ">Condition</a> for a <a class="el" href="classhueplusplus_1_1_rule.html" title="Rule stored in the bridge. ">Rule</a>. </p>
<p>The condition checks whether a resource attribute (usually a <a class="el" href="classhueplusplus_1_1_sensor.html" title="Class for generic or unknown sensor types. ">Sensor</a> value) matches the specified Operator.</p>
<p>Conditions from sensors can be created more easily using the <a class="el" href="namespacehueplusplus_1_1sensors.html#a06dd5755779d2fc8df7108940319f7df">makeCondition()</a> helper functions. </p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="a8a66cda007f5cf01934f71c02c03cf35"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8a66cda007f5cf01934f71c02c03cf35">◆ </a></span>Operator</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="classhueplusplus_1_1_condition.html#a8a66cda007f5cf01934f71c02c03cf35">hueplusplus::Condition::Operator</a></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">strong</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Specifies which operation is used to check the condition. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a8a66cda007f5cf01934f71c02c03cf35adf22f17124884fc51f1ac69d610096ac"></a>eq </td><td class="fielddoc"><p>Attribute is equal to specified value (for bool and int) </p>
</td></tr>
<tr><td class="fieldname"><a id="a8a66cda007f5cf01934f71c02c03cf35a1bfad22f0925978f310a37440bfdff43"></a>gt </td><td class="fielddoc"><p>Attribute is greater than specified value (for int) </p>
</td></tr>
<tr><td class="fieldname"><a id="a8a66cda007f5cf01934f71c02c03cf35ad91af6958918af87d6a057c1cdf5b225"></a>lt </td><td class="fielddoc"><p>Attribute is less than specified value (for int) </p>
</td></tr>
<tr><td class="fieldname"><a id="a8a66cda007f5cf01934f71c02c03cf35aacd2b09d39705a84bff035c18c9faea9"></a>dx </td><td class="fielddoc"><p>Attribute has changed (no value given) </p>
</td></tr>
<tr><td class="fieldname"><a id="a8a66cda007f5cf01934f71c02c03cf35a49d3650727f25f1831b88d97028cf8b4"></a>ddx </td><td class="fielddoc"><p>Delayed attribute has changed (no value given) </p>
</td></tr>
<tr><td class="fieldname"><a id="a8a66cda007f5cf01934f71c02c03cf35af40faf6384fc85a33d3b05a9d41c012b"></a>stable </td><td class="fielddoc"><p>Stable for a given time. Does not trigger a rule change. </p>
</td></tr>
<tr><td class="fieldname"><a id="a8a66cda007f5cf01934f71c02c03cf35ad0bd4c0424231a1c79762fc43ec24db9"></a>notStable </td><td class="fielddoc"><p>Not stable for a given time. Does not trigger a rule change. </p>
</td></tr>
<tr><td class="fieldname"><a id="a8a66cda007f5cf01934f71c02c03cf35a13b5bfe96f3e2fe411c9f66f4a582adf"></a>in </td><td class="fielddoc"><p>Time is in the given interval (triggered on start time, local time) </p>
</td></tr>
<tr><td class="fieldname"><a id="a8a66cda007f5cf01934f71c02c03cf35af3b45b74588c59c7ffc26692135ae58c"></a>notIn </td><td class="fielddoc"><p>Time is not in the interval (triggered on end time, local time) </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a id="a14c0d2560c50eb6dc36b44bb825d3c82"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a14c0d2560c50eb6dc36b44bb825d3c82">◆ </a></span>Condition()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">hueplusplus::Condition::Condition </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"><em>address</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classhueplusplus_1_1_condition.html#a8a66cda007f5cf01934f71c02c03cf35">Operator</a> </td>
<td class="paramname"><em>op</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string & </td>
<td class="paramname"><em>value</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a condition from any address on the bridge. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">address</td><td>Path to an attribute of the bridge </td></tr>
<tr><td class="paramname">op</td><td>Operator used for comparison. </td></tr>
<tr><td class="paramname">value</td><td>String representation of the value to check against. Empty for some operators. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a31f46f01e55a3e75b5136e7f4a02bee1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a31f46f01e55a3e75b5136e7f4a02bee1">◆ </a></span>getAddress()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::string hueplusplus::Condition::getAddress </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get address on the bridge. </p>
</div>
</div>
<a id="a87c67b3fbcbde2310e651b4229fbafaf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a87c67b3fbcbde2310e651b4229fbafaf">◆ </a></span>getOperator()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classhueplusplus_1_1_condition.html#a8a66cda007f5cf01934f71c02c03cf35">Condition::Operator</a> hueplusplus::Condition::getOperator </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get used operator. </p>
</div>
</div>
<a id="a5c7b9db9d34eeef8e9e44630c374c8c8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5c7b9db9d34eeef8e9e44630c374c8c8">◆ </a></span>getValue()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::string hueplusplus::Condition::getValue </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get value the attribute is checked against. </p>
</div>
</div>
<a id="a838c40cffaa7fd37d2874d35fe951f0a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a838c40cffaa7fd37d2874d35fe951f0a">◆ </a></span>parse()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classhueplusplus_1_1_condition.html">Condition</a> hueplusplus::Condition::parse </td>
<td>(</td>
<td class="paramtype">const nlohmann::json & </td>
<td class="paramname"><em>json</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Parse condition from json value. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">json</td><td>Json object with address, operator and value </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The parsed condition with the same values </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname"><a class="el" href="classhueplusplus_1_1_hue_exception.html" title="Exception class with file information. Base class of all custom exception classes. ">HueException</a></td><td>when the operator is unknown. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a3d1d808aadd6f241f2210ff2a0b90024"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3d1d808aadd6f241f2210ff2a0b90024">◆ </a></span>toJson()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">nlohmann::json hueplusplus::Condition::toJson </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Create the json form of the condition. </p>
<dl class="section return"><dt>Returns</dt><dd>A json object with address, operator and value </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>include/hueplusplus/<a class="el" href="_condition_8h_source.html">Condition.h</a></li>
<li>src/<a class="el" href="_rule_8cpp.html">Rule.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>