Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
node.cpp
Go to the documentation of this file.
1 /*
2  * node.cpp - node class implementation
3  *
4  * Copyright (C) 2003, 2004 Stefan Jahn <stefan@lkcc.org>
5  *
6  * This is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * This software is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this package; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  * $Id$
22  *
23  */
24 
25 #if HAVE_CONFIG_H
26 # include <config.h>
27 #endif
28 
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <string.h>
32 
33 #include "complex.h"
34 #include "object.h"
35 #include "node.h"
36 
37 namespace qucs {
38 
39 // Constructor creates an unnamed instance of the node class.
40 node::node () : object () {
41  internal = port = nNode = 0;
42  _circuit = NULL;
43 }
44 
45 // Constructor creates a named instance of the node class.
46 node::node (char * n) : object (n) {
47  internal = port = nNode = 0;
48  _circuit = NULL;
49 }
50 
51 /* The copy constructor creates a new instance of the node class based
52  on the given node object. */
53 node::node (const node & n) : object (n) {
54  internal = n.internal;
55  port = n.port;
56  nNode = n.nNode;
57  _circuit = n._circuit;
58 }
59 
60 // Destructor destroys a node object.
61 node::~node () {
62 }
63 
64 
65 // Sets the unique number of this node.
66 void node::setNode (int n) {
67  nNode = n;
68 }
69 
70 // Returns the unique number of this node.
71 int node::getNode (void) {
72  return nNode;
73 }
74 
75 // Sets the port number of this node.
76 void node::setPort (int n) {
77  port = n;
78 }
79 
80 // Returns the port number of this node.
81 int node::getPort (void) {
82  return port;
83 }
84 
85 // Sets this node's circuit.
86 void node::setCircuit (circuit * c) {
87  _circuit = c;
88 }
89 
90 // Returns this node's circuit.
91 circuit * node::getCircuit (void) {
92  return _circuit;
93 }
94 
95 } // namespace qucs
n
Definition: parse_citi.y:147
base class for qucs circuit elements.
Definition: circuit.h:92
node