classhueplusplus_1_1_createable_resource_list.html 14.3 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::CreateableResourceList&lt; BaseResourceList, CreateType &gt; Class Template 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_createable_resource_list.html">CreateableResourceList</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="classhueplusplus_1_1_createable_resource_list-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">hueplusplus::CreateableResourceList&lt; BaseResourceList, CreateType &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Handles a <a class="el" href="classhueplusplus_1_1_resource_list.html" title="Handles a list of a certain API resource. ">ResourceList</a> where Resources can be added by the user.  
 <a href="classhueplusplus_1_1_createable_resource_list.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_resource_list_8h_source.html">hueplusplus/ResourceList.h</a>&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for hueplusplus::CreateableResourceList&lt; BaseResourceList, CreateType &gt;:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="classhueplusplus_1_1_createable_resource_list__inherit__graph.png" border="0" usemap="#hueplusplus_1_1_createable_resource_list_3_01_base_resource_list_00_01_create_type_01_4_inherit__map" alt="Inheritance graph"/></div>
<map name="hueplusplus_1_1_createable_resource_list_3_01_base_resource_list_00_01_create_type_01_4_inherit__map" id="hueplusplus_1_1_createable_resource_list_3_01_base_resource_list_00_01_create_type_01_4_inherit__map">
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div id="dynsection-1" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-1-trigger" src="closed.png" alt="+"/> Collaboration diagram for hueplusplus::CreateableResourceList&lt; BaseResourceList, CreateType &gt;:</div>
<div id="dynsection-1-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-1-content" class="dyncontent" style="display:none;">
<div class="center"><img src="classhueplusplus_1_1_createable_resource_list__coll__graph.png" border="0" usemap="#hueplusplus_1_1_createable_resource_list_3_01_base_resource_list_00_01_create_type_01_4_coll__map" alt="Collaboration graph"/></div>
<map name="hueplusplus_1_1_createable_resource_list_3_01_base_resource_list_00_01_create_type_01_4_coll__map" id="hueplusplus_1_1_createable_resource_list_3_01_base_resource_list_00_01_create_type_01_4_coll__map">
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<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:abf886bbd80f86e00a66c7ad61bd773c9"><td class="memItemLeft" align="right" valign="top">BaseResourceList::IdType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_createable_resource_list.html#abf886bbd80f86e00a66c7ad61bd773c9">create</a> (const CreateType &amp;params)</td></tr>
<tr class="memdesc:abf886bbd80f86e00a66c7ad61bd773c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new resource.  <a href="#abf886bbd80f86e00a66c7ad61bd773c9">More...</a><br /></td></tr>
<tr class="separator:abf886bbd80f86e00a66c7ad61bd773c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:aeb4f83610cae0670890bf7bb3649e9fb"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_createable_resource_list.html#aeb4f83610cae0670890bf7bb3649e9fb">CreateableResourceList</a> (<a class="el" href="classhueplusplus_1_1_createable_resource_list.html">CreateableResourceList</a> &amp;&amp;)=default</td></tr>
<tr class="memdesc:aeb4f83610cae0670890bf7bb3649e9fb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Protected defaulted move constructor.  <a href="#aeb4f83610cae0670890bf7bb3649e9fb">More...</a><br /></td></tr>
<tr class="separator:aeb4f83610cae0670890bf7bb3649e9fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adfba6867594c38e7df0de20cf143ab38"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classhueplusplus_1_1_createable_resource_list.html">CreateableResourceList</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classhueplusplus_1_1_createable_resource_list.html#adfba6867594c38e7df0de20cf143ab38">operator=</a> (<a class="el" href="classhueplusplus_1_1_createable_resource_list.html">CreateableResourceList</a> &amp;&amp;)=default</td></tr>
<tr class="memdesc:adfba6867594c38e7df0de20cf143ab38"><td class="mdescLeft">&#160;</td><td class="mdescRight">Protected defaulted move assignment.  <a href="#adfba6867594c38e7df0de20cf143ab38">More...</a><br /></td></tr>
<tr class="separator:adfba6867594c38e7df0de20cf143ab38"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename BaseResourceList, typename CreateType&gt;<br />
class hueplusplus::CreateableResourceList&lt; BaseResourceList, CreateType &gt;</h3>

<p>Handles a <a class="el" href="classhueplusplus_1_1_resource_list.html" title="Handles a list of a certain API resource. ">ResourceList</a> where Resources can be added by the user. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">BaseResourceList</td><td>Base resource list type (<a class="el" href="classhueplusplus_1_1_resource_list.html" title="Handles a list of a certain API resource. ">ResourceList</a> or <a class="el" href="classhueplusplus_1_1_searchable_resource_list.html" title="Handles a ResourceList of physical devices which can be searched for. ">SearchableResourceList</a>). </td></tr>
    <tr><td class="paramname">CreateType</td><td>Type that provides parameters for creation. Must have a const getRequest() function returning the JSON for the POST request. </td></tr>
  </table>
  </dd>
</dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="aeb4f83610cae0670890bf7bb3649e9fb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeb4f83610cae0670890bf7bb3649e9fb">&#9670;&nbsp;</a></span>CreateableResourceList()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename BaseResourceList, typename CreateType&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classhueplusplus_1_1_createable_resource_list.html">hueplusplus::CreateableResourceList</a>&lt; BaseResourceList, CreateType &gt;::<a class="el" href="classhueplusplus_1_1_createable_resource_list.html">CreateableResourceList</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classhueplusplus_1_1_createable_resource_list.html">CreateableResourceList</a>&lt; BaseResourceList, CreateType &gt; &amp;&amp;&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">default</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Protected defaulted move constructor. </p>

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

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename BaseResourceList, typename CreateType&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">BaseResourceList::IdType <a class="el" href="classhueplusplus_1_1_createable_resource_list.html">hueplusplus::CreateableResourceList</a>&lt; BaseResourceList, CreateType &gt;::create </td>
          <td>(</td>
          <td class="paramtype">const CreateType &amp;&#160;</td>
          <td class="paramname"><em>params</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Create a new resource. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">params</td><td>Parameters for the new resource </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The id of the created resource or 0/an empty string if failed. </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::system_error</td><td>when system or socket operations fail </td></tr>
    <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 response contains no body </td></tr>
    <tr><td class="paramname"><a class="el" href="classhueplusplus_1_1_hue_a_p_i_response_exception.html" title="Exception caused by a Hue API &quot;error&quot; response with additional information. ">HueAPIResponseException</a></td><td>when response contains an error </td></tr>
    <tr><td class="paramname">nlohmann::json::parse_error</td><td>when response could not be parsed </td></tr>
    <tr><td class="paramname">std::invalid_argument</td><td>when IdType is int and std::stoi fails </td></tr>
  </table>
  </dd>
</dl>

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

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename BaseResourceList, typename CreateType&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classhueplusplus_1_1_createable_resource_list.html">CreateableResourceList</a>&amp; <a class="el" href="classhueplusplus_1_1_createable_resource_list.html">hueplusplus::CreateableResourceList</a>&lt; BaseResourceList, CreateType &gt;::operator= </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classhueplusplus_1_1_createable_resource_list.html">CreateableResourceList</a>&lt; BaseResourceList, CreateType &gt; &amp;&amp;&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">default</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Protected defaulted move assignment. </p>

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