#include <port.h>
Public Methods | |
| portArray () | |
| Create an empty (length 0) array. More... | |
| portArray (int l) | |
| Create an array of length l. More... | |
| portArray (const portArray &p) | |
| Copy array p. More... | |
| ~portArray () | |
| Free memory in destructor. More... | |
| int | len () |
| void | set (int index, port value) |
| Set an array element. More... | |
| void | zero () |
| Set all array values to zero. More... | |
| port | get (int index) const |
| Get a port from the array. More... | |
| portArray& | operator= (const portArray &) |
| We must overload the = operator because we use dynamic memory. More... | |
Private Attributes | |
| int | length |
| The length of the array. More... | |
| port* | data |
| The actual list of ports. More... | |
class portArray takes care of dynamic memory allocation and deallocation, provides copy and assignment functions, and handles indexing errors.
A nice future improvement might be to overload the [] operator.
Definition at line 95 of file port.h.
|
|
Create an empty (length 0) array.
|
|
|
Create an array of length l.
|
|
|
Copy array p.
|
|
|
Free memory in destructor.
|
|
|
Get a port from the array.
Definition at line 102 of file port.cc. Referenced by circuit::build_tree(), and connection::get_port().
|
|
|
Definition at line 83 of file port.cc. Referenced by portStack::push().
|
|
|
We must overload the = operator because we use dynamic memory.
|
|
|
Set an array element.
Definition at line 88 of file port.cc. Referenced by circuit::connect(), connection::connection(), and zero().
|
|
|
Set all array values to zero.
|
|
|
The actual list of ports.
|
|
|
The length of the array.
|
Please direct comments and corrections to
supermix@submm.caltech.edu
Go to the supermix home page
Generated by
1.2.7