Tulip  4.6.0
Better Visualization Through Research
library/tulip-core/include/tulip/PropertyManager.h
00001 /*
00002  *
00003  * This file is part of Tulip (www.tulip-software.org)
00004  *
00005  * Authors: David Auber and the Tulip development Team
00006  * from LaBRI, University of Bordeaux
00007  *
00008  * Tulip is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation, either version 3
00011  * of the License, or (at your option) any later version.
00012  *
00013  * Tulip is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  * See the GNU General Public License for more details.
00017  *
00018  */
00019 ///@cond DOXYGEN_HIDDEN
00020 
00021 
00022 #ifndef DOXYGEN_NOTFOR_DEVEL
00023 #ifndef TLP_PROPERTYMANAGER_H
00024 #define TLP_PROPERTYMANAGER_H
00025 
00026 #include <map>
00027 #include <string>
00028 
00029 namespace tlp {
00030 
00031 template<class itType >
00032 struct Iterator;
00033 
00034 class PropertyInterface;
00035 class Graph;
00036 
00037 class PropertyManager {
00038 
00039 private:
00040   std::map<std::string, PropertyInterface*> localProperties;
00041   std::map<std::string, PropertyInterface*> inheritedProperties;
00042 
00043 public:
00044   Graph *graph;
00045   explicit  PropertyManager(Graph*);
00046   ~PropertyManager();
00047   //======================================================================================
00048   bool existProperty(const std::string&) const;
00049   bool existLocalProperty(const std::string&) const;
00050   bool existInheritedProperty(const std::string&) const;
00051   void setLocalProperty(const std::string&, PropertyInterface *);
00052   bool renameLocalProperty(PropertyInterface *, const std::string&);
00053   PropertyInterface* getProperty(const std::string&) const;
00054   PropertyInterface* getLocalProperty(const std::string&) const;
00055   PropertyInterface* getInheritedProperty(const std::string&) const;
00056   void delLocalProperty(const std::string&);
00057   void notifyBeforeDelInheritedProperty(const std::string&);
00058   void erase(const node );
00059   void erase(const edge );
00060   //======================================================================================
00061   Iterator<std::string>* getLocalProperties();
00062   Iterator<std::string>* getInheritedProperties();
00063   Iterator<PropertyInterface*>* getLocalObjectProperties();
00064   Iterator<PropertyInterface*>* getInheritedObjectProperties();
00065 
00066 protected:
00067   void setInheritedProperty(const std::string&, PropertyInterface *);
00068 };
00069 
00070 }
00071 
00072 #endif
00073 #endif //DOXYGEN_NOTFOR_DEVEL
00074 ///@endcond
 All Classes Files Functions Variables Enumerations Enumerator Properties