Boost Graph Library Properties with property<PropertyTag, T, NextProperty>
This class can be used with the adjacency_list and the adjacency_matrix classes to specify what kind of properties should be attached to the vertices and edges of the graph, and to the graph object itself.
This class is defined in boost/pending/property.hpp
Template Parameters
| Parameter | Description | Default |
|---|---|---|
PropertyTag |
A type to identify (give a unique name to) the property. There are several predefined tags, and it is easy to add more. For convenience, BGL also provides predefined objects of the tag types (enum values) for use as arguments to functions that expect property tag objects (such as adjacency_list's property map accessor functions). | |
T |
This type specifies the type of the property values, such as int or std::string. |
|
NextProperty |
This parameter allows property types to be nested, so that an arbitrary number of properties can be attached to the same graph. | boost::no_property |
Member Functions
property()- Construct a property object with member m_value a default constructed instance of type T and with the super object default constructed. Note that T must be Default Constructible for this property, and all the inherited property types.
property(const T& v)- Construct a property object with member m_value a copy of v.
property(const T& v, const NextProperty& b)- Construct a property object with member m_value a copy of v and whose super class NextProperty is constructed from b.
Synopsis
namespace boost {
template <class Tag, class T, class NextProperty = no_property>
struct property : public NextProperty {
typedef NextProperty next_type;
typedef Tag tag_type;
typedef T value_type;
property();
property(const T& v);
property(const T& v, const NextProperty& b);
// copy constructor and assignment operator will be generated by compiler
T m_value;
};
}