viminfo
[gnucap-felix.git] / include / u_probe.h
blob37cc4da09cc4c719be3ed78323e5cc6c8ca97482
1 /*$Id: u_probe.h,v 26.81 2008/05/27 05:34:00 al Exp $ -*- C++ -*-
2 * Copyright (C) 2001 Albert Davis
3 * Author: Albert Davis <aldavis@gnu.org>
5 * This file is part of "Gnucap", the Gnu Circuit Analysis Package
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.
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.
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 * single probe item
24 //testing=script,complete 2006.07.14
25 #ifndef U_PROBE_H
26 #define U_PROBE_H
27 #include "l_compar.h" // inorder
28 /*--------------------------------------------------------------------------*/
29 class CKT_BASE;
30 /*--------------------------------------------------------------------------*/
31 class INTERFACE PROBE {
32 private:
33 std::string _what;
34 const CKT_BASE* _brh;
35 double _lo,_hi;
36 public:
37 explicit PROBE(const std::string& what, const CKT_BASE *brh);
38 PROBE(const PROBE& p);
39 ~PROBE() {detach();}
41 void set_limit(double Lo,double Hi) {_lo = Lo; _hi = Hi;}
42 void detach();
43 PROBE& operator=(const PROBE& p);
45 const std::string label()const;
46 double value()const;
47 const CKT_BASE* object()const {return _brh;}
48 double lo()const {return _lo;}
49 double hi()const {return _hi;}
50 double range()const {return hi()-lo();}
51 bool in_range()const{return in_order(lo(),value(),hi());}
52 private:
53 double probe_node()const;
55 /*--------------------------------------------------------------------------*/
56 /*--------------------------------------------------------------------------*/
57 #endif
58 // vim:ts=8:sw=2:noet: