simulavr  1.1.0
net.h
Go to the documentation of this file.
1 /*
2  ****************************************************************************
3  *
4  * simulavr - A simulator for the Atmel AVR family of microcontrollers.
5  * Copyright (C) 2001, 2002, 2003 Klaus Rudolph
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 2 of the License, or
10  * (at your option) 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 along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  ****************************************************************************
22  *
23  * $Id$
24  */
25 
26 #ifndef NET
27 #define NET
28 
29 #include <vector>
30 
31 #include "pin.h"
32 
34 class Net
35 #ifndef SWIG
36  : public std::vector <Pin *>
37 #endif
38 {
39  public:
40  //Net() {} //!< Common Constructor, initially it'a a "empty net" and useless!
41  virtual ~Net();
42  void Add(Pin *p);
43  virtual void Delete(Pin *p);
44  virtual bool CalcNet();
46 
47  private:
48  friend void Pin::RegisterNet(Net*);
49 };
50 
51 #endif
virtual bool CalcNet()
Calculate a "electrical potential" on the net and set all pin inputs with this value.
Definition: net.cpp:50
Pin class, handles input and output to external parts.
Definition: pin.h:98
void Add(Pin *p)
Add a pin to net, e.g. connect a pin to others.
Definition: net.cpp:29
virtual void Delete(Pin *p)
Definition: net.cpp:35
virtual ~Net()
Destructor, disconnects save all pins, which are connected.
Definition: net.cpp:45
virtual void RegisterNet(Net *n)
registers Net instance on pin
Definition: pin.cpp:168
Connect Pins to each other and transfers a output change from a pin to input values for all pins...
Definition: net.h:34