classhueplusplus_1_1_action.html 17.6 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::Action 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_action.html">Action</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_action-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">hueplusplus::Action Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><a class="el" href="classhueplusplus_1_1_action.html" title="Action executed by the bridge, e.g. as a Schedule command. ">Action</a> executed by the bridge, e.g. as a <a class="el" href="classhueplusplus_1_1_schedule.html" title="Schedule stored in the bridge. ">Schedule</a> command.  
 <a href="classhueplusplus_1_1_action.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_action_8h_source.html">hueplusplus/Action.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:a2181208d0b6e26bdb84e594af85b1542"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_action.html#a2181208d0b6e26bdb84e594af85b1542">Method</a> { <a class="el" href="classhueplusplus_1_1_action.html#a2181208d0b6e26bdb84e594af85b1542a42b90196b487c54069097a68fe98ab6f">Method::post</a>, 
<a class="el" href="classhueplusplus_1_1_action.html#a2181208d0b6e26bdb84e594af85b1542a8e13ffc9fd9d6a6761231a764bdf106b">Method::put</a>, 
<a class="el" href="classhueplusplus_1_1_action.html#a2181208d0b6e26bdb84e594af85b1542abd269368d92362975c0ab1bb7b461813">Method::deleteMethod</a>
 }<tr class="memdesc:a2181208d0b6e26bdb84e594af85b1542"><td class="mdescLeft">&#160;</td><td class="mdescRight">Method used for the command.  <a href="classhueplusplus_1_1_action.html#a2181208d0b6e26bdb84e594af85b1542">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:a2181208d0b6e26bdb84e594af85b1542"><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:a581153171ecf44ce583e088c9bd6f048"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_action.html#a581153171ecf44ce583e088c9bd6f048">Action</a> (const nlohmann::json &amp;json)</td></tr>
<tr class="memdesc:a581153171ecf44ce583e088c9bd6f048"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create <a class="el" href="classhueplusplus_1_1_action.html" title="Action executed by the bridge, e.g. as a Schedule command. ">Action</a> from json.  <a href="#a581153171ecf44ce583e088c9bd6f048">More...</a><br /></td></tr>
<tr class="separator:a581153171ecf44ce583e088c9bd6f048"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a258c2d4a88d5eed9dc85a2539fbcbd71"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_action.html#a258c2d4a88d5eed9dc85a2539fbcbd71">getAddress</a> () const</td></tr>
<tr class="memdesc:a258c2d4a88d5eed9dc85a2539fbcbd71"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get address the request is made to.  <a href="#a258c2d4a88d5eed9dc85a2539fbcbd71">More...</a><br /></td></tr>
<tr class="separator:a258c2d4a88d5eed9dc85a2539fbcbd71"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a65f0cf2fb01397e023b1098aae2e8184"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classhueplusplus_1_1_action.html#a2181208d0b6e26bdb84e594af85b1542">Method</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_action.html#a65f0cf2fb01397e023b1098aae2e8184">getMethod</a> () const</td></tr>
<tr class="memdesc:a65f0cf2fb01397e023b1098aae2e8184"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get request method.  <a href="#a65f0cf2fb01397e023b1098aae2e8184">More...</a><br /></td></tr>
<tr class="separator:a65f0cf2fb01397e023b1098aae2e8184"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25e3761540d73055114b68c931353b72"><td class="memItemLeft" align="right" valign="top">const nlohmann::json &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_action.html#a25e3761540d73055114b68c931353b72">getBody</a> () const</td></tr>
<tr class="memdesc:a25e3761540d73055114b68c931353b72"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get request body.  <a href="#a25e3761540d73055114b68c931353b72">More...</a><br /></td></tr>
<tr class="separator:a25e3761540d73055114b68c931353b72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6de75285262d49b6ffb7edd4051cf6f3"><td class="memItemLeft" align="right" valign="top">const nlohmann::json &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_action.html#a6de75285262d49b6ffb7edd4051cf6f3">toJson</a> () const</td></tr>
<tr class="memdesc:a6de75285262d49b6ffb7edd4051cf6f3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get json object of command.  <a href="#a6de75285262d49b6ffb7edd4051cf6f3">More...</a><br /></td></tr>
<tr class="separator:a6de75285262d49b6ffb7edd4051cf6f3"><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:a51b50bd1b0b8dd3641a42218abb9f24e"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classhueplusplus_1_1_action.html#a2181208d0b6e26bdb84e594af85b1542">Method</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_action.html#a51b50bd1b0b8dd3641a42218abb9f24e">parseMethod</a> (const std::string &amp;s)</td></tr>
<tr class="memdesc:a51b50bd1b0b8dd3641a42218abb9f24e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse Method from string.  <a href="#a51b50bd1b0b8dd3641a42218abb9f24e">More...</a><br /></td></tr>
<tr class="separator:a51b50bd1b0b8dd3641a42218abb9f24e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a758c2ebb8875022fffca68c5b6a3c2d5"><td class="memItemLeft" align="right" valign="top">static std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_action.html#a758c2ebb8875022fffca68c5b6a3c2d5">methodToString</a> (<a class="el" href="classhueplusplus_1_1_action.html#a2181208d0b6e26bdb84e594af85b1542">Method</a> m)</td></tr>
<tr class="memdesc:a758c2ebb8875022fffca68c5b6a3c2d5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get string from Method.  <a href="#a758c2ebb8875022fffca68c5b6a3c2d5">More...</a><br /></td></tr>
<tr class="separator:a758c2ebb8875022fffca68c5b6a3c2d5"><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_action.html" title="Action executed by the bridge, e.g. as a Schedule command. ">Action</a> executed by the bridge, e.g. as a <a class="el" href="classhueplusplus_1_1_schedule.html" title="Schedule stored in the bridge. ">Schedule</a> command. </p>
<p>The action makes either a POST, PUT or DELETE request with a given body to an address on the bridge.</p>
<p>The <a class="el" href="classhueplusplus_1_1_action.html" title="Action executed by the bridge, e.g. as a Schedule command. ">Action</a> can also be created by <a class="el" href="classhueplusplus_1_1_state_transaction.html#a44db927471c11bab402e9a295014adff" title="Create an Action from the transaction. ">StateTransaction::toAction()</a>. </p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="a2181208d0b6e26bdb84e594af85b1542"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2181208d0b6e26bdb84e594af85b1542">&#9670;&nbsp;</a></span>Method</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_action.html#a2181208d0b6e26bdb84e594af85b1542">hueplusplus::Action::Method</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>Method used for the command. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a2181208d0b6e26bdb84e594af85b1542a42b90196b487c54069097a68fe98ab6f"></a>post&#160;</td><td class="fielddoc"><p>POST request. </p>
</td></tr>
<tr><td class="fieldname"><a id="a2181208d0b6e26bdb84e594af85b1542a8e13ffc9fd9d6a6761231a764bdf106b"></a>put&#160;</td><td class="fielddoc"><p>PUT request. </p>
</td></tr>
<tr><td class="fieldname"><a id="a2181208d0b6e26bdb84e594af85b1542abd269368d92362975c0ab1bb7b461813"></a>deleteMethod&#160;</td><td class="fielddoc"><p>DELETE request. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a581153171ecf44ce583e088c9bd6f048"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a581153171ecf44ce583e088c9bd6f048">&#9670;&nbsp;</a></span>Action()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">hueplusplus::Action::Action </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">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Create <a class="el" href="classhueplusplus_1_1_action.html" title="Action executed by the bridge, e.g. as a Schedule command. ">Action</a> from json. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">json</td><td>JSON object with address, method and body </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a258c2d4a88d5eed9dc85a2539fbcbd71"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a258c2d4a88d5eed9dc85a2539fbcbd71">&#9670;&nbsp;</a></span>getAddress()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string hueplusplus::Action::getAddress </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get address the request is made to. </p>

