]> SALOME platform Git repositories - modules/yacs.git/blobdiff - src/engine/NbBranches.cxx
Salome HOME
Ready to unplug nbOfBranches from foreach
[modules/yacs.git] / src / engine / NbBranches.cxx
index b39e4ce62119acb7469d21f3db6a60aa30ce8776..bf7a8e1193b8b5d23e5eec2e558117a8933b2762 100644 (file)
 
 using namespace YACS::ENGINE;
 
-const char NbBranches::NAME_OF_NUMBER_OF_BRANCHES[]="nbBranches";
+const char NbBranchesAbstract::NAME_OF_NUMBER_OF_BRANCHES[]="nbBranches";
+
+bool NbBranchesAbstract::IsBranchPortName(const std::string& name)
+{
+  return name == NAME_OF_NUMBER_OF_BRANCHES;
+}
+
+std::unique_ptr<NbBranchesAbstract> NbBranches::copy(Node *node) const
+{
+  return std::unique_ptr<NbBranchesAbstract>(new NbBranches(*this,node));
+}
+
+bool NbBranches::isMyName(const std::string& name) const
+{
+  return NbBranchesAbstract::IsBranchPortName(name);
+}
 
 void NbBranches::exInit(bool start)
 {
@@ -50,7 +65,31 @@ void NbBranches::forceMultiplicity(unsigned value)
   _nbOfBranches.edInit((int)value);
 }
 
-bool NbBranches::IsBranchPortName(const std::string& name)
+std::unique_ptr<NbBranchesAbstract> NoNbBranches::copy(Node *) const
 {
-  return name == NAME_OF_NUMBER_OF_BRANCHES;
-}
\ No newline at end of file
+  return std::unique_ptr<NbBranchesAbstract>(new NoNbBranches);
+}
+
+void NoNbBranches::exInit(bool start)
+{
+}
+
+InputPort *NoNbBranches::getPort() const
+{
+  return nullptr;
+}
+
+bool NoNbBranches::isMultiplicitySpecified(unsigned& value) const
+{
+  return false;
+}
+
+void NoNbBranches::forceMultiplicity(unsigned value)
+{
+  throw Exception("NoNbBranches::forceMultiplicity : impossible to be forced !");
+}
+
+int NoNbBranches::getIntValue() const
+{
+  throw Exception("NoNbBranches::getIntValue : no value stored !");
+}