From a20ba17cd872f4a69aa868def9d78b40b1d3a936 Mon Sep 17 00:00:00 2001 From: srn Date: Fri, 3 Feb 2006 09:52:52 +0000 Subject: [PATCH] Added IParameters interafce --- src/SALOMEDS/Makefile.in | 6 +- src/SALOMEDS/SALOMEDS_IParameters.cxx | 86 +++++++++++++++++++++++++++ src/SALOMEDS/SALOMEDS_IParameters.hxx | 83 ++++++++++++++++++++++++++ 3 files changed, 173 insertions(+), 2 deletions(-) create mode 100644 src/SALOMEDS/SALOMEDS_IParameters.cxx create mode 100644 src/SALOMEDS/SALOMEDS_IParameters.hxx diff --git a/src/SALOMEDS/Makefile.in b/src/SALOMEDS/Makefile.in index 9a686f4d5..23418512b 100644 --- a/src/SALOMEDS/Makefile.in +++ b/src/SALOMEDS/Makefile.in @@ -24,7 +24,8 @@ EXPORT_HEADERS= \ SALOMEDS_SComponent_i.hxx \ SALOMEDS_SComponent.hxx \ SALOMEDS_GenericAttribute_i.hxx \ - SALOMEDS_GenericAttribute.hxx + SALOMEDS_GenericAttribute.hxx \ + SALOMEDS_IParameters.hxx # Libraries targets @@ -109,7 +110,8 @@ LIB_SRC = \ SALOMEDS_AttributeTextHighlightColor.cxx \ SALOMEDS_AttributeTreeNode.cxx \ SALOMEDS_AttributeUserID.cxx \ - SALOMEDS_AttributeParameter.cxx + SALOMEDS_AttributeParameter.cxx \ + SALOMEDS_IParameters.cxx # Executables targets diff --git a/src/SALOMEDS/SALOMEDS_IParameters.cxx b/src/SALOMEDS/SALOMEDS_IParameters.cxx new file mode 100644 index 000000000..1d98810aa --- /dev/null +++ b/src/SALOMEDS/SALOMEDS_IParameters.cxx @@ -0,0 +1,86 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ +// +#include "SALOMEDS_IParameters.hxx" +#include + +using namespace std; + +#define PT_INTEGER 0 +#define PT_REAL 1 +#define PT_BOOLEAN 2 +#define PT_STRING 3 +#define PT_REALARRAY 4 +#define PT_INTARRAY 5 +#define PT_STRARRAY 6 + + +/*! + Constructor +*/ +SALOMEDS_IParameters::SALOMEDS_IParameters(const _PTR(AttributeParameter)& ap) +{ + _ap = ap; +} + + +int SALOMEDS_IParameters::append(const string& listName, const string& value) +{ + return -1; +} + +int SALOMEDS_IParameters::nbValues(const string& listName) +{ + return -1; +} + +vector SALOMEDS_IParameters::getValues(const string& listName) +{ + vector v; + return v; +} + + +string SALOMEDS_IParameters::getValue(const string& listName, int index) +{ + return ""; +} + + +void SALOMEDS_IParameters::setParameter(const string& entry, const string& parameterName, const string& value) +{ + +} + + +string SALOMEDS_IParameters::getParameter(const string& entry, const string& parameterName) +{ + return ""; +} + + +void SALOMEDS_IParameters::getAllParameters(const string& entry, vector& names, vector& values) +{ +} + + +int SALOMEDS_IParameters::getNbParameters(const string& entry) +{ + return -1; +} + diff --git a/src/SALOMEDS/SALOMEDS_IParameters.hxx b/src/SALOMEDS/SALOMEDS_IParameters.hxx new file mode 100644 index 000000000..fb5287215 --- /dev/null +++ b/src/SALOMEDS/SALOMEDS_IParameters.hxx @@ -0,0 +1,83 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ +// +#ifndef SALOMEDS_IParameters_H +#define SALOMEDS_IParameters_H + +#include +#include + +#include "SALOMEDSClient_AttributeParameter.hxx" + +/*! + Class which an interface to store the parameters of the objects +*/ +class SALOMEDS_IParameters +{ +public: + SALOMEDS_IParameters(const _PTR(AttributeParameter)& ap); + + /*! + Appends a string value to a named list. + Returns a number of the added value. + Note: the name of the list MUST be unique + */ + int append(const std::string& listName, const std::string& value); + + /*! + Returns a number elements in the list + */ + int nbValues(const std::string& listName); + + /*! + Returns a list of values in the list + */ + std::vector getValues(const std::string& listName); + + /*! + Returns a value with given index + */ + std::string getValue(const std::string& listName, int index); + + /*! + Sets a new named parameter value for the given entry + */ + void setParameter(const std::string& entry, const std::string& parameterName, const std::string& value); + + /*! + Gets a named parameter value for the given entry + */ + std::string getParameter(const std::string& entry, const std::string& parameterName); + + /*! + Returns all parameter names and their values of the given entry + */ + void getAllParameters(const std::string& entry, std::vector& names, std::vector& values); + + /*! + Returns a number of parameters of the given entry + */ + int getNbParameters(const std::string& entry); + +private: + _PTR(AttributeParameter) _ap; + +}; + + +#endif -- 2.39.2