</div>
</div>
<a id="a25e3761540d73055114b68c931353b72"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a25e3761540d73055114b68c931353b72">&#9670;&nbsp;</a></span>getBody()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const nlohmann::json &amp; hueplusplus::Action::getBody </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get request body. </p>

</div>
</div>
<a id="a65f0cf2fb01397e023b1098aae2e8184"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a65f0cf2fb01397e023b1098aae2e8184">&#9670;&nbsp;</a></span>getMethod()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classhueplusplus_1_1_action.html#a2181208d0b6e26bdb84e594af85b1542">Action::Method</a> hueplusplus::Action::getMethod </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get request method. </p>

</div>
</div>
<a id="a758c2ebb8875022fffca68c5b6a3c2d5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a758c2ebb8875022fffca68c5b6a3c2d5">&#9670;&nbsp;</a></span>methodToString()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::string hueplusplus::Action::methodToString </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classhueplusplus_1_1_action.html#a2181208d0b6e26bdb84e594af85b1542">Method</a>&#160;</td>
          <td class="paramname"><em>m</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>Get string from Method. </p>
<dl class="section return"><dt>Returns</dt><dd><code>POST</code>, <code>PUT</code> or <code>DELETE</code> </dd></dl>

</div>
</div>
<a id="a51b50bd1b0b8dd3641a42218abb9f24e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a51b50bd1b0b8dd3641a42218abb9f24e">&#9670;&nbsp;</a></span>parseMethod()</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_action.html#a2181208d0b6e26bdb84e594af85b1542">Action::Method</a> hueplusplus::Action::parseMethod </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>s</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 Method from string. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td><code>POST</code>, <code>PUT</code> or <code>DELETE</code> </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a6de75285262d49b6ffb7edd4051cf6f3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6de75285262d49b6ffb7edd4051cf6f3">&#9670;&nbsp;</a></span>toJson()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const nlohmann::json &amp; hueplusplus::Action::toJson </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get json object of command. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>include/hueplusplus/<a class="el" href="_action_8h_source.html">Action.h</a></li>
<li>src/<a class="el" href="_action_8cpp.html">Action.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>