X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fengine%2FNbBranches.cxx;h=fe7ae53d3b6fe4d3c7731df3db0db1620d152da3;hb=fd4934f49ee2770cd881b0f25a4bb00b12183b68;hp=b39e4ce62119acb7469d21f3db6a60aa30ce8776;hpb=27530cea88069c0cb2321b83c42b33062bddb288;p=modules%2Fyacs.git diff --git a/src/engine/NbBranches.cxx b/src/engine/NbBranches.cxx index b39e4ce62..fe7ae53d3 100644 --- a/src/engine/NbBranches.cxx +++ b/src/engine/NbBranches.cxx @@ -21,7 +21,27 @@ 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 NbBranches::copy(Node *node) const +{ + return std::unique_ptr(new NbBranches(*this,node)); +} + +int NbBranches::getNumberOfBranches(int) const +{ + return this->getIntValue(); +} + +bool NbBranches::isMyName(const std::string& name) const +{ + return NbBranchesAbstract::IsBranchPortName(name); +} void NbBranches::exInit(bool start) { @@ -50,7 +70,36 @@ void NbBranches::forceMultiplicity(unsigned value) _nbOfBranches.edInit((int)value); } -bool NbBranches::IsBranchPortName(const std::string& name) +std::unique_ptr NoNbBranches::copy(Node *) const { - return name == NAME_OF_NUMBER_OF_BRANCHES; -} \ No newline at end of file + return std::unique_ptr(new NoNbBranches); +} + +int NoNbBranches::getNumberOfBranches(int nbOfElems) const +{ + return nbOfElems; +} + +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 !"); +}