<h1>Internal design<aclass="headerlink"href="#internal-design"title="Permalink to this headline">¶</a></h1>
<sectionid="design-decisions">
<h2>Design decisions<aclass="headerlink"href="#design-decisions"title="Permalink to this headline">¶</a></h2>
<ulclass="simple">
<li><p>Use C++ with additional C API</p></li>
<li><p>Use exceptions</p>
<ul>
<li><p>Use macro wrapper over <codeclass="docutils literal notranslate"><spanclass="pre">try-catch</span></code> blocks when exceptions off (use <codeclass="docutils literal notranslate"><spanclass="pre">abort()</span></code> if <codeclass="docutils literal notranslate"><spanclass="pre">THROW()</span></code>)</p></li>
</ul>
</li>
<li><p>Initializes and allocates in the constructor (might throw)</p>
<ul>
<li><p>easier code with exceptions ON, with exceptions OFF alloc/init failures are not treated as runtime error (program aborts)</p></li>
<li><p>break down long initialization in constructor into more private methods</p></li>
</ul>
</li>
<li><p>Implements different devices using inheritance from <codeclass="docutils literal notranslate"><spanclass="pre">GenericModule</span></code>, which is the most general implementation of a common modem</p>
<ul>
<li><p>Internally uses templates with device specialization (modeled as <codeclass="docutils literal notranslate"><spanclass="pre">DCE<SpecificModule></span></code>) which could be used as well for some special cases,
such as implantation of a minimal device (ModuleIf), add new AT commands (oOnly in compile time), or using the Module with DTE only (no DCE, no Netif) for sending AT commands without network</p></li>
</ul>
</li>
</ul>
</section>
<sectionid="dce-collaboration-model">
<h2>DCE collaboration model<aclass="headerlink"href="#dce-collaboration-model"title="Permalink to this headline">¶</a></h2>
<p>The diagram describes how the DCE class collaborates with DTE, PPP and the device abstraction</p>