<?php $isip_window_title = "ISIP Homepage"; ?>
<?php include("/data/isip/www/templates/documentation/header/header.html"); ?>

<!--#set var="isip_page_title" value="Boolean" -->
<?php include("/data/isip/www/templates/documentation/body/index_class.html"); ?>
<?php include("/data/isip/www/templates/documentation/body/bar.html"); ?>

<a name="name">
<b>name: <a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h">Boolean</a></b>

<br><br> 

<a name="synopsis">
<b>synopsis:</b>
<br> <br>

<blockquote>
<pre>
g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_math_scalar.a

#include &lt;Boolean.h&gt;

Boolean(boolean arg = DEF_VALUE);
boolean assign(boolean arg);
</pre>
</blockquote>

<a name="quick_start">
<b>quick start:</b>
<br><br>

<blockquote>
<pre>
Boolean val0;  
val0.assign(true);

Boolean val1;
val1 = !val0;
</pre>
</blockquote>

<a name="description"> 
<b>description:</b>
<br> <br>

The Boolean class manages values of type <b>bool</b>. A Boolean object can read
itself from (or write itself to) a Sof file. The Boolean class includes
memory management methods which use the MemoryManager class to allocate
or delete memory to or from the heap.

<br><br>

<a name="dependencies">
<b>dependencies:</b>
<br><br>

<ul>
 <li> <a href="../MScalar/index.html">Mscalar</a>
</ul>

<a name="constants">
<b>public constants:</b>
<br><br>

<ul>
  <li> define the class name:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/bool_00.cc&constant=CLASS_NAME">static const String CLASS_NAME = L"Boolean";</a></pre>
 
 <li> i/o related constants:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/bool_00.cc&constant=DEF_PARAM">static const String DEF_PARAM = L"value";</a></pre>

 <li> define the default value(s) of the class data:
       
       <pre>static const boolean DEF_VALUE = false;</a></pre>
</ul>

<a name="error">
<b>error codes:</b>
<ul>
  <li> error code indicating Boolean class general error:
       
       <pre><a href="/perl/ifc_document.pl?err=00020100">static const long ERR = 20100;</a></pre> 
</ul>

<a name="protected">
<b>protected data:</b>
<br><br>

<ul>

  <li> a boolean value:
       
       <pre>boolean value_d;</pre>
       
  <li> define a static debug level for all objects of this class:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/bool_00.cc&static=debug_level_d">static Integral::DEBUG debug_level_d;</a></pre>

  <li> static memory manager:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/bool_00.cc&static=mgr_d">static MemoryManager mgr_d;</a></pre>
</ul>

<a name="public">
<b>required public methods:</b>
<br><br>

<ul>
  <li> static methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=name">static const String& name();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/bool_02.cc">static boolean diagnose(Integral::DEBUG debug_level);</a></pre>

  <li> debug methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=setDebug">static boolean setDebug(Integral::DEBUG level_a);</a></pre>       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/bool_01.cc">boolean debug(const unichar* message) const;</a></pre>
       
  <li> destructor/constructor(s):
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=destructor">~Boolean();</pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=default+constructor">Boolean(boolean arg = DEF_VALUE);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=copy+constructor">Boolean(const Boolean& arg);</a></pre>

  <li> assign methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=assign&instance=0">boolean assign(const Boolean& arg);</a></pre>

  <li> operator= methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=operator%3D&instance=0">Boolean& operator= (const Boolean& arg);</a></pre>
       
  <li> i/o methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=sofSize">long sofSize() const;</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/bool_03.cc&method=read">boolean read(Sof& sof, long tag, const String& name =CLASS_NAME);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/bool_04.cc&method=write">boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/bool_03.cc&method=readData">boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);</a></pre>
        <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/bool_04.cc&method=writeData">boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;</a></pre>

  <li> equality methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=eq">boolean eq(const Boolean& arg) const;</a></pre>

  <li> memory management methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=new">static void* operator new(size_t size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=new[]">static void* operator new[](size_t size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=delete">static void operator delete(void* ptr);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=delete[]">static void operator delete[](void* ptr);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=setGrowSize">static boolean setGrowSize(long size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=clear">boolean clear(Integral::CMODE ctype = Integral::DEF_MODE);</a></pre>
</ul>

<a name="specific">
<b>class-specific public methods:</b>
<br><br>

<ul>
  <li> assign methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=assign&instance=1">boolean assign(boolean arg);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=assign&instance=2">boolean assign(const String& arg);</a></pre>

  <li> equality and comparison methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=almostEqual&instance=0">boolean almostEqual(boolean arg);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=almostEqual&instance=1">boolean almostEqual(boolean arg, double, double);</a></pre>

  <li> operator overload methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=operator%3D&instance=1">Boolean& operator= (boolean arg);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=operator()">operator boolean() const;</a></pre>       

  <li> get methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=get">boolean get(String& arg) const;</a></pre>

  <li> random number generation methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=rand">boolean rand(Random& generator = Random::GLOBAL);</a></pre>
       
  <li> memory size methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/math/scalar/Boolean/Boolean.h&method=memSize">long memSize() const;</a></pre>      
</ul>
       
<a name="private">
<b>private methods:</b>
<ul>
  <li>
       none.
</ul>

<a name="examples">
<b>examples:</b>
<br><br>

<ul>
  <li> This example shows how to write a Boolean object into a Sof file:
       
       <pre>
Boolean val0(true);
String tmp_filename(L"foo");
Sof tmp_file;
tmp_file.open(tmp_filename, File::WRITE_ONLY, File::TEXT);
       
val0.write(tmp_file, (long)0);
tmp_file.close();
       </pre>
</ul>

<a name="notes">
<b>notes:</b>
<br><br>

<ul>
  <li> See the <a href="../MScalar/index.html#notes">notes section of MScalar</a>.
</ul>
<!--#include virtual="/hse/ies/templates/documentation/footer/footer.html" -->
