1 /*$Id: u_prblst.h,v 26.138 2013/04/24 02:32:27 al Exp $ -*- C++ -*-
2  * Copyright (C) 2001 Albert Davis
3  * Author: Albert Davis <aldavis@gnu.org>
4  *
5  * This file is part of "Gnucap", the Gnu Circuit Analysis Package
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20  * 02110-1301, USA.
21  *------------------------------------------------------------------
22  * list of probes
23  */
24 //testing=script,complete 2006.09.28
25 #ifndef U_PRBLST_H
26 #define U_PRBLST_H
27 #include "mode.h"
28 #include "u_probe.h"
29 /*--------------------------------------------------------------------------*/
30 class CARD_LIST;
31 /*--------------------------------------------------------------------------*/
32 class INTERFACE PROBELIST {
33 private:
34   typedef std::vector<PROBE> _container;
35   _container bag;
36 
PROBELIST(const PROBELIST &)37   explicit PROBELIST(const PROBELIST&) {unreachable();incomplete();}
38 public:
PROBELIST()39   explicit PROBELIST() {}
~PROBELIST()40   ~PROBELIST() {}
41 
42   typedef _container::iterator	     iterator;
43   typedef _container::const_iterator const_iterator;
44   void	   listing(const std::string&)const;
45   void     clear();
46 
47   void	   remove_list(CS&);
48   void     remove_one(CKT_BASE*);
49   void     add_list(CS&);
size()50   int	   size()const		{return static_cast<int>(bag.size());}
begin()51   const_iterator begin()const	{return bag.begin();}
end()52   const_iterator end()const	{return bag.end();}
begin()53   iterator begin()		{return bag.begin();}
end()54   iterator end()		{return bag.end();}
55 private:
erase(iterator b,iterator e)56   void	  erase(iterator b, iterator e) {bag.erase(b,e);}
57   void	  push_new_probe(const std::string& param, const CKT_BASE* object);
58   bool    add_branches(const std::string&,const std::string&,const CARD_LIST*);
59   void    add_all_nodes(const std::string&);
60 };
61 /*--------------------------------------------------------------------------*/
62 class INTERFACE PROBE_LISTS {
63 public:
64   PROBELIST alarm[sCOUNT]; // list of alarm probes
65   PROBELIST plot[sCOUNT];  // list of plot probes
66   PROBELIST print[sCOUNT]; // list of print probes
67   PROBELIST store[sCOUNT]; // list of probes to store for postproc
68   void purge(CKT_BASE*);
69 };
70 /*--------------------------------------------------------------------------*/
71 /*--------------------------------------------------------------------------*/
72 #endif
73