1 /*$Id: d_subckt.h,v 1.3 2009-12-13 17:55:01 felix Exp $ -*- C++ -*-
3 * Copyright (C) 2001 Albert Davis
4 * Author: Albert Davis <aldavis@gnu.org>
6 * This file is part of "Gnucap", the Gnu Circuit Analysis Package
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3, or (at your option)
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 *------------------------------------------------------------------
23 * data structures for subcircuits
25 //testing=script,sparse 2006.07.17
30 /*--------------------------------------------------------------------------*/
31 /*--------------------------------------------------------------------------*/
32 class INTERFACE COMMON_SUBCKT
: public COMMON_COMPONENT
{
34 explicit COMMON_SUBCKT(const COMMON_SUBCKT
& p
)
35 :COMMON_COMPONENT(p
), _params(p
._params
) {++_count
;}
37 explicit COMMON_SUBCKT(int c
=0) :COMMON_COMPONENT(c
) {++_count
;}
38 ~COMMON_SUBCKT() {--_count
;}
39 bool operator==(const COMMON_COMPONENT
&)const;
40 COMMON_COMPONENT
* clone()const {return new COMMON_SUBCKT(*this);}
41 std::string
name()const {itested(); return "subckt";}
42 static int count() {return _count
;}
44 void set_param_by_name(std::string Name
, std::string Value
) {_params
.set(Name
, Value
);}
45 bool param_is_printable(int)const;
46 std::string
param_name(int)const;
47 std::string
param_name(int,int)const;
48 std::string
param_value(int)const;
49 int param_count()const
50 {return (static_cast<int>(_params
.size()) + COMMON_COMPONENT::param_count());}
52 void precalc_first(const CARD_LIST
*);
53 void precalc_last(const CARD_LIST
*);
59 /*--------------------------------------------------------------------------*/
60 /*--------------------------------------------------------------------------*/
62 // vim:ts=8:sw=2:noet: