Tulip  4.2.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
StringProperty.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux 1 and Inria Bordeaux - Sud Ouest
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 
20 #ifndef TULIP_STRING_H
21 #define TULIP_STRING_H
22 
23 #include <tulip/PropertyTypes.h>
24 #include <tulip/AbstractProperty.h>
25 #include <tulip/PropertyAlgorithm.h>
26 
27 namespace tlp {
28 
29 class PropertyContext;
30 
31 typedef AbstractProperty<tlp::StringType, tlp::StringType> AbstractStringProperty;
32 
33 /**
34  * @ingroup Graph
35  * @brief A graph property that maps a std::string value to graph elements.
36  */
37 class TLP_SCOPE StringProperty:public AbstractStringProperty {
38 public :
39  StringProperty (Graph *g, std::string n="") :AbstractStringProperty(g, n) {}
40 
41  // redefinition of some PropertyInterface methods
42  PropertyInterface* clonePrototype(Graph *, const std::string& );
43  static const std::string propertyTypename;
44  std::string getTypename() const {
45  return propertyTypename;
46  }
47 
48  int compare(const node n1,const node n2)const;
49  int compare(const edge e1,const edge e2)const;
50 };
51 
52 /**
53  * @ingroup Graph
54  * @brief A graph property that maps a std::vector<std::string> value to graph elements.
55  */
56 class TLP_SCOPE StringVectorProperty:public AbstractVectorProperty<tlp::StringVectorType, tlp::StringType> {
57 public :
58  StringVectorProperty(Graph *g, std::string n=""):AbstractVectorProperty<StringVectorType, tlp::StringType>(g, n) {}
59 
60  // redefinition of some PropertyInterface methods
61  PropertyInterface* clonePrototype(Graph *, const std::string& );
62  static const std::string propertyTypename;
63  std::string getTypename() const {
64  return propertyTypename;
65  }
66 
67 };
68 /*\@}*/
69 }
70 #endif