Top Up Prev Next Bottom Contents Index Search

14.2 Class EGGate

Class EGGate is a terminal in an EGNode for connection with other EGNodes. A list of EGGates will become a member of EGNode, called ancestors or descendants based on the direction of connection.

14.2.1 EGGate public members

EGGate(EGNode* parent, PortHole* pPort); 
Is a constructor. The first argument is the EGNode that this EGGate belongs to, and the second argument is the corresponding porthole of the original SDF graph.

const PortHole* aliasedPort(); 
const char* name() const;
The above methods returns the corresponding porthole of the original SDF graph, the name of the porthole.

int isItInput(); 
Returns TRUE or FALSE based on whether the corresponding porthole is an input or not.

void allocateArc(EGGate* dest, int no_samples, int no_delay); 
The method creates a connection between this EGGate and the first argument by allocating an arc with information from the second and the third arguments. It should be called once per connection.

int samples();
int delay();
void addSamples(int increments);
These methods call the corresponding methods of the EGArc class if an arc was already allocated by allocateArc.

EGGate* farGate(); 
EGNode* farEndNode();
DataFlowStar* farEndMaster();
int farEndInvocation();
The above methods query information about the other side of the connection: EGGate, EGNode, the original DataFlowStar that the EGNode points to, and the invocation number of the EGNode.

StringList printMe(); 
It prints the information of the arc allocated: the sample rate and the initial delay.

void setProperty(PortHole* pPort, int index); 
This method sets the pointer to the corresponding porthole of the original SDF graph and the index of the EGGate. Since multiple EGGates in an EGNode may be mapped to the same porthole in the original SDF graph, we order the EGGates by indices.

void setLink(EGGateLink* p); 
EGGateLink* getLink();
Since the list of EGGates is maintained as a derived class of DoubleLinkList, an EGGate is assigned an EGGateLink that is derived from the DoubleLink class. These methods set and get the assigned EGGateLink.

void hideMe(int flag); 
If the initial delay is greater than or equal to the sample rate in an EGArc, the precedence relationship between the source and the destination of the arc disappears while not removing the arc from the APEG. This method removes this EGGate from the access list of EGGates (ancestors or descendants), and stores it in the list of hidden EGGates (hiddenGates) of the parent EGNode . If the argument flag is NULL, it calls the same method for the EGGate of the other side of connection. By default, the flag is NULL.

virtual ~EGGate(); 
Is a virtual destructor that deletes the allocated arc, removes itself from the list of EGGates.

14.2.2 Class EGGateList

This class, derived from DoubleLinkList, contains a list of EGGates. An EGGate is assigned to an EGGateLink and the EGGateList class accesses an EGGate through the assigned EGGateLink.

The following ordering is maintained in the precedence list: entries for the same far-end EGNode occur together (one after another), and they occur in order of increasing invocation number. Entries for the same invocation occur in increasing order of the number of delays on the arc.

class EGGateLink

EGGateLink(EGGate* e); 
The constructor has an argument for an EGGate.

EGGate* gate(); 
EGGateLink* nextLink();
These methods return the corresponding EGGate and the next link in the parent list.

void removeMeFromList(); 
Removes this link from the parent list.

EGGateList public members

Class EGGateList has a default constructor.

void initialize(); 
This method deletes all EGGates in the list and initialize the list. It is called inside the destructor.

DoubleLink* createLink(EGGate* e); 
Creates an EGGateLink for the argument EGGate.

void insertGate(EGGate* e, int update); 
This method insert a new EGGate into the proper position in the precedence list. The update parameter indicates whether or not to update the arc data if an EGGate with the same far-end EGNode and delay, already exists. If update is 0, the argument EGGate will be deleted if redundant. If 1, the arc information of the existing EGGate will be updated (sample rate will be increased). When we insert an EGGate to the descendants list of the parent EGNode, we set update to be 1. If the EGGate will be added to the ancestors, the variable is set 0.

StringList printMe(); 
Prints the list of EGGates.

Iterator for EGGateList

Class EGGateLinkIter is derived from class DoubleLinkIter. The constructor has an argument of the reference to a constant EGGateList object. It returns EGGates. This class has a special method to return the next EGGate connected to a new farEndMaster that is different from the argument DataFlowStar.

EGGate* nextMaster(DataFlowStar* master); 

Top Up Prev Next Bottom Contents Index Search
Copyright © 1990-1997, University of California. All rights reserved.