1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
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.
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 // Author: Guillaume Boulant (EDF/R&D)
22 #include "DataObject.hxx"
23 #include <Basics_Utils.hxx>
26 int DataObject::_lastId=0;
27 const string DataObject::_BASENAME = string("object_");
28 const string DataObject::pathsep = string("/");
30 DataObject::DataObject() {
31 _nameId = _BASENAME+ToString(_lastId);
33 // The default label is set to the nameId, but it can be modified
34 // using setLabel whereas the nameId can't be modified.
38 DataObject::~DataObject() {
42 void DataObject::setLabel(string label) {
45 string DataObject::getLabel() {
49 string DataObject::getPathName() {
51 pathName = this->getPath() + pathsep + this->getLabel();
56 string DataObject::getNameId() {
60 void DataObject::setProperty(string key, string value) {
61 _properties[key] = value;
63 string DataObject::getProperty(string key) {
64 return _properties[key];
67 string DataObject::toString() {
68 string serialize="\n";
69 serialize+="nameId = "+getNameId()+"\n";
70 serialize+="label = "+getLabel()+"\n";
71 serialize+="path = "+getPath();