testing
[gnucap-felix.git] / src / d_subckt.h
blobd5d4c97e0cbef25dd49a2a0c45d2ae3d17916f8c
1 /*$Id: d_subckt.h,v 1.3 2009-12-13 17:55:01 felix Exp $ -*- C++ -*-
2 * vim:ts=8:sw=2:et:
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)
11 * any later version.
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
21 * 02110-1301, USA.
22 *------------------------------------------------------------------
23 * data structures for subcircuits
25 //testing=script,sparse 2006.07.17
26 #ifndef D_SUBCKT_H
27 #define D_SUBCKT_H
28 #include "e_node.h"
29 #include "e_subckt.h"
30 /*--------------------------------------------------------------------------*/
31 /*--------------------------------------------------------------------------*/
32 class INTERFACE COMMON_SUBCKT : public COMMON_COMPONENT {
33 private:
34 explicit COMMON_SUBCKT(const COMMON_SUBCKT& p)
35 :COMMON_COMPONENT(p), _params(p._params) {++_count;}
36 public:
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*);
54 private:
55 static int _count;
56 public:
57 PARAM_LIST _params;
59 /*--------------------------------------------------------------------------*/
60 /*--------------------------------------------------------------------------*/
61 #endif
62 // vim:ts=8:sw=2:noet: