Boost logo

Boost Users :

Subject: Re: [Boost-users] [graph] in-depth parsing and modifications of the graph
From: Orianne Siret (orianne.siret_at_[hidden])
Date: 2013-07-23 09:48:47


Thanks a lot, it worked !

Le 12/07/2013 20:54, boost-users-request_at_[hidden] a écrit :
> Send Boost-users mailing list submissions to
> boost-users_at_[hidden]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
> or, via email, send a message with subject or body 'help' to
> boost-users-request_at_[hidden]
>
> You can reach the person managing the list at
> boost-users-owner_at_[hidden]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Boost-users digest..."
>
>
> Today's Topics:
>
> 1. [msm] access to root fsm (Alexander Mingalev)
> 2. Re: issues compiling Boost 1.54 thread on AIX5.2
> (Vicente J. Botet Escriba)
> 3. [boost format] Not getting expected errors (Rob Conde)
> 4. Re: [graph] in-depth parsing and modifications of the graph
> (Jeremiah Willcock)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 12 Jul 2013 20:29:36 +0400
> From: Alexander Mingalev <infest21h_at_[hidden]>
> To: boost-users_at_[hidden]
> Subject: [Boost-users] [msm] access to root fsm
> Message-ID: <51E02EF0.4010202_at_[hidden]>
> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
>
> I have main fsm with two sub-levels.
> The problem is, the sub-fsms need data which is held in root fsm, like:
>
> struct SomeAction
> {
> template <typename EVT, typename FSM, typename
> SourceState, typename TargetState>
> void operator()(EVT&, FSM& fsm, SourceState&,
> TargetState&) const
> {
> // ...
> }
> };
>
> Instance of fsm here might be root fsm as well as sub-fsm.
> I see two possible solutions:
>
> 1. use sm_ptr policy and store parent pointer in each sub-fsm
> In this case access might look like this:
>
> fsm.parent_->data; (access from 1-level fsm)
> fsm.parent_->parent_->data; (access from 2-level fsm)
>
> doesn't look so nice, besides, documentation states that using sm_ptr is
> deprecated.
>
> 2. recursively traverse all states, detect fsm's and store root pointer
>
> typedef RootFSM::stt stt;
> typedef boost::msm::back::generate_state_set<stt>::type all_states;
>
> boost::mpl::for_each<all_states, boost::msm::wrap<mpl::placeholders::_1> >
> (find_sub_fsm<stt>());
>
> template <typename stt>
> struct find_sub_fsm
> {
> template <class StateType>
> void operator()(boost::msm::wrap<StateType>& state) const
> {
> // ???
> // state.root_ = &g_root;
> // do the recurs
> }
> };
>
> How to detect that StateType is sub-fsm?
>
> 3. Maybe, there is a easier way to communicate between sub-fsm's?
>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: smime.p7s
> Type: application/pkcs7-signature
> Size: 4916 bytes
> Desc: S/MIME Cryptographic Signature
> URL: <http://lists.boost.org/boost-users/attachments/20130712/b9e3a24d/attachment.bin>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 12 Jul 2013 18:32:27 +0200
> From: "Vicente J. Botet Escriba" <vicente.botet_at_[hidden]>
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] issues compiling Boost 1.54 thread on
> AIX5.2
> Message-ID: <51E02F9B.1030102_at_[hidden]>
> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
>
> Le 12/07/13 16:53, Gert a ?crit :
>> Any clues here?
>>
>> Regards, Gert
>>
>> vacpp.compile.c++
>> bin.v2/libs/thread/build/vacpp/debug/address-model-64/link-static/runtime-link-static/threading-multi/pthread/thread.o
>>
>> xlC_r -c -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_STATIC_LINK=1
>> -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_DONT_USE_CHRONO
>> -DBOOST_THREAD_POSIX -qcpluscmt -qNOOPTimize -qnoinline -q64 -g -qfullpath
>> -qfuncsect -qeh -qrtti -I"." -o "bin
>> .v2/libs/thread/build/vacpp/debug/address-model-64/link-static/runtime-link-static/threading-multi/pthread/thread.o"
>> "libs/thread/src/pthread/thread.cpp"
>>
>> "./boost/smart_ptr/shared_ptr.hpp", line 82.43: 1540-0403 (S) "template
>> <class T, std::size_t N> struct boost::detail::sp_element<T [N]>" is already
>> defined.
>> "./boost/smart_ptr/shared_ptr.hpp", line 75.28: 1540-0425 (I) "sp_element<T
>> []>" is defined on line 75 of "./boost/smart_ptr/shared_ptr.hpp".
>> "./boost/smart_ptr/shared_ptr.hpp", line 131.43: 1540-0403 (S) "template
>> <class T, std::size_t N> struct boost::detail::sp_dereference<T [N]>" is
>> already defined.
>> "./boost/smart_ptr/shared_ptr.hpp", line 124.28: 1540-0425 (I)
>> "sp_dereference<T []>" is defined on line 124 of
>> "./boost/smart_ptr/shared_ptr.hpp".
>> "./boost/smart_ptr/shared_ptr.hpp", line 156.43: 1540-0403 (S) "template
>> <class T, std::size_t N> struct boost::detail::sp_member_access<T [N]>" is
>> already defined.
>> "./boost/smart_ptr/shared_ptr.hpp", line 149.28: 1540-0425 (I)
>> "sp_member_access<T []>" is defined on line 149 of
>> "./boost/smart_ptr/shared_ptr.hpp".
>> "./boost/smart_ptr/shared_ptr.hpp", line 181.43: 1540-0403 (S) "template
>> <class T, std::size_t N> struct boost::detail::sp_array_access<T [N]>" is
>> already defined.
>> "./boost/smart_ptr/shared_ptr.hpp", line 174.28: 1540-0425 (I)
>> "sp_array_access<T []>" is defined on line 174 of
>> "./boost/smart_ptr/shared_ptr.hpp".
>> "./boost/thread/detail/async_func.hpp", line 94.58: 1540-0711 (S) Too few
>> template arguments have been specified.
>> "./boost/thread/detail/async_func.hpp", line 166.54: 1540-0711 (S) Too few
>> template arguments have been specified.
>> "./boost/thread/detail/async_func.hpp", line 231.50: 1540-0711 (S) Too few
>> template arguments have been specified.
>> "./boost/thread/detail/async_func.hpp", line 291.46: 1540-0711 (S) Too few
>> template arguments have been specified.
>> "./boost/thread/detail/async_func.hpp", line 346.42: 1540-0711 (S) Too few
>> template arguments have been specified.
>> "./boost/thread/detail/async_func.hpp", line 396.38: 1540-0711 (S) Too few
>> template arguments have been specified.
>> "./boost/thread/detail/async_func.hpp", line 441.34: 1540-0711 (S) Too few
>> template arguments have been specified.
>> "./boost/thread/detail/async_func.hpp", line 481.30: 1540-0711 (S) Too few
>> template arguments have been specified.
>> "./boost/thread/detail/async_func.hpp", line 516.26: 1540-0711 (S) Too few
>> template arguments have been specified.
>> "./boost/thread/detail/async_func.hpp", line 546.22: 1540-0711 (S) Too few
>> template arguments have been specified.
>> "./boost/thread/cv_status.hpp", line 23.3: 1540-0219 (S) The call to
>> "operator==" has no best match.
>> "./boost/thread/cv_status.hpp", line 23.3: 1540-1229 (I) Argument number 1
>> is an rvalue of type "boost::cv_status::enum_type".
>> "./boost/thread/cv_status.hpp", line 23.3: 1540-1229 (I) Argument number 2
>> is an rvalue of type "boost::cv_status::enum_type".
>> "./boost/thread/cv_status.hpp", line 23.3: 1540-1202 (I) No candidate is
>> better than "builtin operator==(int, int)".
>> "./boost/thread/cv_status.hpp", line 23.3: 1540-1231 (I) The conversion from
>> argument number 1 to "int" uses "an integral promotion".
>> "./boost/thread/cv_status.hpp", line 23.3: 1540-1231 (I) The conversion from
>> argument number 2 to "int" uses "an integral promotion".
>> "./boost/thread/cv_status.hpp", line 23.3: 1540-1202 (I) No candidate is
>> better than "boost::operator==(self_type, enum_type)".
>> "./boost/thread/cv_status.hpp", line 23.3: 1540-1231 (I) The conversion from
>> argument number 1 to "boost::cv_status" uses the user-defined conversion
>> "boost::cv_status::cv_status(enum_type)" followed by "an lvalue-to-rvalue
>> transformatio
>> n".
>> ...
>> ...
>>
> Hi,
>
> the concerned code
>
> template< class T > struct sp_element< T[] >
> {
> typedef T type;
> };
>
> #if !defined( __BORLANDC__ ) || !BOOST_WORKAROUND( __BORLANDC__, < 0x600 )
>
> *template< class T, std::size_t N > struct sp_element< T[N] >**
> **{**
> ** typedef T type;**
> **};*
>
> #endif
>
> is conditionally included. Could you try to avoid the inclusion of
>
> template< class T, std::size_t N > struct sp_element< T[N] >
> {
> typedef T type;
> };
>
> for the VACPP compiler.
>
> BTW, is this a regression of 1.54?
>
> Best,
> Vicente
> -------------- next part --------------
> HTML attachment scrubbed and removed
>
> ------------------------------
>
> Message: 3
> Date: Fri, 12 Jul 2013 18:18:06 +0000
> From: Rob Conde <rob.conde_at_[hidden]>
> To: "boost-users_at_[hidden]" <boost-users_at_[hidden]>
> Subject: [Boost-users] [boost format] Not getting expected errors
> Message-ID:
> <e24680b0b7ec40fe9948093f8bfa3446_at_[hidden]>
>
> Content-Type: text/plain; charset="us-ascii"
>
> Hello,
> I'm doing:
>
> string myString = (boost::format("%i") % 1.1).str();
>
> I would expect that to either throw an error (preferred) or cast to an int and then format. I'm seeing a similar issue with %x and %o etc. Any thoughts?
>
> Rob Conde
> -------------- next part --------------
> HTML attachment scrubbed and removed
>
> ------------------------------
>
> Message: 4
> Date: Fri, 12 Jul 2013 14:54:43 -0400 (EDT)
> From: Jeremiah Willcock <jewillco_at_[hidden]>
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] [graph] in-depth parsing and modifications
> of the graph
> Message-ID: <alpine.LRH.2.03.1307121453500.9326_at_[hidden]>
> Content-Type: text/plain; charset="iso-8859-7"; Format="flowed"
>
> On Fri, 12 Jul 2013, Orianne Siret wrote:
>
>> I mean traverse when i said parse. So the problem is i can't traverse in depth-first order my graph and modify ?node (or edge) properties. I wrote a
>> basic case which doesn't work.
>>
>> -----------------------------------------
>> // Begin main.cpp
>>
>> #include <boost/graph/adjacency_list.hpp>
>> #include <boost/graph/depth_first_search.hpp>
>> #include <vector>
>>
>> // Node properties
>> struct MyNode
>> {
>> int node_id;
>> MyNode() : node_id() {}
>> MyNode(int id) : node_id(id) {}
>> };
>>
>> //Edge Properties
>> struct MyEdge
>> {
>> int edge_id;
>> MyEdge() : edge_id() {}
>> MyEdge(int id) : edge_id(id) {}
>> };
>>
>> // Graph definition
>> typedef boost::adjacency_list<
>> boost::vecS, boost::vecS, boost::directedS,
>> MyNode, MyEdge
>>> MyGraph;
>> typedef boost::graph_traits<MyGraph>::vertex_descriptor MyGraphVD;
>>
>> //My idiot visitor
>> class my_dfs_visitor : public boost::default_dfs_visitor
>> {
>> public:
>> template < typename Vertex, typename Graph > void discover_vertex(Vertex u, Graph & g)
>> {
>> ? ? ? ? ? ? ? ? // here i cant assign 0 to m node_id. however g is not cont.. I didn't find a code with a depth-first traversal and assign
>> ment.
>> g[u].node_id = 0;
>> }
>> };
>>
>> int main()
>> {
>> MyGraph g;
>> MyGraphVD vd0 = boost::add_vertex(MyNode(0), g);
>> MyGraphVD vd1 = boost::add_vertex(MyNode(1), g);
>>
>> boost::add_edge(vd0, vd1, MyEdge(), g);
>> boost::add_edge(vd1, vd0, MyEdge(), g);
>>
>> my_dfs_visitor visitor;
>> boost::depth_first_search(g, boost::visitor(visitor));
>> return 0;
>> }
>>
>> // end
>>
>> ------------------------------------------
>>
>> This code doesn't work. I have the following error :?../main.cpp:35:3: erreur: assignment of member ?MyNode::node_id? in read-only object.?
>> (I do: "g++ -O3 -Wall -c -o main.o main.cpp " for compilation, i run on linux ubuntu 12.04 with gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3)
>> I didn't find any example on the web..?
>>
>> Thanks for spending time on my problem. It is very nice of you.
> I think the easiest solution for you is to put a non-const reference to
> your graph into the visitor as a data member, then have your visitor's
> member functions refer to that reference rather than using the graph
> passed in by the algorithm.
>
> -- Jeremiah Willcock
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
> ------------------------------
>
> End of Boost-users Digest, Vol 3503, Issue 3
> ********************************************


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