Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost Graph: determining type of bundled property
From: Dmitry Bufistov (dmitry_at_[hidden])
Date: 2010-04-09 06:59:18


Jeremiah Willcock wrote:
> On Wed, 7 Apr 2010, Trevor Harmon wrote:
>
>> Hi,
>>
[snip].
>
>> My goal is to be able to iterate through the vertices and perform
>> different actions depending on the type of vertex. (e.g., if vertex
>> type is EntryVertex do this, if vertex type is ExitVertex do that,
>> etc.) However, I don't know how to determine a vertex's type. The
>> bundles document mentions something about
I feel that I'm missing something, but what if you store the type of the
vertex in the base class: ?
class BaseVertex { int m_type; public: BaseVertex() : m_type(0) {} };
struct EntryVertex : public BaseVertex { EtntryVertex() : m_type(1) {} };
Then, you can determine the type of the vertex at run time )

[snip]

Dmitry


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net