%$Id: ds_parts-list.tex,v 25.95 2006/08/26 01:26:53 al Exp $ -*- LaTeX -*-
% man Tech ds_parts-list .
% Copyright (C) 2001 Albert Davis
% Author: Albert Davis <aldavis@ieee.org>
%
% This file is part of "Gnucap", the Gnu Circuit Analysis Package
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2, or (at your option)
% any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
% 02110-1301, USA.
%------------------------------------------------------------------------
\subsection{Parts list}
\index{internals: parts list}
\index{parts list: internals}
%------------------------------------------------------------------------
\subsubsection{Main parts list}

The primary data storage is in a list of ``cards''.  A card is
anything that can appear in a net list.  Cards live here, primarily,
but there are some other auxilary lists that also contain pointers to
cards.

The list stores pointers, rather than actual objects, because there
are many types of cards.  All are derived from the ``card'', through
several levels of inheritance.

Usually, they are stored in the order they are read from the file,
except for subcircuits, which are stored in separate lists to preserve 
the hierarchy.

As of release 0.24, the main list is in static storage, so there can
be only one.  This will change.  New cards can be inserted anywhere in 
the list, but usually they are inserted at the end.  The mechanism for 
marking the location is a hybrid of STL and a 15 year old pointer
scheme, which will also change someday.
%------------------------------------------------------------------------
\subsubsection{The ``Common'' and ``Eval'' classes}

The ``common'' serves two distinct purposes.  The first is to share
storage for similar devices.  The second is to attach ``evaluators''
to otherwise simple components for special behavior.

Most circuits have many identical elements.  The ``common'' enables
them to share storage.  One ``common'' can be attached to many
devices.  When a new device is created, even if it is parses
separately, an attempt is made to find an appropriate device to share
with.

Simple elements like resistors and capacitors can have ``evaluators''
attached as commons.  These evaluators calculate a function and its
derivative, and return it in a standard form.  Some evaluators are
used internally, such as in the diode and mosfet models.  Some are
used explicitly, such as in behavioral modeling.
%------------------------------------------------------------------------
%------------------------------------------------------------------------
