1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
3 | <title>mixpp: binary.h Source File</title> |
---|
4 | <link href="tabs.css" rel="stylesheet" type="text/css"> |
---|
5 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
6 | </head><body> |
---|
7 | <!-- Generated by Doxygen 1.5.8 --> |
---|
8 | <script type="text/javascript"> |
---|
9 | <!-- |
---|
10 | function changeDisplayState (e){ |
---|
11 | var num=this.id.replace(/[^[0-9]/g,''); |
---|
12 | var button=this.firstChild; |
---|
13 | var sectionDiv=document.getElementById('dynsection'+num); |
---|
14 | if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ |
---|
15 | sectionDiv.style.display='block'; |
---|
16 | button.src='open.gif'; |
---|
17 | }else{ |
---|
18 | sectionDiv.style.display='none'; |
---|
19 | button.src='closed.gif'; |
---|
20 | } |
---|
21 | } |
---|
22 | function initDynSections(){ |
---|
23 | var divs=document.getElementsByTagName('div'); |
---|
24 | var sectionCounter=1; |
---|
25 | for(var i=0;i<divs.length-1;i++){ |
---|
26 | if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ |
---|
27 | var header=divs[i]; |
---|
28 | var section=divs[i+1]; |
---|
29 | var button=header.firstChild; |
---|
30 | if (button!='IMG'){ |
---|
31 | divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); |
---|
32 | button=document.createElement('img'); |
---|
33 | divs[i].insertBefore(button,divs[i].firstChild); |
---|
34 | } |
---|
35 | header.style.cursor='pointer'; |
---|
36 | header.onclick=changeDisplayState; |
---|
37 | header.id='dynheader'+sectionCounter; |
---|
38 | button.src='closed.gif'; |
---|
39 | section.id='dynsection'+sectionCounter; |
---|
40 | section.style.display='none'; |
---|
41 | section.style.marginLeft='14px'; |
---|
42 | sectionCounter++; |
---|
43 | } |
---|
44 | } |
---|
45 | } |
---|
46 | window.onload = initDynSections; |
---|
47 | --> |
---|
48 | </script> |
---|
49 | <div class="navigation" id="top"> |
---|
50 | <div class="tabs"> |
---|
51 | <ul> |
---|
52 | <li><a href="main.html"><span>Main Page</span></a></li> |
---|
53 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
54 | <li><a href="modules.html"><span>Modules</span></a></li> |
---|
55 | <li><a href="annotated.html"><span>Classes</span></a></li> |
---|
56 | <li class="current"><a href="files.html"><span>Files</span></a></li> |
---|
57 | </ul> |
---|
58 | </div> |
---|
59 | <div class="tabs"> |
---|
60 | <ul> |
---|
61 | <li><a href="files.html"><span>File List</span></a></li> |
---|
62 | <li><a href="globals.html"><span>File Members</span></a></li> |
---|
63 | </ul> |
---|
64 | </div> |
---|
65 | <h1>binary.h</h1><a href="binary_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 |
---|
66 | <a name="l00029"></a>00029 <span class="preprocessor">#ifndef BINARY_H</span> |
---|
67 | <a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define BINARY_H</span> |
---|
68 | <a name="l00031"></a>00031 <span class="preprocessor"></span> |
---|
69 | <a name="l00032"></a>00032 <span class="preprocessor">#include <<a class="code" href="itassert_8h.html" title="Error handling functions - header file.">itpp/base/itassert.h</a>></span> |
---|
70 | <a name="l00033"></a>00033 |
---|
71 | <a name="l00034"></a>00034 |
---|
72 | <a name="l00035"></a>00035 <span class="keyword">namespace </span>itpp |
---|
73 | <a name="l00036"></a>00036 { |
---|
74 | <a name="l00037"></a>00037 |
---|
75 | <a name="l00056"></a><a class="code" href="classitpp_1_1bin.html">00056</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> |
---|
76 | <a name="l00057"></a>00057 { |
---|
77 | <a name="l00058"></a>00058 <span class="keyword">public</span>: |
---|
78 | <a name="l00060"></a><a class="code" href="classitpp_1_1bin.html#dd98f62762d7a3b574b8671939ebab87">00060</a> <a class="code" href="classitpp_1_1bin.html#dd98f62762d7a3b574b8671939ebab87" title="Default constructor.">bin</a>(): b(0) {} |
---|
79 | <a name="l00061"></a>00061 |
---|
80 | <a name="l00063"></a><a class="code" href="classitpp_1_1bin.html#e63ccf5e82082480062e9d5672fe664e">00063</a> <a class="code" href="classitpp_1_1bin.html#e63ccf5e82082480062e9d5672fe664e" title="Set the binary object equal to value. Either &quot;0&quot; or &quot;1&quot;.">bin</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> &<a class="code" href="classitpp_1_1bin.html#2909346471e39933efe16a2ad4c88ea4" title="Output the binary value of the object.">value</a>): b(static_cast<char>(value)) { |
---|
81 | <a name="l00064"></a>00064 <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>((value == 0) || (value == 1), |
---|
82 | <a name="l00065"></a>00065 <span class="stringliteral">"bin::bin(): value must be 0 or 1"</span>); |
---|
83 | <a name="l00066"></a>00066 } |
---|
84 | <a name="l00067"></a>00067 |
---|
85 | <a name="l00069"></a><a class="code" href="classitpp_1_1bin.html#b098143adb87b8a2286a89637cb85916">00069</a> <a class="code" href="classitpp_1_1bin.html#b098143adb87b8a2286a89637cb85916" title="Copy constructor.">bin</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin): b(inbin.b) {} |
---|
86 | <a name="l00070"></a>00070 |
---|
87 | <a name="l00072"></a><a class="code" href="classitpp_1_1bin.html#ae5d048aeca8a8c37c5e3c6d8ec92da7">00072</a> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1bin.html#ae5d048aeca8a8c37c5e3c6d8ec92da7" title="Assign a value.">operator=</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> &<a class="code" href="classitpp_1_1bin.html#2909346471e39933efe16a2ad4c88ea4" title="Output the binary value of the object.">value</a>) { |
---|
88 | <a name="l00073"></a>00073 <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>((value == 0) || (value == 1), |
---|
89 | <a name="l00074"></a>00074 <span class="stringliteral">"bin::operator=(): value must be 0 or 1"</span>); |
---|
90 | <a name="l00075"></a>00075 b = <span class="keyword">static_cast<</span><span class="keywordtype">char</span><span class="keyword">></span>(value); |
---|
91 | <a name="l00076"></a>00076 } |
---|
92 | <a name="l00077"></a>00077 |
---|
93 | <a name="l00079"></a><a class="code" href="classitpp_1_1bin.html#2a024120416ee7132a84e833b6c682de">00079</a> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1bin.html#2a024120416ee7132a84e833b6c682de" title="Assign a value.">operator=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin) { b = inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>; } |
---|
94 | <a name="l00080"></a>00080 |
---|
95 | <a name="l00082"></a><a class="code" href="classitpp_1_1bin.html#7243055d81ea8b108cc115c638b56218">00082</a> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1bin.html#7243055d81ea8b108cc115c638b56218" title="OR.">operator/=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin) { b |= inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>; } |
---|
96 | <a name="l00083"></a>00083 |
---|
97 | <a name="l00085"></a><a class="code" href="classitpp_1_1bin.html#bf2465196b222cf1c996601febc99db9">00085</a> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1bin.html#bf2465196b222cf1c996601febc99db9" title="OR.">operator|=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin) { b |= inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>; } |
---|
98 | <a name="l00087"></a><a class="code" href="classitpp_1_1bin.html#c8886d15e9d8816126e321c2961260b9">00087</a> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> <a class="code" href="classitpp_1_1bin.html#c8886d15e9d8816126e321c2961260b9" title="OR.">operator/</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1bin.html#dd98f62762d7a3b574b8671939ebab87" title="Default constructor.">bin</a>(b | inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>); } |
---|
99 | <a name="l00089"></a><a class="code" href="classitpp_1_1bin.html#f50542b7c3eb5ee1ab71907165031e45">00089</a> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> <a class="code" href="classitpp_1_1bin.html#f50542b7c3eb5ee1ab71907165031e45" title="OR.">operator|</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1bin.html#dd98f62762d7a3b574b8671939ebab87" title="Default constructor.">bin</a>(b | inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>); } |
---|
100 | <a name="l00090"></a>00090 |
---|
101 | <a name="l00092"></a><a class="code" href="classitpp_1_1bin.html#1a25bc81e16666643e1b16bcde5ff81b">00092</a> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1bin.html#1a25bc81e16666643e1b16bcde5ff81b" title="XOR.">operator+=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin) { b ^= inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>; } |
---|
102 | <a name="l00094"></a><a class="code" href="classitpp_1_1bin.html#4695151764db17995da2d8abe462bdd8">00094</a> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1bin.html#4695151764db17995da2d8abe462bdd8" title="XOR.">operator^=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin) { b ^= inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>; } |
---|
103 | <a name="l00096"></a><a class="code" href="classitpp_1_1bin.html#ce18653260977be1684f1813ed13b2cd">00096</a> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> <a class="code" href="classitpp_1_1bin.html#ce18653260977be1684f1813ed13b2cd" title="XOR.">operator+</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1bin.html#dd98f62762d7a3b574b8671939ebab87" title="Default constructor.">bin</a>(b ^ inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>); } |
---|
104 | <a name="l00098"></a><a class="code" href="classitpp_1_1bin.html#da2c57e48cbc7fb09da20238a553cfca">00098</a> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> <a class="code" href="classitpp_1_1bin.html#da2c57e48cbc7fb09da20238a553cfca" title="XOR.">operator^</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1bin.html#dd98f62762d7a3b574b8671939ebab87" title="Default constructor.">bin</a>(b ^ inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>); } |
---|
105 | <a name="l00100"></a><a class="code" href="classitpp_1_1bin.html#8d418d532252bf91ade2d50a964df9af">00100</a> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1bin.html#8d418d532252bf91ade2d50a964df9af" title="XOR.">operator-=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin) { b ^= inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>; } |
---|
106 | <a name="l00102"></a><a class="code" href="classitpp_1_1bin.html#582141e1cab11b8c25d7bdbdd64ec7a7">00102</a> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> <a class="code" href="classitpp_1_1bin.html#582141e1cab11b8c25d7bdbdd64ec7a7" title="XOR.">operator-</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1bin.html#dd98f62762d7a3b574b8671939ebab87" title="Default constructor.">bin</a>(b ^ inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>); } |
---|
107 | <a name="l00104"></a><a class="code" href="classitpp_1_1bin.html#dce45f08122d08a7dce60edb3269b5ff">00104</a> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> <a class="code" href="classitpp_1_1bin.html#dce45f08122d08a7dce60edb3269b5ff" title="Dummy definition to be able to use vec&lt;bin&gt;.">operator-</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1bin.html#dd98f62762d7a3b574b8671939ebab87" title="Default constructor.">bin</a>(b); } |
---|
108 | <a name="l00105"></a>00105 |
---|
109 | <a name="l00107"></a><a class="code" href="classitpp_1_1bin.html#97da295bc74481150e6fd8f3c3f05e3c">00107</a> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1bin.html#97da295bc74481150e6fd8f3c3f05e3c" title="AND.">operator*=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin) { b &= inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>; } |
---|
110 | <a name="l00109"></a><a class="code" href="classitpp_1_1bin.html#1e6f608a57e11d0708c9ed2d679b4f96">00109</a> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1bin.html#1e6f608a57e11d0708c9ed2d679b4f96" title="AND.">operator&=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin) { b &= inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>; } |
---|
111 | <a name="l00111"></a><a class="code" href="classitpp_1_1bin.html#f958da80e6c8294d9e4f34d9a860784f">00111</a> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> <a class="code" href="classitpp_1_1bin.html#f958da80e6c8294d9e4f34d9a860784f" title="AND.">operator*</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1bin.html#dd98f62762d7a3b574b8671939ebab87" title="Default constructor.">bin</a>(b & inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>); } |
---|
112 | <a name="l00113"></a><a class="code" href="classitpp_1_1bin.html#792d47d7f31728faecb9ec6c6984ca3e">00113</a> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> <a class="code" href="classitpp_1_1bin.html#792d47d7f31728faecb9ec6c6984ca3e" title="AND.">operator&</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1bin.html#dd98f62762d7a3b574b8671939ebab87" title="Default constructor.">bin</a>(b & inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>); } |
---|
113 | <a name="l00114"></a>00114 |
---|
114 | <a name="l00116"></a><a class="code" href="classitpp_1_1bin.html#5211718a48690bba42762e3b5a018fce">00116</a> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> <a class="code" href="classitpp_1_1bin.html#5211718a48690bba42762e3b5a018fce" title="NOT.">operator!</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1bin.html#dd98f62762d7a3b574b8671939ebab87" title="Default constructor.">bin</a>(b ^ 1); } |
---|
115 | <a name="l00118"></a><a class="code" href="classitpp_1_1bin.html#881339daf78ca0c04dd7a0af7cbe11a6">00118</a> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> <a class="code" href="classitpp_1_1bin.html#881339daf78ca0c04dd7a0af7cbe11a6" title="NOT.">operator~</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1bin.html#dd98f62762d7a3b574b8671939ebab87" title="Default constructor.">bin</a>(b ^ 1); } |
---|
116 | <a name="l00119"></a>00119 |
---|
117 | <a name="l00121"></a><a class="code" href="classitpp_1_1bin.html#48eb88ba5ef7fc3f1bf393d15c9b6887">00121</a> <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1bin.html#48eb88ba5ef7fc3f1bf393d15c9b6887" title="Check if equal.">operator==</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> b == inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>; } |
---|
118 | <a name="l00123"></a><a class="code" href="classitpp_1_1bin.html#36793a0f2d2e3f458b456c2b97dd7e5c">00123</a> <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1bin.html#36793a0f2d2e3f458b456c2b97dd7e5c" title="Check if equal.">operator==</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> &i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> b == i; } |
---|
119 | <a name="l00124"></a>00124 |
---|
120 | <a name="l00126"></a><a class="code" href="classitpp_1_1bin.html#cbef9edfe99990fa3c579cd6a8277faf">00126</a> <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1bin.html#cbef9edfe99990fa3c579cd6a8277faf" title="Check if not equal.">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> b != inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>; } |
---|
121 | <a name="l00128"></a><a class="code" href="classitpp_1_1bin.html#d402c24ad7304e9fe6733b9c7d6a36de">00128</a> <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1bin.html#d402c24ad7304e9fe6733b9c7d6a36de" title="Check if not equal.">operator!=</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> &i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> b != i; } |
---|
122 | <a name="l00129"></a>00129 |
---|
123 | <a name="l00131"></a><a class="code" href="classitpp_1_1bin.html#023d0b06eeb90179a3919334d2a7a322">00131</a> <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1bin.html#023d0b06eeb90179a3919334d2a7a322" title="Less than (interpret the binary values {0,1} as integers).">operator<</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> b < inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>; } |
---|
124 | <a name="l00133"></a><a class="code" href="classitpp_1_1bin.html#93e4d883515de36060f406b22b4db4bb">00133</a> <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1bin.html#93e4d883515de36060f406b22b4db4bb" title="Less than equal (interpret the binary values {0,1} as integers).">operator<=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> b <= inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>; } |
---|
125 | <a name="l00134"></a>00134 |
---|
126 | <a name="l00136"></a><a class="code" href="classitpp_1_1bin.html#17d6735770ed1dd2e1f247e58de55a19">00136</a> <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1bin.html#17d6735770ed1dd2e1f247e58de55a19" title="Greater than (interpret the binary values {0,1} as integers).">operator></a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> b > inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>; } |
---|
127 | <a name="l00138"></a><a class="code" href="classitpp_1_1bin.html#59938bdb34cb77f8652414c8991f532e">00138</a> <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1bin.html#59938bdb34cb77f8652414c8991f532e" title="Greater than equal (interpret the binary values {0,1} as integers).">operator>=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> b >= inbin.<a class="code" href="classitpp_1_1bin.html#046551270357a81cbdfd7dc4fa095d6b">b</a>; } |
---|
128 | <a name="l00139"></a>00139 |
---|
129 | <a name="l00141"></a><a class="code" href="classitpp_1_1bin.html#652d537ae6030ccef89c02f3f6965a53">00141</a> <a class="code" href="classitpp_1_1bin.html#652d537ae6030ccef89c02f3f6965a53" title="Convert bin to short.">operator short</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><span class="keywordtype">short</span><span class="keyword">></span>(b); } |
---|
130 | <a name="l00143"></a><a class="code" href="classitpp_1_1bin.html#405f9552040ab366be50591273c5f24e">00143</a> <a class="code" href="classitpp_1_1bin.html#405f9552040ab366be50591273c5f24e" title="Convert bin to int.">operator int</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(b); } |
---|
131 | <a name="l00145"></a><a class="code" href="classitpp_1_1bin.html#0c87db2d8fd3ba93776df7c89d66c2c9">00145</a> <a class="code" href="classitpp_1_1bin.html#0c87db2d8fd3ba93776df7c89d66c2c9" title="Convert bin to bool.">operator bool</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> b != 0; } |
---|
132 | <a name="l00147"></a><a class="code" href="classitpp_1_1bin.html#a2ec80e83e453fa5793aed02d2889a35">00147</a> <a class="code" href="classitpp_1_1bin.html#a2ec80e83e453fa5793aed02d2889a35" title="Convert bin to float.">operator float</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><span class="keywordtype">float</span><span class="keyword">></span>(b); } |
---|
133 | <a name="l00149"></a><a class="code" href="classitpp_1_1bin.html#454186ed6153b57960a23c0e7005687b">00149</a> <a class="code" href="classitpp_1_1bin.html#454186ed6153b57960a23c0e7005687b" title="Convert bin to double.">operator double</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><span class="keywordtype">double</span><span class="keyword">></span>(b); } |
---|
134 | <a name="l00150"></a>00150 |
---|
135 | <a name="l00152"></a><a class="code" href="classitpp_1_1bin.html#2909346471e39933efe16a2ad4c88ea4">00152</a> <span class="keywordtype">char</span> <a class="code" href="classitpp_1_1bin.html#2909346471e39933efe16a2ad4c88ea4" title="Output the binary value of the object.">value</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> b; } |
---|
136 | <a name="l00153"></a>00153 |
---|
137 | <a name="l00154"></a>00154 <span class="keyword">private</span>: |
---|
138 | <a name="l00155"></a>00155 <span class="keywordtype">char</span> b; |
---|
139 | <a name="l00156"></a>00156 }; |
---|
140 | <a name="l00157"></a>00157 |
---|
141 | <a name="l00162"></a>00162 std::ostream &<a class="code" href="group__fixed.html#g46e967850e616363aeabd2cda5bcc159" title="Set output mode.">operator<<</a>(std::ostream &output, <span class="keyword">const</span> bin &inbin); |
---|
142 | <a name="l00163"></a>00163 |
---|
143 | <a name="l00168"></a>00168 std::istream &<a class="code" href="group__fixed.html#gbd223815e04b623a044d98fd366f3a0f" title="Input bit representation and, optionally, the shift.">operator>></a>(std::istream &input, bin &outbin); |
---|
144 | <a name="l00169"></a>00169 |
---|
145 | <a name="l00174"></a><a class="code" href="classitpp_1_1bin.html#eef4249965bf7e458f1b509fad5d1486">00174</a> <span class="keyword">inline</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> <a class="code" href="classitpp_1_1bin.html#eef4249965bf7e458f1b509fad5d1486" title="absolute value of bin">abs</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> &inbin) { <span class="keywordflow">return</span> inbin; } |
---|
146 | <a name="l00175"></a>00175 |
---|
147 | <a name="l00176"></a>00176 } <span class="comment">// namespace itpp</span> |
---|
148 | <a name="l00177"></a>00177 |
---|
149 | <a name="l00178"></a>00178 |
---|
150 | <a name="l00179"></a>00179 <span class="keyword">namespace </span>std <span class="comment">// added 11/2005, EGL</span> |
---|
151 | <a name="l00180"></a>00180 { |
---|
152 | <a name="l00181"></a>00181 |
---|
153 | <a name="l00186"></a>00186 <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="group__fixed.html#ge0a38d51b2bf99a0ba07f2f8885e6adc" title="Absolute value.">abs</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">itpp::bin</a> &inbin) { <span class="keywordflow">return</span> inbin; } |
---|
154 | <a name="l00187"></a>00187 |
---|
155 | <a name="l00188"></a>00188 } <span class="comment">// namespace std</span> |
---|
156 | <a name="l00189"></a>00189 |
---|
157 | <a name="l00190"></a>00190 <span class="preprocessor">#endif // #ifndef BINARY_H</span> |
---|
158 | <a name="l00191"></a>00191 <span class="preprocessor"></span> |
---|
159 | </pre></div></div> |
---|
160 | <hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:02:10 2009 for mixpp by |
---|
161 | <a href="http://www.doxygen.org/index.html"> |
---|
162 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> |
---|
163 | </body> |
---|
164 | </html> |
---|