Boost logo

Boost Users :

From: David Ohlemacher (ohlemacher_at_[hidden])
Date: 2003-11-14 13:31:06


Hi all.
 
Partway through my app's execution, I find that I no longer need the
values in a custom internal property map (edge). The map potentially
may be quite large.

What is the best way to empty it?
 
Thanks,
-d

> Here is my implementation. It is right out of your (very helpful) book.
>
> -d
>
> namespace boost
> {
> // ECInGraph custom properties.
> enum vertex_com_t {vertex_com = 1223497};
> enum edge_nEmailsIn_t {edge_nEmailsIn = 1223498};
> enum edge_nEmailsOut_t {edge_nEmailsOut = 1223499};
> enum edge_sourceVD_t {edge_sourceVD = 1223500};
> BOOST_INSTALL_PROPERTY (vertex, com);
> BOOST_INSTALL_PROPERTY (edge, nEmailsIn);
> BOOST_INSTALL_PROPERTY (edge, nEmailsOut);
> BOOST_INSTALL_PROPERTY (edge, sourceVD);
> }
>
>
> typedef boost::property <boost::edge_nEmailsOut_t, int,
> boost::property <boost::edge_nEmailsIn_t, int,
> boost::property <boost::edge_sourceVD_t, unsigned int> > >
> InGraphEdgeProps;
> typedef boost::property <boost::vertex_name_t, std::string,
> boost::property <boost::vertex_com_t, int> >
> InGraphVertexProps;
>
> typedef boost::adjacency_list <
> boost::vecS, // Edge list is a std::vector
> boost::vecS, // Vertex list is a std::vector
> boost::undirectedS, // undirected graph
> InGraphVertexProps, // Vertex properties
> InGraphEdgeProps, // Edge properties
> boost::no_property // Graph properties
> > ECInGraph;
>
>
> void EC::InitGraphPropertyMaps()
> {
> // m_inGraph property maps.
> m_g2VName = boost::get(boost::vertex_name, m_inGraph);
> m_g2Com = boost::get(boost::vertex_com, m_inGraph);
> m_g2EmailsIn = boost::get(boost::edge_nEmailsIn, m_inGraph);
> m_g2EmailsOut = boost::get(boost::edge_nEmailsOut, m_inGraph);
> m_g2SourceVD = boost::get(boost::edge_sourceVD, m_inGraph);
> }
>


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