blob: c68e438e9c5de7158f33e31231a602193ac5e162 [file] [log] [blame]
<!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>
<link rel="canonical" href="https://ignite.apache.org/releases/2.9.0/cppdoc/transaction_8h_source.html" />
<META NAME="ROBOTS" CONTENT="NOINDEX">
<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>&nbsp; Apache Ignite C++: transaction.h Source File</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" />
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-61232409-1', 'auto');
ga('send', 'pageview');
</script></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="projectlogo"><img alt="Logo" src="ignite_logo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">&nbsp; Apache Ignite C++
</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="dir_70c4f2dc9c34c91dd30b464208cd3c8c.html">transactions</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">transaction.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="transaction_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Licensed to the Apache Software Foundation (ASF) under one or more</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> * contributor license agreements. See the NOTICE file distributed with</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * this work for additional information regarding copyright ownership.</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * (the &quot;License&quot;); you may not use this file except in compliance with</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> * the License. You may obtain a copy of the License at</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#ifndef _IGNITE_TRANSACTIONS_TRANSACTION</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#define _IGNITE_TRANSACTIONS_TRANSACTION</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &lt;ignite/common/concurrent.h&gt;</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &quot;ignite/impl/transactions/transaction_impl.h&quot;</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="transaction__consts_8h.html">ignite/transactions/transaction_consts.h</a>&quot;</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceignite.html">ignite</a></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;{</div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="namespaceignite_1_1transactions.html"> 33</a></span>&#160; <span class="keyword">namespace </span>transactions</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; {</div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="classignite_1_1transactions_1_1Transaction.html"> 47</a></span>&#160; <span class="keyword">class </span>IGNITE_FRIEND_EXPORT <a class="code" href="classignite_1_1transactions_1_1Transaction.html">Transaction</a></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; {</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <a class="code" href="classignite_1_1transactions_1_1Transaction.html">Transaction</a>(common::concurrent::SharedPointer&lt;impl::transactions::TransactionImpl&gt; impl);</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <a class="code" href="classignite_1_1transactions_1_1Transaction.html">Transaction</a>(<span class="keyword">const</span> <a class="code" href="classignite_1_1transactions_1_1Transaction.html">Transaction</a>&amp; other);</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <a class="code" href="classignite_1_1transactions_1_1Transaction.html">Transaction</a>&amp; operator=(<span class="keyword">const</span> <a class="code" href="classignite_1_1transactions_1_1Transaction.html">Transaction</a>&amp; other);</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; ~<a class="code" href="classignite_1_1transactions_1_1Transaction.html">Transaction</a>();</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keywordtype">void</span> Commit();</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keywordtype">void</span> Commit(<a class="code" href="classignite_1_1IgniteError.html">IgniteError</a>&amp; err);</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; <span class="keywordtype">void</span> Rollback();</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="keywordtype">void</span> Rollback(<a class="code" href="classignite_1_1IgniteError.html">IgniteError</a>&amp; err);</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <span class="keywordtype">void</span> Close();</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="keywordtype">void</span> Close(<a class="code" href="classignite_1_1IgniteError.html">IgniteError</a>&amp; err);</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <span class="keywordtype">void</span> SetRollbackOnly();</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <span class="keywordtype">void</span> SetRollbackOnly(<a class="code" href="classignite_1_1IgniteError.html">IgniteError</a>&amp; err);</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160;</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; <span class="keywordtype">bool</span> IsRollbackOnly();</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160;</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <span class="keywordtype">bool</span> IsRollbackOnly(<a class="code" href="classignite_1_1IgniteError.html">IgniteError</a>&amp; err);</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160;</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <a class="code" href="structignite_1_1transactions_1_1TransactionState.html#a173faba612c6a4e91c0726140d8d43f3">TransactionState::Type</a> GetState();</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160;</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; <a class="code" href="structignite_1_1transactions_1_1TransactionState.html#a173faba612c6a4e91c0726140d8d43f3">TransactionState::Type</a> GetState(<a class="code" href="classignite_1_1IgniteError.html">IgniteError</a>&amp; err);</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160;</div><div class="line"><a name="l00226"></a><span class="lineno"><a class="line" href="classignite_1_1transactions_1_1Transaction.html#af3764b3e1d9a5718dd2a1adc39232d0e"> 226</a></span>&#160; <a class="code" href="structignite_1_1transactions_1_1TransactionConcurrency.html#ae4a4021eb1bbb6d2acdaad1defeb469a">TransactionConcurrency::Type</a> <a class="code" href="classignite_1_1transactions_1_1Transaction.html#af3764b3e1d9a5718dd2a1adc39232d0e">GetConcurrency</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><a class="code" href="structignite_1_1transactions_1_1TransactionConcurrency.html#ae4a4021eb1bbb6d2acdaad1defeb469a">TransactionConcurrency::Type</a><span class="keyword">&gt;</span>(impl.Get()-&gt;GetConcurrency());</div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; }</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160;</div><div class="line"><a name="l00238"></a><span class="lineno"><a class="line" href="classignite_1_1transactions_1_1Transaction.html#ae528b6116836bb0659fa72ff5002714d"> 238</a></span>&#160; <a class="code" href="structignite_1_1transactions_1_1TransactionIsolation.html#a3ac24463ce4e1f63186a974c33c6b3e3">TransactionIsolation::Type</a> <a class="code" href="classignite_1_1transactions_1_1Transaction.html#ae528b6116836bb0659fa72ff5002714d">GetIsolation</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><a class="code" href="structignite_1_1transactions_1_1TransactionIsolation.html#a3ac24463ce4e1f63186a974c33c6b3e3">TransactionIsolation::Type</a><span class="keyword">&gt;</span>(impl.Get()-&gt;GetIsolation());</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; }</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160;</div><div class="line"><a name="l00250"></a><span class="lineno"><a class="line" href="classignite_1_1transactions_1_1Transaction.html#a685130f14959d840e46c64a9aa8d048f"> 250</a></span>&#160; int64_t <a class="code" href="classignite_1_1transactions_1_1Transaction.html#a685130f14959d840e46c64a9aa8d048f">GetTimeout</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; <span class="keywordflow">return</span> impl.Get()-&gt;GetTimeout();</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; }</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160;</div><div class="line"><a name="l00266"></a><span class="lineno"><a class="line" href="classignite_1_1transactions_1_1Transaction.html#a6f96124829d7926fbf0e5f5e3b0d5da8"> 266</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classignite_1_1transactions_1_1Transaction.html#a6f96124829d7926fbf0e5f5e3b0d5da8">IsValid</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160;<span class="keyword"> </span>{</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; <span class="keywordflow">return</span> impl.IsValid();</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; }</div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160;</div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; common::concurrent::SharedPointer&lt;impl::transactions::TransactionImpl&gt; impl;</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; };</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; }</div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160;}</div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160;</div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160;<span class="preprocessor">#endif //_IGNITE_TRANSACTIONS_TRANSACTION</span></div><div class="ttc" id="structignite_1_1transactions_1_1TransactionState_html_a173faba612c6a4e91c0726140d8d43f3"><div class="ttname"><a href="structignite_1_1transactions_1_1TransactionState.html#a173faba612c6a4e91c0726140d8d43f3">ignite::transactions::TransactionState::Type</a></div><div class="ttdeci">Type</div><div class="ttdef"><b>Definition:</b> transaction_consts.h:120</div></div>
<div class="ttc" id="classignite_1_1transactions_1_1Transaction_html_af3764b3e1d9a5718dd2a1adc39232d0e"><div class="ttname"><a href="classignite_1_1transactions_1_1Transaction.html#af3764b3e1d9a5718dd2a1adc39232d0e">ignite::transactions::Transaction::GetConcurrency</a></div><div class="ttdeci">TransactionConcurrency::Type GetConcurrency() const</div><div class="ttdoc">Get concurrency. </div><div class="ttdef"><b>Definition:</b> transaction.h:226</div></div>
<div class="ttc" id="classignite_1_1transactions_1_1Transaction_html"><div class="ttname"><a href="classignite_1_1transactions_1_1Transaction.html">ignite::transactions::Transaction</a></div><div class="ttdoc">Ignite cache transaction. </div><div class="ttdef"><b>Definition:</b> transaction.h:47</div></div>
<div class="ttc" id="classignite_1_1transactions_1_1Transaction_html_ae528b6116836bb0659fa72ff5002714d"><div class="ttname"><a href="classignite_1_1transactions_1_1Transaction.html#ae528b6116836bb0659fa72ff5002714d">ignite::transactions::Transaction::GetIsolation</a></div><div class="ttdeci">TransactionIsolation::Type GetIsolation() const</div><div class="ttdoc">Get isolation. </div><div class="ttdef"><b>Definition:</b> transaction.h:238</div></div>
<div class="ttc" id="classignite_1_1transactions_1_1Transaction_html_a685130f14959d840e46c64a9aa8d048f"><div class="ttname"><a href="classignite_1_1transactions_1_1Transaction.html#a685130f14959d840e46c64a9aa8d048f">ignite::transactions::Transaction::GetTimeout</a></div><div class="ttdeci">int64_t GetTimeout() const</div><div class="ttdoc">Get timeout. </div><div class="ttdef"><b>Definition:</b> transaction.h:250</div></div>
<div class="ttc" id="transaction__consts_8h_html"><div class="ttname"><a href="transaction__consts_8h.html">transaction_consts.h</a></div><div class="ttdoc">Declares Transaction-related enumerations. </div></div>
<div class="ttc" id="classignite_1_1IgniteError_html"><div class="ttname"><a href="classignite_1_1IgniteError.html">ignite::IgniteError</a></div><div class="ttdoc">Ignite error information. </div><div class="ttdef"><b>Definition:</b> ignite_error.h:94</div></div>
<div class="ttc" id="classignite_1_1transactions_1_1Transaction_html_a6f96124829d7926fbf0e5f5e3b0d5da8"><div class="ttname"><a href="classignite_1_1transactions_1_1Transaction.html#a6f96124829d7926fbf0e5f5e3b0d5da8">ignite::transactions::Transaction::IsValid</a></div><div class="ttdeci">bool IsValid() const</div><div class="ttdoc">Check if the instance is valid and can be used. </div><div class="ttdef"><b>Definition:</b> transaction.h:266</div></div>
<div class="ttc" id="structignite_1_1transactions_1_1TransactionIsolation_html_a3ac24463ce4e1f63186a974c33c6b3e3"><div class="ttname"><a href="structignite_1_1transactions_1_1TransactionIsolation.html#a3ac24463ce4e1f63186a974c33c6b3e3">ignite::transactions::TransactionIsolation::Type</a></div><div class="ttdeci">Type</div><div class="ttdef"><b>Definition:</b> transaction_consts.h:73</div></div>
<div class="ttc" id="namespaceignite_html"><div class="ttname"><a href="namespaceignite.html">ignite</a></div><div class="ttdoc">Apache Ignite API. </div><div class="ttdef"><b>Definition:</b> cache.h:48</div></div>
<div class="ttc" id="structignite_1_1transactions_1_1TransactionConcurrency_html_ae4a4021eb1bbb6d2acdaad1defeb469a"><div class="ttname"><a href="structignite_1_1transactions_1_1TransactionConcurrency.html#ae4a4021eb1bbb6d2acdaad1defeb469a">ignite::transactions::TransactionConcurrency::Type</a></div><div class="ttdeci">Type</div><div class="ttdef"><b>Definition:</b> transaction_consts.h:35</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Oct 15 2020 12:17:17 for &nbsp; Apache Ignite C++ 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>