Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

branch Class Reference

A connector used to connect several ports of other nport objects in parallel. More...

#include <elements.h>

Inheritance diagram for branch::

nport device List of all members.

Public Methods

 branch (int b=3)
 Default constructor creates a 3-port branch. More...

int size ()
branch& set_branches (int)
 Wrapper function to change the number of branches. More...

int get_branches () const

Private Methods

void calc ()
 The calculation is done here. More...

void recalc ()
 recalc() doesn't need to do anything. More...


Private Attributes

int branches
 The number of branches in this device. More...


Detailed Description

A connector used to connect several ports of other nport objects in parallel.

The default branch has 3 ports. The constructor can take a single int argument to set the number of ports in the branch to some other value:

    branch b;     // default, 3-port branch named "b"
    branch c(4);  // this branch has 4 ports
 

To change the number of ports of the branch once you have declared it, use a member function or assignment as follows:

    c.set_branches(2);  // now c has only 2 ports
    b = branch(5);      // now branch b has 5 ports
 

To find out how many ports a branch has, use either of the following two member functions (each returns an int):

    size();
    get_branches();
 

Definition at line 687 of file elements.h.


Constructor & Destructor Documentation

branch::branch ( int b = 3 ) [explicit]
 

Default constructor creates a 3-port branch.

Parameters:
b   the number of branches (ports).

Definition at line 110 of file elements.cc.


Member Function Documentation

void branch::calc ( ) [private]
 

The calculation is done here.

It is called whenever the number of branches is changed.

Definition at line 127 of file elements.cc.

Referenced by branch(), and set_branches().

int branch::get_branches ( ) const [inline]
 

Returns:
the number of branches (ports).

Definition at line 708 of file elements.h.

void branch::recalc ( ) [inline, private, virtual]
 

recalc() doesn't need to do anything.

Reimplemented from nport.

Definition at line 721 of file elements.h.

branch & branch::set_branches ( int b )
 

Wrapper function to change the number of branches.

Parameters:
b   the new number of branches (ports).

Definition at line 118 of file elements.cc.

int branch::size ( ) [inline, virtual]
 

Returns:
the number of ports

Reimplemented from nport.

Definition at line 698 of file elements.h.


Member Data Documentation

int branch::branches [private]
 

The number of branches in this device.

Default value is 3.

Definition at line 712 of file elements.h.


The documentation for this class was generated from the following files:

Please direct comments and corrections to supermix@submm.caltech.edu
Go to the supermix home page
Generated by doxygen1.2.7