20 #ifndef __SWITCH_HXX__
21 #define __SWITCH_HXX__
41 int edGetNumberOfOutLinks()
const;
42 std::set<InPort *> edSetInPort()
const;
43 bool isAlreadyLinkedWith(
InPort *withp)
const;
44 std::string getNameOfTypeOfCurrentInstance()
const;
45 void edRemoveAllLinksLinkedWithMe() throw(
Exception);
47 void getAllRepresented(std::set<
OutPort *>& represented) const;
48 bool addInPort(
InPort *inPort) throw(Exception);
49 int removeInPort(
InPort *inPort,
bool forward) throw(Exception);
51 void getHumanReprOfIncompleteCases(std::ostream& stream) const;
53 bool removePotentialProducerForMaster();
54 void checkConsistency(
LinkInfo& info) const;
57 void addPotentialProducerForMaster(
OutPort *port);
58 bool checkManagementOfPort(
OutPort *port) throw(Exception);
61 std::
string _className;
63 std::map<
int,
OutPort *> _potentialProducers;
77 void exForwardFailed();
78 void exForwardFinished();
89 static const char DEFAULT_NODE_NAME[];
90 static const char SELECTOR_INPUTPORT_NAME[];
100 Switch(
const std::string& name);
102 void exUpdateState();
103 void init(
bool start=
true);
105 Node *edSetDefaultNode(
Node *DISOWNnode);
107 Node *edReleaseCase(
int caseId) throw(Exception);
108 Node *edGetNode(
int caseId);
109 Node *edSetNode(
int caseId,
Node *DISOWNnode) throw(Exception);
110 void edChangeCase(
int oldCase,
int newCase);
111 virtual
bool edAddChild(
Node *DISOWNnode) throw(Exception);
113 void getReadyTasks(std::vector<
Task *>& tasks);
114 std::list<
Node *> edGetDirectDescendants() const;
116 void writeDot(std::ostream &os)
const;
117 int getNumberOfInputPorts()
const;
118 int getMaxLevelOfParallelism()
const;
120 std::list<InputPort *> getSetOfInputPort()
const;
121 std::list<InputPort *> getLocalInputPorts()
const;
126 Node *getChildByShortName(
const std::string& name)
const throw(
Exception);
127 std::string getMyQualifiedName(
const Node *directSon)
const;
128 std::string getCaseId(
const Node *node)
const throw(
Exception);
129 virtual void accept(
Visitor *visitor);
130 int getRankOfNode(
Node *node)
const;
131 virtual std::string
typeName() {
return "YACS__ENGINE__Switch";}
132 std::list<ProgressWeight> getProgressWeight()
const;
136 std::set<InPort *> getAllInPortsComingFromOutsideOfCurrentScope()
const;
137 void checkLinkPossibility(
OutPort *start,
const std::list<ComposedNode *>& pointsOfViewStart,
138 InPort *end,
const std::list<ComposedNode *>& pointsOfViewEnd)
throw(
Exception);
139 void buildDelegateOf(std::pair<OutPort *, OutPort *>& port,
InPort *finalTarget,
const std::list<ComposedNode *>& pointsOfView);
140 void getDelegateOf(std::pair<OutPort *, OutPort *>& port,
InPort *finalTarget,
const std::list<ComposedNode *>& pointsOfView)
throw(
Exception);
141 void releaseDelegateOf(
OutPort *portDwn,
OutPort *portUp,
InPort *finalTarget,
const std::list<ComposedNode *>& pointsOfView)
throw(
Exception);
142 void checkCFLinks(
const std::list<OutPort *>& starts,
InputPort *end,
unsigned char& alreadyFed,
bool direction,
LinkInfo& info)
const;
143 void checkControlDependancy(
OutPort *start,
InPort *end,
bool cross,
144 std::map <
ComposedNode *, std::list < OutPort * > >& fw,
145 std::vector<OutPort *>& fwCross,
148 void checkNoCyclePassingThrough(
Node *node)
throw(
Exception);
150 int getNbOfCases()
const;
151 static std::string getRepresentationOfCase(
int i);