classhueplusplus_1_1_condition.html 19.2 KB
<!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
   &#160;<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> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<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 &lt;<a class="el" href="_condition_8h_source.html">hueplusplus/Condition.h</a>&gt;</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 &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_condition.html#a8a66cda007f5cf01934f71c02c03cf35">Operator</a> { <br />
&#160;&#160;<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 />
&#160;&#160;<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 />
&#160;&#160;<a class="el" href="classhueplusplus_1_1_condition.html#a8a66cda007f5cf01934f71c02c03cf35af3b45b74588c59c7ffc26692135ae58c">Operator::notIn</a>
<br />
 }<tr class="memdesc:a8a66cda007f5cf01934f71c02c03cf35"><td class="mdescLeft">&#160;</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">&#160;</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">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_condition.html#a14c0d2560c50eb6dc36b44bb825d3c82">Condition</a> (const std::string &amp;address, <a class="el" href="classhueplusplus_1_1_condition.html#a8a66cda007f5cf01934f71c02c03cf35">Operator</a> op, const std::string &amp;value)</td></tr>
<tr class="memdesc:a14c0d2560c50eb6dc36b44bb825d3c82"><td class="mdescLeft">&#160;</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">&#160;</td></tr>
<tr class="memitem:a31f46f01e55a3e75b5136e7f4a02bee1"><td class="memItemLeft" align="right" valign="top">std::string&#160;</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">&#160;</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">&#160;</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>&#160;</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">&#160;</td><td class="mdescRight">Get used operator.  <a href="#a87c67b3fbcbde2310e651b4229fbafaf">More...</a><br /></td></tr>
<tr class="separator:a87c67b3fbcbde2310e651b4229fbafaf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c7b9db9d34eeef8e9e44630c374c8c8"><td class="memItemLeft" align="right" valign="top">std::string&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:a3d1d808aadd6f241f2210ff2a0b90024"><td class="memItemLeft" align="right" valign="top">nlohmann::json&#160;</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">&#160;</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">&#160;</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>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_condition.html#a838c40cffaa7fd37d2874d35fe951f0a">parse</a> (const nlohmann::json &amp;json)</td></tr>
<tr class="memdesc:a838c40cffaa7fd37d2874d35fe951f0a"><td class="mdescLeft">&#160;</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">&#160;</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">&#9670;&nbsp;</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&#160;</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&#160;</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&#160;</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&#160;</td><td class="fielddoc"><p>Attribute has changed (no value given) </p>
</td></tr>
<tr><td class="fieldname"><a id="a8a66cda007f5cf01934f71c02c03cf35a49d3650727f25f1831b88d97028cf8b4"></a>ddx&#160;</td><td class="fielddoc"><p>Delayed attribute has changed (no value given) </p>
</td></tr>
<tr><td class="fieldname"><a id="a8a66cda007f5cf01934f71c02c03cf35af40faf6384fc85a33d3b05a9d41c012b"></a>stable&#160;</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&#160;</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&#160;</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&#160;</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 &amp; Destructor Documentation</h2>
<a id="a14c0d2560c50eb6dc36b44bb825d3c82"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a14c0d2560c50eb6dc36b44bb825d3c82">&#9670;&nbsp;</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 &amp;&#160;</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>&#160;</td>
          <td class="paramname"><em>op</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>value</em>&#160;</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">&#9670;&nbsp;</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">&#9670;&nbsp;</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">&#9670;&nbsp;</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">&#9670;&nbsp;</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 &amp;&#160;</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">&#9670;&nbsp;</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 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>