1 #ifndef SET_PROPERTY_ACTION_
2 #define SET_PROPERTY_ACTION_
6 #include "graph_filter.h"
7 #include "graph_action.h"
8 #include "graph_properties.h"
15 template<
typename GraphType>
21 typedef std::map<std::string, std::string> PropertyMap;
22 typedef PropertyMap::iterator iterator;
23 typedef PropertyMap::const_iterator const_iterator;
33 properties_(properties)
39 GraphAction<
GraphType>(copy), properties_(copy.properties_), property_values_(copy.property_values_) {
49 for (iterator it =
begin(); it !=
end(); ++it) {
50 properties_.set_property(edge, it->first, it->second);
65 for(iterator it =
begin(); it !=
end(); ++it)
66 properties_.set_property(m, it->first, it->second);
72 template<
typename P1,
typename P2>
78 iterator
begin() {
return property_values_.begin(); }
81 iterator
end() {
return property_values_.end(); }
85 property_values_[name] = value;
91 return property_values_[name];
96 PropertyMap property_values_;
virtual bool operator()(E_type edge)
Definition: set_property_action.h:46
SetPropertyAction(SetPropertyAction ©)
Copy constructor.
Definition: set_property_action.h:38
Forward declarations for functors.
Definition: defines.h:32
void set_property(std::string name, std::string value)
Sets a specific property to be set when finding nodes matching the filter.
Definition: set_property_action.h:84
iterator begin()
Returns an iterator to the beginning of a map of property name/values.
Definition: set_property_action.h:78
Definition: graph_action.h:13
SetPropertyAction(GraphProperties< GraphType > &properties, GraphFilter< GraphType > *property_filter)
Definition: set_property_action.h:30
Definition: graph_filter.h:15
Definition: graph_properties.h:7
bool run_filter(P arg)
Definition: graph_action.h:70
iterator end()
Returns an iterator to the end of a map of property name/values.
Definition: set_property_action.h:81
std::string get_property(std::string name)
Definition: set_property_action.h:90
GraphFilter< GraphType > * filter_
The filter is used to indicate whether the action should be taken or not.
Definition: graph_action.h:79
unsigned int index_type_t
The type of index used for the nodes in the graph.
Definition: grapher.h:52
Definition: set_property_action.h:16