Website Summary Files Commits Branches @commit @diff @stats
path: root / docs / html / classCellFormula.html
blob: 2fed2cec9f6610b2b809fca2876064050ef95903 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
<!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=11"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FMI Table: CellFormula 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 id="projectrow">
  <td id="projectalign">
   <div id="projectname">FMI Table
   </div>
   <div id="projectbrief">| Kamen Mladenov | FMI Computer Science Year 1 Group 6 | Project 2 | Project Topic 7 |</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'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:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(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="classCellFormula-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">CellFormula Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p>A table cell which contains a formula.  
 <a href="classCellFormula.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="CellFormula_8h_source.html">CellFormula.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for CellFormula:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classCellFormula.png" usemap="#CellFormula_map" alt=""/>
  <map id="CellFormula_map" name="CellFormula_map">
<area href="classCell.html" title="Fully abstract class that represents a cell in the table." alt="Cell" shape="rect" coords="0,0,80,24"/>
  </map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a4fb02122d6eec83fb4fa80fea56d5094"><td class="memItemLeft" align="right" valign="top"><a id="a4fb02122d6eec83fb4fa80fea56d5094" name="a4fb02122d6eec83fb4fa80fea56d5094"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>CellFormula</b> (const char *str, const <a class="el" href="classList.html">List</a>&lt; <a class="el" href="classList.html">List</a>&lt; <a class="el" href="classCell.html">Cell</a> * &gt; &gt; *tableCells)</td></tr>
<tr class="separator:a4fb02122d6eec83fb4fa80fea56d5094"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aea7ea04991b4ef15aa80ff3182bf1e74"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCellFormula.html#aea7ea04991b4ef15aa80ff3182bf1e74">getNumeralValue</a> () const override</td></tr>
<tr class="separator:aea7ea04991b4ef15aa80ff3182bf1e74"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f55209057eb939f3688a1f02f9fcb3d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classString.html">String</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCellFormula.html#a2f55209057eb939f3688a1f02f9fcb3d">getValueForPrint</a> () const override</td></tr>
<tr class="separator:a2f55209057eb939f3688a1f02f9fcb3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afecaac674bfb6bc2bbe1796c74643e31"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCellFormula.html#afecaac674bfb6bc2bbe1796c74643e31">parseAndSetValue</a> (const char *str) override</td></tr>
<tr class="separator:afecaac674bfb6bc2bbe1796c74643e31"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2883e300abc5153ce84f660f03050fdf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCellFormula.html#a2883e300abc5153ce84f660f03050fdf">writeToFile</a> (std::ofstream &amp;file) override</td></tr>
<tr class="memdesc:a2883e300abc5153ce84f660f03050fdf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes value to a text file.  <a href="classCellFormula.html#a2883e300abc5153ce84f660f03050fdf">More...</a><br /></td></tr>
<tr class="separator:a2883e300abc5153ce84f660f03050fdf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a10bf7a5e3486908f5e6b8b24c5a2e968"><td class="memItemLeft" align="right" valign="top">virtual double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCell.html#a10bf7a5e3486908f5e6b8b24c5a2e968">getNumeralValue</a> () const =0</td></tr>
<tr class="memdesc:a10bf7a5e3486908f5e6b8b24c5a2e968"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the value of the cell as a double-precision floating point number.  <a href="classCell.html#a10bf7a5e3486908f5e6b8b24c5a2e968">More...</a><br /></td></tr>
<tr class="separator:a10bf7a5e3486908f5e6b8b24c5a2e968"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aebc1f8f5965802b7a44ef3da7aa2ce75"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classString.html">String</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCell.html#aebc1f8f5965802b7a44ef3da7aa2ce75">getValueForPrint</a> () const =0</td></tr>
<tr class="memdesc:aebc1f8f5965802b7a44ef3da7aa2ce75"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the value of the cell as a <a class="el" href="classString.html" title="A dynamically-allocated C-style string with extra features.">String</a>.  <a href="classCell.html#aebc1f8f5965802b7a44ef3da7aa2ce75">More...</a><br /></td></tr>
<tr class="separator:aebc1f8f5965802b7a44ef3da7aa2ce75"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a732fcaeea7050f4afb3bcd6377432b95"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCell.html#a732fcaeea7050f4afb3bcd6377432b95">parseAndSetValue</a> (const char *str)=0</td></tr>
<tr class="memdesc:a732fcaeea7050f4afb3bcd6377432b95"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parses given C-style string and stores value.  <a href="classCell.html#a732fcaeea7050f4afb3bcd6377432b95">More...</a><br /></td></tr>
<tr class="separator:a732fcaeea7050f4afb3bcd6377432b95"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a126ab727ef443f5fd8ef62832614f56b"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCell.html#a126ab727ef443f5fd8ef62832614f56b">writeToFile</a> (std::ofstream &amp;file)=0</td></tr>
<tr class="memdesc:a126ab727ef443f5fd8ef62832614f56b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes value to a text file.  <a href="classCell.html#a126ab727ef443f5fd8ef62832614f56b">More...</a><br /></td></tr>
<tr class="separator:a126ab727ef443f5fd8ef62832614f56b"><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 table cell which contains a formula. </p>
<p >Implements the <a class="el" href="classCell.html" title="Fully abstract class that represents a cell in the table.">Cell</a> class by storing a formula as a <a class="el" href="classString.html" title="A dynamically-allocated C-style string with extra features.">String</a> and in a dynamic <a class="el" href="classList.html" title="Templated class that stores an array of elements in dynamic memory.">List</a> </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="aea7ea04991b4ef15aa80ff3182bf1e74" name="aea7ea04991b4ef15aa80ff3182bf1e74"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aea7ea04991b4ef15aa80ff3182bf1e74">&#9670;&nbsp;</a></span>getNumeralValue()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">double CellFormula::getNumeralValue </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p >Value is recalculated every time this function is called (in case a referenced cell is changed).</p>
<dl class="section return"><dt>Returns</dt><dd>0 </dd></dl>

