Salome HOME
PR: first version from Antony GEAY, with directory restructuration
[modules/yacs.git] / src / engine / Switch.cxx
1 #include "Switch.hxx"
2
3 using namespace YACS::ENGINE;
4
5 Switch::Switch(const std::string& name):ComposedNode(name)
6 {
7 }
8
9 Switch::~Switch()
10 {
11 }
12
13 void Switch::edSetNumberOfCases(int numberOfCases)
14 {
15   _vectorOfNode.resize(numberOfCases);
16 }
17
18 void Switch::edSetNode(int caseId, Node *node) throw(Exception)
19 {
20   if(caseId>=_vectorOfNode.size())
21     throw Exception("Switch::edSetNode : caseId is too large compared to number of cases");
22   _vectorOfNode[caseId]=node;
23 }
24
25 void Switch::checkNoCyclePassingThrough(Node *node) throw(Exception)
26 {
27   throw Exception("Switch::checkNoCyclePassingThrough : uncorrect control flow link relative to switch");
28 }