Version: 9.16.0
PropertyInterface.cxx
Go to the documentation of this file.
1// Copyright (C) 2006-2026 CEA, EDF
2//
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, or (at your option) any later version.
7//
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.
12//
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
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20#include "PropertyInterface.hxx"
21
22//#define _DEVDEBUG_
23#include "YacsTrace.hxx"
24
25using namespace std;
26using namespace YACS::ENGINE;
27
33PropertyInterface::~PropertyInterface()
34{
35}
36
37void PropertyInterface::setProperty(const std::string& name, const std::string& value)
38{
39 DEBTRACE("PropertyInterface::setProperty " << name << " " << value);
40 _propertyMap[name]=value;
41}
42
44
48std::string PropertyInterface::getProperty(const std::string& name)
49{
50 DEBTRACE("PropertyInterface::getProperty " << name );
51 return _propertyMap[name];
52}
53
54void PropertyInterface::setProperties(std::map<std::string,std::string> properties)
55{
56 DEBTRACE("PropertyInterface::setProperties " );
57 _propertyMap.clear();
58 std::map<std::string,std::string>::iterator it;
59 for (it = properties.begin(); it != properties.end(); ++it)
60 {
61 setProperty(it->first, it->second); // setProperty virtual and derived
62 }
63}
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
virtual void setProperty(const std::string &name, const std::string &value)
std::map< std::string, std::string > _propertyMap
virtual void setProperties(std::map< std::string, std::string > properties)
virtual std::string getProperty(const std::string &name)
Get a property value given its name.