<p>Implements <a class="el" href="classCell.html#a10bf7a5e3486908f5e6b8b24c5a2e968">Cell</a>.</p>

</div>
</div>
<a id="a2f55209057eb939f3688a1f02f9fcb3d" name="a2f55209057eb939f3688a1f02f9fcb3d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2f55209057eb939f3688a1f02f9fcb3d">&#9670;&nbsp;</a></span>getValueForPrint()</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="classString.html">String</a> CellFormula::getValueForPrint </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p >Value is recalculated every time this function is called (in case a referenced cell is changed).</p>
<dl class="section return"><dt>Returns</dt><dd>"Error" </dd></dl>

<p>Implements <a class="el" href="classCell.html#aebc1f8f5965802b7a44ef3da7aa2ce75">Cell</a>.</p>

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

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void CellFormula::parseAndSetValue </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>str</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p >Each math operation is represented with a <a class="el" href="structPair.html" title="Stores two values of any types.">Pair</a> that holds indecies of cell reference and a character for the operation.</p>
<p >Negatve value for the operation character means it's with priority and the result get's calculated immediately (rather than recursively, taking into account other values).</p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::logic_error("Error</td><td>Invalid column character!") Thrown when there is something between Rx and C in cell references
\exception std::logic_error("Error: Invalid value!") Thrown when met value isn't a cell reference or number
\exception throw std::logic_error("Error: Could not find operand!") Thrown when there isn't an operator character between two values </td></tr>
  </table>
  </dd>
</dl>

<p>Implements <a class="el" href="classCell.html#a732fcaeea7050f4afb3bcd6377432b95">Cell</a>.</p>

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

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void CellFormula::writeToFile </td>
          <td>(</td>
          <td class="paramtype">std::ofstream &amp;&#160;</td>
          <td class="paramname"><em>file</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Writes value to a text file. </p>

<p>Implements <a class="el" href="classCell.html#a126ab727ef443f5fd8ef62832614f56b">Cell</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/Models/<a class="el" href="CellFormula_8h_source.html">CellFormula.h</a></li>
<li>src/Models/CellFormula.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.3
</small></address>
</body>
</html>