FAUST compiler  0.9.9.6b8
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
cableSchema Class Reference

Simple cables (identity box) in parallel. More...

#include <cableSchema.h>

Inheritance diagram for cableSchema:
Inheritance graph
[legend]
Collaboration diagram for cableSchema:
Collaboration graph
[legend]

Public Member Functions

virtual void place (double x, double y, int orientation)
 Place the communication points vertically spaced by dWire. More...
 
virtual void draw (device &dev)
 Nothing to draw. More...
 
virtual point inputPoint (unsigned int i) const
 input and output points are the same as the width is 0 More...
 
virtual point outputPoint (unsigned int i) const
 input and output points are the same as the width is 0 More...
 
virtual void collectTraits (collector &c)
 Nothing to collect. More...
 
- Public Member Functions inherited from schema
 schema (unsigned int inputs, unsigned int outputs, double width, double height)
 
virtual ~schema ()
 
double width () const
 
double height () const
 
unsigned int inputs () const
 
unsigned int outputs () const
 
void beginPlace (double x, double y, int orientation)
 
void endPlace ()
 
bool placed () const
 
double x () const
 
double y () const
 
int orientation () const
 

Private Member Functions

 cableSchema (unsigned int n)
 Build n cables in parallel. More...
 

Private Attributes

vector< pointfPoint
 

Friends

schemamakeCableSchema (unsigned int n)
 Build n cables in parallel. More...
 

Detailed Description

Simple cables (identity box) in parallel.

The width of a cable is null. Therefore input and output connection points are the same. The constructor is private to enforce the use of makeCableSchema.

Definition at line 34 of file cableSchema.h.

Constructor & Destructor Documentation

cableSchema::cableSchema ( unsigned int  n)
private

Build n cables in parallel.

Definition at line 42 of file cableSchema.cpp.

References fPoint.

43  : schema (n, n, 0, n*dWire)
44 {
45  for (unsigned int i=0; i<n; i++) fPoint.push_back(point(0,0));
46 }
const double dWire
distance between two wires
Definition: schema.h:33
vector< point > fPoint
Definition: cableSchema.h:36
schema(unsigned int inputs, unsigned int outputs, double width, double height)
Definition: schema.h:113
Definition: schema.h:40

Member Function Documentation

void cableSchema::collectTraits ( collector c)
virtual

Nothing to collect.

Actual collect will take place when the wires are enlargered

Implements schema.

Definition at line 83 of file cableSchema.cpp.

84 {
85 }
void cableSchema::draw ( device dev)
virtual

Nothing to draw.

Actual drawing will take place when the wires are enlargered

Implements schema.

Definition at line 73 of file cableSchema.cpp.

74 {
75 }
point cableSchema::inputPoint ( unsigned int  i) const
virtual

input and output points are the same as the width is 0

Implements schema.

Definition at line 90 of file cableSchema.cpp.

References fPoint, and schema::inputs().

91 {
92  assert(i<inputs());
93  return fPoint[i];
94 }
unsigned int inputs() const
Definition: schema.h:128
vector< point > fPoint
Definition: cableSchema.h:36

Here is the call graph for this function:

point cableSchema::outputPoint ( unsigned int  i) const
virtual

input and output points are the same as the width is 0

Implements schema.

Definition at line 99 of file cableSchema.cpp.

References fPoint, and schema::outputs().

100 {
101  assert(i<outputs());
102  return fPoint[i];
103 }
unsigned int outputs() const
Definition: schema.h:129
vector< point > fPoint
Definition: cableSchema.h:36

Here is the call graph for this function:

void cableSchema::place ( double  x,
double  y,
int  orientation 
)
virtual

Place the communication points vertically spaced by dWire.

Implements schema.

Definition at line 52 of file cableSchema.cpp.

References schema::beginPlace(), dWire, schema::endPlace(), fPoint, schema::height(), schema::inputs(), and kLeftRight.

53 {
54  beginPlace(ox, oy, orientation);
55  if (orientation == kLeftRight) {
56  for (unsigned int i=0; i<inputs(); i++) {
57  fPoint[i] = point(ox, oy + dWire/2.0 + i*dWire);
58  }
59  } else {
60  for (unsigned int i=0; i<inputs(); i++) {
61  fPoint[i] = point(ox, oy + height() - dWire/2.0 - i*dWire);
62  }
63  }
64  endPlace();
65 }
void endPlace()
Definition: schema.h:134
const double dWire
distance between two wires
Definition: schema.h:33
void beginPlace(double x, double y, int orientation)
Definition: schema.h:132
unsigned int inputs() const
Definition: schema.h:128
vector< point > fPoint
Definition: cableSchema.h:36
int orientation() const
Definition: schema.h:140
Definition: schema.h:40
double height() const
Definition: schema.h:127

Here is the call graph for this function:

Friends And Related Function Documentation

schema* makeCableSchema ( unsigned int  n)
friend

Build n cables in parallel.

Definition at line 32 of file cableSchema.cpp.

33 {
34  assert(n>0);
35  return new cableSchema(n);
36 }
cableSchema(unsigned int n)
Build n cables in parallel.
Definition: cableSchema.cpp:42

Member Data Documentation

vector<point> cableSchema::fPoint
private

Definition at line 36 of file cableSchema.h.

Referenced by cableSchema(), inputPoint(), outputPoint(), and place().


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