oc-mint/classModel.html

327 lines
15 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>oc-issuer: Model 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">oc-issuer
&#160;<span id="projectnumber">0.0.2</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</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><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classModel-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">Model Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Inheritance diagram for Model:</div>
<div class="dyncontent">
<div class="center"><img src="classModel__inherit__graph.png" border="0" usemap="#aModel_inherit__map" alt="Inheritance graph"/></div>
<map name="aModel_inherit__map" id="aModel_inherit__map">
<area shape="rect" title=" " alt="" coords="29,5,92,32"/>
<area shape="rect" href="classDefaultModel.html" title=" " alt="" coords="5,80,116,107"/>
</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:af4e5cca587cec5d56c955a797cc4295f"><td class="memItemLeft" align="right" valign="top">virtual tl::expected&lt; <a class="el" href="structCDDC.html">CDDC</a> *, bool &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#af4e5cca587cec5d56c955a797cc4295f">get_cddc</a> (unsigned int cdd_serial)=0</td></tr>
<tr class="separator:af4e5cca587cec5d56c955a797cc4295f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a50d7fc134c43bc28045a7993ff2f2ca5"><td class="memItemLeft" align="right" valign="top">virtual tl::expected&lt; <a class="el" href="structCDDC.html">CDDC</a> *, bool &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#a50d7fc134c43bc28045a7993ff2f2ca5">get_current_cddc</a> ()=0</td></tr>
<tr class="separator:a50d7fc134c43bc28045a7993ff2f2ca5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a022e8d797bf57d111a1ce5bd229f41ea"><td class="memItemLeft" align="right" valign="top">virtual std::vector&lt; <a class="el" href="structMintKeyCert.html">MintKeyCert</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#a022e8d797bf57d111a1ce5bd229f41ea">getMKCs</a> (const std::vector&lt; unsigned int &gt; &amp;denominations, const std::vector&lt; <a class="el" href="structBigInt.html">BigInt</a> &gt; &amp;mint_key_ids)=0</td></tr>
<tr class="separator:a022e8d797bf57d111a1ce5bd229f41ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ece13ffd6258825feaaa884247ca6e2"><td class="memItemLeft" align="right" valign="top">virtual std::vector&lt; <a class="el" href="structBlindSignature.html">BlindSignature</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#a0ece13ffd6258825feaaa884247ca6e2">mint</a> (std::string const &amp;transaction_reference, const std::vector&lt; <a class="el" href="structBlind.html">Blind</a> &gt; &amp;blinds)=0</td></tr>
<tr class="separator:a0ece13ffd6258825feaaa884247ca6e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14ae6086fd6ccc2dc34714c2f976258a"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#a14ae6086fd6ccc2dc34714c2f976258a">redeem</a> (const std::vector&lt; <a class="el" href="structCoin.html">Coin</a> &gt; &amp;coins)=0</td></tr>
<tr class="separator:a14ae6086fd6ccc2dc34714c2f976258a"><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:a0f33afb8d901d61f93ed7d6f7560403a"><td class="memItemLeft" align="right" valign="top">static std::unique_ptr&lt; <a class="el" href="classModel.html">Model</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModel.html#a0f33afb8d901d61f93ed7d6f7560403a">get_model</a> (const std::string &amp;backend_name)</td></tr>
<tr class="separator:a0f33afb8d901d61f93ed7d6f7560403a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="af4e5cca587cec5d56c955a797cc4295f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af4e5cca587cec5d56c955a797cc4295f">&#9670;&nbsp;</a></span>get_cddc()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual tl::expected&lt;<a class="el" href="structCDDC.html">CDDC</a> *, bool&gt; Model::get_cddc </td>
<td>(</td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>cdd_serial</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>return the CurrencyDocumentDescription certifikate for a specific serial version number of it. <a href="https://opencoin.org/0.4/schemata.html#cddc">see spec</a> </p><dl class="section return"><dt>Returns</dt><dd>returns a pointer to the <a class="el" href="structCDDC.html">CDDC</a> if successful, false otherwise </dd></dl>
<p>Implemented in <a class="el" href="classDefaultModel.html#a5d57be9ead842ec3385144f7caa9524e">DefaultModel</a>.</p>
</div>
</div>
<a id="a50d7fc134c43bc28045a7993ff2f2ca5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a50d7fc134c43bc28045a7993ff2f2ca5">&#9670;&nbsp;</a></span>get_current_cddc()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual tl::expected&lt;<a class="el" href="structCDDC.html">CDDC</a> *, bool&gt; Model::get_current_cddc </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>return the CurrencyDocumentDescription certifikate <a href="https://opencoin.org/0.4/schemata.html#cddc">see spec</a> </p><dl class="section return"><dt>Returns</dt><dd>returns a pointer to the <a class="el" href="structCDDC.html">CDDC</a> if successful, false otherwise </dd></dl>
<p>Implemented in <a class="el" href="classDefaultModel.html#a24f870ad579abc50dc3140dc68fa89fa">DefaultModel</a>.</p>
</div>
</div>
<a id="a0f33afb8d901d61f93ed7d6f7560403a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0f33afb8d901d61f93ed7d6f7560403a">&#9670;&nbsp;</a></span>get_model()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::unique_ptr&lt; <a class="el" href="classModel.html">Model</a> &gt; Model::get_model </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>backend_name</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>factory function returning a concrete backend for Opencoin API handling. based on backend_name a concrete backend will be returned or in case of error null. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">backend_name</td><td></td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>pointer to backend instance or null on invalid backend name </dd></dl>
</div>
</div>
<a id="a022e8d797bf57d111a1ce5bd229f41ea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a022e8d797bf57d111a1ce5bd229f41ea">&#9670;&nbsp;</a></span>getMKCs()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual std::vector&lt;<a class="el" href="structMintKeyCert.html">MintKeyCert</a>&gt; Model::getMKCs </td>
<td>(</td>
<td class="paramtype">const std::vector&lt; unsigned int &gt; &amp;&#160;</td>
<td class="paramname"><em>denominations</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; <a class="el" href="structBigInt.html">BigInt</a> &gt; &amp;&#160;</td>
<td class="paramname"><em>mint_key_ids</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>return the <a class="el" href="structMintKey.html">MintKey</a> certificates for a given list of denominations and mint key ids</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">denominations</td><td></td></tr>
<tr><td class="paramname">mint_key_ids</td><td></td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>mint key certificates for given denominations and mint_key_ids </dd></dl>
</div>
</div>
<a id="a0ece13ffd6258825feaaa884247ca6e2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0ece13ffd6258825feaaa884247ca6e2">&#9670;&nbsp;</a></span>mint()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual std::vector&lt;<a class="el" href="structBlindSignature.html">BlindSignature</a>&gt; Model::mint </td>
<td>(</td>
<td class="paramtype">std::string const &amp;&#160;</td>
<td class="paramname"><em>transaction_reference</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; <a class="el" href="structBlind.html">Blind</a> &gt; &amp;&#160;</td>
<td class="paramname"><em>blinds</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>returns the vector of blind signatures for a given vector of blinds</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">transaction_reference</td><td>reference to a transaction (send from client) </td></tr>
<tr><td class="paramname">blinds</td><td>the vector of blinds to sign</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd></dd></dl>
</div>
</div>
<a id="a14ae6086fd6ccc2dc34714c2f976258a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a14ae6086fd6ccc2dc34714c2f976258a">&#9670;&nbsp;</a></span>redeem()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual bool Model::redeem </td>
<td>(</td>
<td class="paramtype">const std::vector&lt; <a class="el" href="structCoin.html">Coin</a> &gt; &amp;&#160;</td>
<td class="paramname"><em>coins</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>redeem valid coins into real money</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">coins</td><td>the coins to redeem</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if successful, false on error </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/<a class="el" href="model_8hpp_source.html">model.hpp</a></li>
<li>src/model.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>