1 // Copyright (C) 2006-2012 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "PropertyInterface.hxx"
23 #include "YacsTrace.hxx"
26 using namespace YACS::ENGINE;
28 /*! \class YACS::ENGINE::PropertyInterface
29 * \brief Class for adding property interface to another class
33 PropertyInterface::~PropertyInterface()
37 void PropertyInterface::setProperty(const std::string& name, const std::string& value)
39 DEBTRACE("PropertyInterface::setProperty " << name << " " << value);
40 _propertyMap[name]=value;
43 //! Get a property value given its name
45 * \param name : the property name
46 * \return the property value
48 std::string PropertyInterface::getProperty(const std::string& name)
50 DEBTRACE("PropertyInterface::getProperty " << name );
51 return _propertyMap[name];
54 void PropertyInterface::setProperties(std::map<std::string,std::string> properties)
56 DEBTRACE("PropertyInterface::setProperties " );
58 std::map<std::string,std::string>::iterator it;
59 for (it = properties.begin(); it != properties.end(); ++it)
61 setProperty(it->first, it->second); // setProperty virtual and derived